DragonFly BSD
DragonFly commits List (threaded) for 2004-04
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: cvs commit: src/sys/kern kern_timeout.c


From: YONETANI Tomokazu <qhwt+dragonfly-commits@xxxxxxxxxx>
Date: Mon, 26 Apr 2004 00:19:00 +0900

Hi.
On Mon, Mar 15, 2004 at 12:23:48PM -0800, Matthew Dillon wrote:
> dillon      2004/03/15 12:23:48 PST
> 
> DragonFly src repository
> 
>   Modified files:
>     sys/kern             kern_timeout.c 
>   Log:
>   nextsoftcheck (which is a really aweful interrupt interlock hack) needs to
>   be volatile.
>   
>   Revision  Changes    Path
>   1.8       +1 -1      src/sys/kern/kern_timeout.c
> 
> 
> http://www.dragonflybsd.org/cvsweb/src/sys/kern/kern_timeout.c.diff?r1=1.7&r2=1.8&f=h

I'm seeing the following warnings after this change:
/home/source/dragonfly/src/sys/kern/kern_timeout.c:114: warning: assignment discards qualifiers from pointer target type
/home/source/dragonfly/src/sys/kern/kern_timeout.c:138: warning: assignment discards qualifiers from pointer target type

The current code makes the memory object pointed to by nextsoftcheck
volatile(so that accesses to members of nextsoftcheck are not cached),
but not the nextsoftcheck itself. Since c has no volatile qualifier,
derefences through c is not volatile, making the volatility on
nextsoftcheck useless.

If you want to make nextsoftcheck itself volatile, you have to change
it as follows:

static struct callout *volatile nextsoftcheck;

If you want to make both nextsoftcheck and the memory location pointed to
by it volatile:

static volatile struct callout *volatile nextsoftcheck;



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]