Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Nov 1995 11:47:12 +0000 ()
From:      Michael Smith <msmith@atrad.adelaide.edu.au>
To:        bde@zeta.org.au (Bruce Evans)
Cc:        julian@ref.tfs.com, msmith@atrad.adelaide.edu.au, hackers@FreeBSD.org
Subject:   Re: more device driver question 8)
Message-ID:  <199511301147.LAA13395@genesis.atrad.adelaide.edu.au>
In-Reply-To: <199511291340.AAA24528@godzilla.zeta.org.au> from "Bruce Evans" at Nov 30, 95 00:40:14 am

next in thread | previous in thread | raw e-mail | index | archive | help
Bruce Evans stands accused of saying:
> >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.

In the context of my original message, enable_interrupt() enables 
interrupt generation on the card.  I was looking for a means whereby
I could avoid the race that would occur between enabling interrupts on
the card and subsequently sleeping, as it's possible that if the operation
were small, there'd be no more interrupts after the first, and the sleep
would either never return, or at least take the full timeout before it
did.

> Bruce

-- 
]] Mike Smith, Software Engineer        msmith@atrad.adelaide.edu.au    [[
]] Genesis Software                     genesis@atrad.adelaide.edu.au   [[
]] High-speed data acquisition and      (GSM mobile) 041-122-496        [[
]] realtime instrument control          (ph/fax)  +61-8-267-3039        [[
]] "Who does BSD?" "We do Chucky, we do."                               [[



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