Date: Fri, 22 Jul 2005 15:39:54 -0400 From: John Baldwin <jhb@FreeBSD.org> To: freebsd-current@freebsd.org Cc: Craig Rodrigues <rodrigc@crodrigues.org> Subject: Re: Problem compiling sched_ule.c Message-ID: <200507221539.55166.jhb@FreeBSD.org> In-Reply-To: <20050717020946.GA42304@crodrigues.org> References: <20050717020946.GA42304@crodrigues.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Saturday 16 July 2005 10:09 pm, Craig Rodrigues wrote: > Hi, > > After the recent changes to the macros to atomic.h, I am getting > compilation warnings in sched_ule.c. > > /usr/src/sys/kern/sched_ule.c: In function `kseq_assign': > /usr/src/sys/kern/sched_ule.c:654: warning: passing arg 1 of > `atomic_cmpset_int' from incompatible pointer type > /usr/src/sys/kern/sched_ule.c:654: warning: passing arg 2 of > `atomic_cmpset_int' makes integer from pointer without a cast > /usr/src/sys/kern/sched_ule.c:654: warning: passing arg 3 of > `atomic_cmpset_int' makes integer from pointer without a cast > /usr/src/sys/kern/sched_ule.c: In function `kseq_notify': > /usr/src/sys/kern/sched_ule.c:691: warning: passing arg 1 of > `atomic_cmpset_int' from incompatible pointer type > /usr/src/sys/kern/sched_ule.c:691: warning: passing arg 2 of > `atomic_cmpset_int' makes integer from pointer without a cast > /usr/src/sys/kern/sched_ule.c:691: warning: passing arg 3 of > `atomic_cmpset_int' makes integer from pointer without a cast *** Error > code 1 > > > Is this the correct way to fix this: > > > --- /usr/src/sys/kern/sched_ule.c.orig Sat Jul 16 21:42:07 2005 > +++ /usr/src/sys/kern/sched_ule.c Sat Jul 16 22:09:00 2005 > @@ -651,7 +651,8 @@ > > do { > *(volatile struct kse **)&ke = kseq->ksq_assigned; > - } while(!atomic_cmpset_ptr(&kseq->ksq_assigned, ke, NULL)); > + } while(!atomic_cmpset_ptr((uintptr_t *)&kseq->ksq_assigned, > + (uintptr_t)ke, (uintptr_t)NULL)); > for (; ke != NULL; ke = nke) { > nke = ke->ke_assign; > kseq->ksq_group->ksg_load--; > @@ -688,7 +689,8 @@ > */ > do { > *(volatile struct kse **)&ke->ke_assign = kseq->ksq_assigned; > - } while(!atomic_cmpset_ptr(&kseq->ksq_assigned, ke->ke_assign, ke)); > + } while(!atomic_cmpset_ptr((uintptr_t *)&kseq->ksq_assigned, > + (uintptr_t)ke->ke_assign, (uintptr_t)ke)); > /* > * Without sched_lock we could lose a race where we set NEEDRESCHED > * on a thread that is switched out before the IPI is delivered. This Yes. -- John Baldwin <jhb@FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200507221539.55166.jhb>