From owner-freebsd-current@FreeBSD.ORG Sun Jul 17 02:09:46 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2829C16A41C for ; Sun, 17 Jul 2005 02:09:46 +0000 (GMT) (envelope-from rodrigc@crodrigues.org) Received: from rwcrmhc12.comcast.net (rwcrmhc12.comcast.net [216.148.227.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id E1A6443D46 for ; Sun, 17 Jul 2005 02:09:45 +0000 (GMT) (envelope-from rodrigc@crodrigues.org) Received: from c-66-30-114-143.hsd1.ma.comcast.net ([66.30.114.143]) by comcast.net (rwcrmhc12) with ESMTP id <200507170209450140032cqre>; Sun, 17 Jul 2005 02:09:45 +0000 Received: from c-66-30-114-143.hsd1.ma.comcast.net (localhost.127.in-addr.arpa [127.0.0.1]) by c-66-30-114-143.hsd1.ma.comcast.net (8.13.4/8.13.1) with ESMTP id j6H29k1X042325 for ; Sat, 16 Jul 2005 22:09:46 -0400 (EDT) (envelope-from rodrigc@c-66-30-114-143.hsd1.ma.comcast.net) Received: (from rodrigc@localhost) by c-66-30-114-143.hsd1.ma.comcast.net (8.13.4/8.13.1/Submit) id j6H29kbU042324 for freebsd-current@freebsd.org; Sat, 16 Jul 2005 22:09:46 -0400 (EDT) (envelope-from rodrigc) Date: Sat, 16 Jul 2005 22:09:46 -0400 From: Craig Rodrigues To: freebsd-current@freebsd.org Message-ID: <20050717020946.GA42304@crodrigues.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.9i Subject: Problem compiling sched_ule.c X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2005 02:09:46 -0000 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 -- Craig Rodrigues rodrigc@crodrigues.org