Subject: port-i386/3306: There is no real splaudio()
To: None <gnats-bugs@gnats.netbsd.org>
From: Lennart Augustsson <augustss@cs.chalmers.se>
List: netbsd-bugs
Date: 03/09/1997 01:41:53
>Number:         3306
>Category:       port-i386
>Synopsis:       There is no real splaudio()
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Mar  8 16:50:01 1997
>Last-Modified:
>Originator:     Lennart Augustsson
>Organization:
Department of Computing Science, Chalmers University
>Release:        NetBSD-current 97-03-08
>Environment:
System: NetBSD calvin.cs.chalmers.se 1.2C NetBSD 1.2C (CALVIN) #114: Sun Mar 9 01:29:33 MET 1997 augustss@calvin.cs.chalmers.se:/usr/src/sys/arch/i386/compile/CALVIN i386


>Description:
	The current implementation of the audio driver defines splaudio()
	to be splbio().  Given the recent changes in the spl stuff for
	the i386 isn't it time to rectify this?
	Giving the audio driver its own spl level gives a small performance
	improvement when playing high bandwidth audio.
>How-To-Repeat:
	Just check the code (audio_if.h) and see for yourself.
>Fix:
	This patch adds an IPL_AUDIO level for the i386 port, and changes
	audio_if.h to use it if it is defined.
	I'm not sure if the exact numerical IPL_AUDIO value has
	any significance.  Has it Charles?

*** /usr/src/sys/dev/audio_if.h.orig	Sun Mar  9 01:03:48 1997
--- /usr/src/sys/dev/audio_if.h	Sun Mar  9 01:08:11 1997
***************
*** 132,136 ****
--- 132,139 ----
  #define AUDIOUNIT(x)		(minor(x)&0x0f)
  #define AUDIODEV(x)		(minor(x)&0xf0)
  
+ #if !defined(IPL_AUDIO)
+ /* XXX remove when all ports have splaudio & IPL_AUDIO */
  #define splaudio splbio		/* XXX */
  #define IPL_AUDIO IPL_BIO	/* XXX */
+ #endif /* !defined(IPL_AUDIO) */
*** /usr/src/sys/arch/i386/include/intr.h.orig	Sun Mar  9 01:09:49 1997
--- /usr/src/sys/arch/i386/include/intr.h	Sun Mar  9 01:17:28 1997
***************
*** 33,41 ****
  #define _I386_INTR_H_
  
  /* Interrupt priority `levels'. */
! #define	IPL_NONE	8	/* nothing */
! #define	IPL_SOFTCLOCK	7	/* timeouts */
! #define	IPL_SOFTNET	6	/* protocol stacks */
  #define	IPL_BIO		5	/* block I/O */
  #define	IPL_NET		4	/* network */
  #define	IPL_SOFTSERIAL	3	/* serial */
--- 33,42 ----
  #define _I386_INTR_H_
  
  /* Interrupt priority `levels'. */
! #define	IPL_NONE	9	/* nothing */
! #define	IPL_SOFTCLOCK	8	/* timeouts */
! #define	IPL_SOFTNET	7	/* protocol stacks */
! #define	IPL_AUDIO	6	/* audio drivers */
  #define	IPL_BIO		5	/* block I/O */
  #define	IPL_NET		4	/* network */
  #define	IPL_SOFTSERIAL	3	/* serial */
***************
*** 44,50 ****
  #define	IPL_CLOCK	1	/* clock */
  #define	IPL_HIGH	1	/* everything */
  #define	IPL_SERIAL	0	/* serial */
! #define	NIPL		9
  
  /* Interrupt sharing types. */
  #define	IST_NONE	0	/* none */
--- 45,51 ----
  #define	IPL_CLOCK	1	/* clock */
  #define	IPL_HIGH	1	/* everything */
  #define	IPL_SERIAL	0	/* serial */
! #define	NIPL		10
  
  /* Interrupt sharing types. */
  #define	IST_NONE	0	/* none */
***************
*** 121,126 ****
--- 122,128 ----
  #define	splclock()	splraise(imask[IPL_CLOCK])
  #define	splimp()	splraise(imask[IPL_IMP])
  #define	splserial()	splraise(imask[IPL_SERIAL])
+ #define	splaudio()	splraise(imask[IPL_AUDIO])
  #define	splstatclock()	splclock()
  
  /*
>Audit-Trail:
>Unformatted: