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/16/2004 23:51:20
On Thu, Dec 16, 2004 at 10:33:54PM +0000, Charles M. Hannum wrote:
> On Thursday 16 December 2004 22:14, Manuel Bouyer wrote:
> > Hi,
> > while trying to get current/xen working again I found something that
> > I don't understannd in the x86 spllower() function:
> >
> > struct cpu_info *ci = curcpu();
> > u_int32_t imask;
> > u_long psl;
> >
> > __insn_barrier();
> >
> > imask = IUNMASK(ci, nlevel);
> > psl = read_psl();
> > disable_intr();
> > if (ci->ci_ipending & imask) {
> > Xspllower(nlevel);
> > /* Xspllower does enable_intr() */
> > } else {
> > ci->ci_ilevel = nlevel;
> > write_psl(psl);
> > }
> >
> > What will do enable_intr() when Xspllower() is not called ?
>
> The interrupt flag is in the "PSL", and therefore will get restored to its
> initial value by the write_psl().
OK, thanks. Well, this won't work for xen, where disabling/enabling interrupts
is done by writing a memory shared with the hyperviror.
Does read_psl()/write_psl() do something else than just cli/sti here ?
Could this be changed to cli()/sti() (which are macro doing the right
thing on port-xen) ?
--
Manuel Bouyer <bouyer@antioche.eu.org>
NetBSD: 26 ans d'experience feront toujours la difference
--