Subject: Re: question about x86 spllower()
To: Charles M. Hannum <abuse@spamalicious.com>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: port-i386
Date: 12/17/2004 00:31:47
On Thu, Dec 16, 2004 at 11:25:57PM +0000, Charles M. Hannum wrote:
> On Thursday 16 December 2004 23:08, Manuel Bouyer wrote:
> > From the commit message, this was to avoid deadlock issues on IPIs.
> > I can't see why what could change in the interrupt flag here between
> > the read_psl() and write_psl(), disable_intr() only does a cli().
> > And if Xspllower() is called, we won't restore the interrupt flags we saved
> 
> You really don't get how this works, do you?  CLI/STI are special instructions 
> to change the interrupt flag in the PSL without whacking the whole register.

Yes, that's why I didn't understant why we would want to save/restore the
whole register in this case. I got it later: we do it this way, only because
we don't know if interrupts are already disabled or not, and it they're already
disabled we don't want to reenable them.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--