Date: Thu, 30 Nov 1995 00:40:14 +1100 From: Bruce Evans <bde@zeta.org.au> To: julian@ref.tfs.com, msmith@atrad.adelaide.edu.au Cc: hackers@freebsd.org Subject: Re: more device driver question 8) Message-ID: <199511291340.AAA24528@godzilla.zeta.org.au>
next in thread | raw e-mail | index | archive | help
>> > spltty() >> > tsleep(...) >> > splx() >> > >> > Does this imply that tsleep() restores the base interrupt level while >> > it's running? >> exactly, >> It schedules another process, which will be at some OTHER >> interrupt priority level, it does it 'atomicly' too.. >Ah. This implies that interrupt priorities are kept on a per-process basis, >correct? They are kept in local variables. Except above :-). >So for a 'tty' device driver, I could safely say >spltty() >enable_interrupt() >tsleep() >splx() >and be sure that interrupts from the device won't be enabled until after >the current process sleeps? The spltty() would do that. I don't know what enable_interrupt() is. Perhaps you meant disable_intr(). That would probably disable interrupts forever. Don't use disable_intr() except in short (< 10 usec) critical regions. Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199511291340.AAA24528>