From owner-freebsd-hackers Wed Nov 29 17:30:49 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id RAA11147 for hackers-outgoing; Wed, 29 Nov 1995 17:30:49 -0800 Received: from genesis.atrad.adelaide.edu.au (genesis.atrad.adelaide.edu.au [129.127.96.120]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id RAA11142 for ; Wed, 29 Nov 1995 17:30:44 -0800 Received: from msmith@localhost by genesis.atrad.adelaide.edu.au (8.6.12/8.6.9) id LAA13395; Thu, 30 Nov 1995 11:47:13 GMT From: Michael Smith Message-Id: <199511301147.LAA13395@genesis.atrad.adelaide.edu.au> Subject: Re: more device driver question 8) To: bde@zeta.org.au (Bruce Evans) Date: Thu, 30 Nov 1995 11:47:12 +0000 () Cc: julian@ref.tfs.com, msmith@atrad.adelaide.edu.au, hackers@FreeBSD.org In-Reply-To: <199511291340.AAA24528@godzilla.zeta.org.au> from "Bruce Evans" at Nov 30, 95 00:40:14 am MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 1319 Sender: owner-hackers@FreeBSD.org Precedence: bulk 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." [[