[Top] [All Lists]

Re: Missing set?

To: Harald Koerfgen <>,
Subject: Re: Missing set?
Date: Mon, 19 Oct 1998 03:41:28 +0200
In-reply-to: <>; from Harald Koerfgen on Fri, Oct 16, 1998 at 12:44:45PM +0200
References: <> <>
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.


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