linux-mips-fnet
[Top] [All Lists]

Re: Missing set?

To: Harald Koerfgen <harald.koerfgen@netcologne.de>, linux-mips@fnet.fr
Subject: Re: Missing set?
From: ralf@uni-koblenz.de
Date: Mon, 19 Oct 1998 03:41:28 +0200
In-reply-to: <XFMail.981016124445.harald.koerfgen@netcologne.de>; from Harald Koerfgen on Fri, Oct 16, 1998 at 12:44:45PM +0200
References: <Pine.LNX.3.96.981015230340.6202B-100000@apt4g.a3nyc.com> <XFMail.981016124445.harald.koerfgen@netcologne.de>
On Fri, Oct 16, 1998 at 12:44:45PM +0200, Harald Koerfgen wrote:

> People, when writing device drivers for DECstations, DO NEVER EVER use code 
> like:
> 
>     save_flags(flags);
>     [disable or enable interrupts with en/disable_irq(irq)]
>     restore(flags);
> 
> That simply doesn't work and will cause endless headache.

Which is the proof that the implementation is broken.  Since restore_flags
is only ever used to restore one single bit, the interrupt enable bit is
actually the only bit that needs to be restored.  The current implementation
deliberately ignores this because on the so far supported platforms there
is no need to deal with this problem which saves a couple of instructions.

The second possibility to fix this is to modify enable_irq/disable_irq
such that they don't actually fiddle around with the status register bits
but either do nothing at all or use an interrupt disable bit in the
external interrupt source.  The bits in the status register will then be
set on bootup and will stay unchanged after that.

  Ralf

<Prev in Thread] Current Thread [Next in Thread>