Subject: Re: how to avoid re-ordering?
To: Witold J. Wnuk <>
From: Frank van der Linden <>
List: tech-kern
Date: 12/17/2001 16:16:13
On Mon, Dec 17, 2001 at 03:22:40PM +0100, Witold J. Wnuk wrote:
> You are referring to "FREE_LOCK(&lk)" calls, right? (as opposed to the rest 
> of FREE_LOCK calls)
>         movl lk,%edx
>         movl %edx,cpl
>         movl ipending,%eax
>         movl $-1,lk+4			// HERE lk.lkt_held is updated after cpl
>         xorl $-1,%edx
>         testl %eax,%edx
>         je .L443
>         call Xspllower
> If so, shouldn't "static struct lockit lk" be declared volatile?

It is modified from an interrupt context, so it should be declared
volatile. Though making sure that spl/splx can't be reordered
for additional safety seems like sane thing to do as well.

- Frank

Frank van der Linden                 
Quality NetBSD CDs, Support & Service.