Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Sep 95 15:22:12 -0700
From:      deborah@gallifrey.microunity.com (Deborah Gronke Bennett)
To:        freebsd-hackers@freebsd.org
Subject:   spl'ing to a specific interrupt level
Message-ID:  <9509292222.AA29660@gallifrey>

next in thread | raw e-mail | index | archive | help
I'm writing a device driver for a device which is not a bio device,
not a tty device and not a net device. Thus when I config the device
I use none of these keywords, and my interrupt level is not added to
any of the masks.

What I want to know is how I can spl to my specific interrupt level
around critical sections. I'm most recently familiar with SunOS,
where I did something like this:

saved_ipl = splx(spl_level_of_my_device);
	...
	critical section here
	...
(void) splx(saved_ipl)

The effect of this was to raise the interrupt level mask to the level
of my device while I was in a critical section, and restore it to
whatever it was before at the end.

I've perused the FreeBSD 2.0.5 source tree, and all I can find
is the splbio, spltty, etc macros defined with GENSPL in 
<machine>/include/spl.h, which are all for specific group classes.
Am I forced to add myself of one of the bio, tty or net classes if
I want to block interrupts during a critical section in this way?
Or have I missed something? (Pointers to which source file to
find this in are welcome).

Thanks for your help,
-deborah bennett
----------
Deborah Gronke Bennett 	(WD5HJH) 	kernel and device drivers engineer
deborah@microunity.com			(408)-734-8100
MicroUnity Systems Eng., 255 Caspian Drive, Sunnyvale, CA 94089-1015 USA

I'm still looking to buy source code for the cscope program or
the C programmer's toolchest containing it.

UNIX is a trademark of whoever bought it this week . . .




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9509292222.AA29660>