Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Oct 1995 00:02:32 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        deborah@microunity.com, julian@ref.tfs.com
Cc:        freebsd-hackers@freebsd.org, terry@lambert.org
Subject:   Re: spl'ing to a specific interrupt level
Message-ID:  <199509301402.AAA05291@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>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



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