From owner-freebsd-hackers Wed Nov 29 01:33:26 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id BAA24655 for hackers-outgoing; Wed, 29 Nov 1995 01:33:26 -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 BAA24647 for ; Wed, 29 Nov 1995 01:33:20 -0800 Received: from msmith@localhost by genesis.atrad.adelaide.edu.au (8.6.12/8.6.9) id JAA11541; Wed, 29 Nov 1995 09:27:22 GMT From: Michael Smith Message-Id: <199511290927.JAA11541@genesis.atrad.adelaide.edu.au> Subject: Re: more device driver question 8) To: julian@ref.tfs.com (Julian Elischer) Date: Wed, 29 Nov 1995 09:27:22 +0000 () Cc: msmith@atrad.adelaide.edu.au, hackers@freebsd.org In-Reply-To: <199511290922.BAA01693@ref.tfs.com> from "Julian Elischer" at Nov 29, 95 01:22:14 am MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 1165 Sender: owner-hackers@freebsd.org Precedence: bulk Julian Elischer stands accused of saying: > > I can't see how to avoid this race; I'm sure it must be possible, but > > browsing other drivers yields no immediate inspiration. > > Some sleep at raised interrupt level: > > > > 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? 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? Thanks. -- ]] 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." [[