Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Dec 1996 13:18:09 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        msmith@atrad.adelaide.edu.au, tony@nlanr.net
Cc:        hackers@freebsd.org
Subject:   Re: Driver help
Message-ID:  <199612030218.NAA11739@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
> - It's probably not actually necessary to disable tty interrupts
>   while doing any of the read in this particular driver, but for
>   many the possibility of conflict is real.

Interrupts should not be disabled while doing the uiomove() for
several reasons:
- it's antisocial to disable interrupts for a long time.
- uiomove() is certain to take a long time if it blocks because it
  gets a pagefault and has to read the page from a disk.
- disabling interrupts doesn't actually disable them if uiomove()
  blocks.  Then the process doing the reading will usually sleep
  and another process may run.  You have to assume that uiomove()
  blocked and another process ran inside the driver and clobbered all
  the clobberable variables.  You have to do this even if the driver
  doesn't use interrupts so that disabling interrupts is unnecessary.
  There is no such thing as exclusive access, since dup() or fork()
  may have duplicated an open file descriptor for the device.

Bruce



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