From owner-cvs-src@FreeBSD.ORG Thu May 20 19:57:44 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 68A3016A4CE; Thu, 20 May 2004 19:57:44 -0700 (PDT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 105C743D2D; Thu, 20 May 2004 19:57:44 -0700 (PDT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.11/8.12.11) with ESMTP id i4L2urJA038465; Thu, 20 May 2004 20:56:53 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Thu, 20 May 2004 20:56:54 -0600 (MDT) Message-Id: <20040520.205654.10906740.imp@bsdimp.com> To: nate@root.org From: "M. Warner Losh" In-Reply-To: <20040520194832.I44800@root.org> References: <20040520174908.I44439@root.org> <20040520.203351.39157350.imp@bsdimp.com> <20040520194832.I44800@root.org> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: peadar@freebsd.org cc: cvs-src@freebsd.org Subject: Re: cvs commit: src/sys/dev/acpica acpivar.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 May 2004 02:57:44 -0000 In message: <20040520194832.I44800@root.org> Nate Lawson writes: : On Thu, 20 May 2004, M. Warner Losh wrote: : > In message: <20040520174908.I44439@root.org> : > Nate Lawson writes: : > : Interesting, I didn't get that in my testing. Try this patch: : > : : > : Index: /sys/sys/bus.h : > : =================================================================== : > : RCS file: /home/ncvs/src/sys/sys/bus.h,v : > : retrieving revision 1.58 : > : diff -u -r1.58 bus.h : > : --- /sys/sys/bus.h 17 Mar 2004 17:40:34 -0000 1.58 : > : +++ /sys/sys/bus.h 21 May 2004 00:48:23 -0000 : > : @@ -456,8 +456,9 @@ : > : static __inline type varp ## _get_ ## var(device_t dev) \ : > : { \ : > : uintptr_t v; \ : > : - BUS_READ_IVAR(device_get_parent(dev), dev, \ : > : - ivarp ## _IVAR_ ## ivar, &v); \ : > : + if (BUS_READ_IVAR(device_get_parent(dev), dev, \ : > : + ivarp ## _IVAR_ ## ivar, &v) != 0) \ : > : + v = (type) 0; \ v = (type) 0; is likely wrong too :-) Why not -1 or 12 or 0xdeadbeef? : > : return ((type) v); \ : > : } \ : > : \ : > : I don't know if this change will be acceptable though. It's probably : > : better to change the get function to take a pointer argument and return : > : the value from BUS_READ_IVAR. : > : > No can do. All the pci get functions are implemented in terms of this : > macro, and changing all the drivers in the tree to behave as you : > suggest would be extremely painful. : : Augh, I assume this also applies to making it varp_get_var(device_t dev, : uintptr_t value) ? It's lousy that this doesn't check the return value. I'm not sure I understand what you are saying. Warner