From owner-freebsd-hackers Sat Sep 30 07:07:11 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id HAA01093 for hackers-outgoing; Sat, 30 Sep 1995 07:07:11 -0700 Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.34]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id HAA01088 for ; Sat, 30 Sep 1995 07:07:01 -0700 Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id AAA05291; Sun, 1 Oct 1995 00:02:32 +1000 Date: Sun, 1 Oct 1995 00:02:32 +1000 From: Bruce Evans Message-Id: <199509301402.AAA05291@godzilla.zeta.org.au> To: deborah@microunity.com, julian@ref.tfs.com Subject: Re: spl'ing to a specific interrupt level Cc: freebsd-hackers@freebsd.org, terry@lambert.org Sender: owner-hackers@freebsd.org Precedence: bulk >go for tty for now and as we fiddle with the kernel >you can use something else when it's easier :) This seems best. Class tty is already used for all the tty drivers, lpt, mse, psm, pca, gp, gsc, labpc, tw and asc, although this is bogus for pca (it uses clock interrupts), gp and gsc (these don't use interrupts and use splbio() to guard the dma registers). Alternative, worse, methods include: - don't use a driver class, and use splhigh() to block interrupts. This method is used by the sound drivers. It only works if interrupts are only splhigh() off for short periods. It has the advantage or disadvantage that hardware interrupts don't block other drivers. - manage the interrupt masks yourself, then use the GENSPL() macro. This method is used by the npx driver, except it needs stronger masking than is provided by splany() so it doesn't actually use GENSPL(). >> is called. Just before register_intr is called to add my interrupt >> service routine to the proper level, INTRMASK is called to add my >> irq level to one of tty_imask, bio_imask, net_imask or SWI_CLOCK_MASK. >> (Which one depends on the keyword in my config line). >> >> My understanding of the splXXX routines is that you call them to block >> critical sections which could somehow depend on each other - that's >> why you have the classes of bio (disk devices), net (network) >> and tty (serial devices). My quandry is that I don't want to block >> anything else I don't need to - I just want a routine to call >> to raise the spl level to my level (whatever I put after the "irq" >> on my config line). Is my only solution in this case to call splsoftclock? Don't call splsoftclock(). It lowers the ipl to a fixed level and isn't good for much (its use is currently disabled even in the place that it was designed for, in hardclock(), because calling it from there allowed unbounded interrupt nesting). SWI_CLOCK_MASK is added to the level for your interrupt (in intr_mask[your_interrupt]), not the other way round. Bruce