From owner-freebsd-arch@FreeBSD.ORG Fri Aug 6 15:58:31 2010 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F4A51065673 for ; Fri, 6 Aug 2010 15:58:31 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 0EDBB8FC0C for ; Fri, 6 Aug 2010 15:58:31 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id A031F46C05; Fri, 6 Aug 2010 11:58:30 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 898778A03C; Fri, 6 Aug 2010 11:58:29 -0400 (EDT) From: John Baldwin To: freebsd-arch@freebsd.org Date: Fri, 6 Aug 2010 10:30:03 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100217; KDE/4.4.5; amd64; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201008061030.03214.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 06 Aug 2010 11:58:29 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Subject: Re: Change to sysctl to support linux kobj X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2010 15:58:31 -0000 On Thursday, August 05, 2010 5:46:07 pm Jeff Roberson wrote: > Hi folks, > > I really need two pointer arguments to a sysctl function to support linux > sysfs via sysctl. To facilitate this I propose changing the int arg2 to a > uinptr_t. This keeps it as an integer type but makes it wide enough to > accept a pointer. A small number of places in the kernel have to be fixed > for the new type or because they don't use SYSCTL_HANDLER_ARGS. This will > introduce an api/abi incompatibility although it is relatively minor. > > Comments? Alternatives? Presumably it should be intptr_t to stay signed. One could always create a structure that holds the two pointers and pass that as arg1 also which is what other code does that needs to pass in more than a simple pointer to an int, etc. as well. > Thanks, > Jeff > > Index: sysctl.h > =================================================================== > --- sysctl.h (revision 207767) > +++ sysctl.h (working copy) > @@ -114,8 +114,8 @@ > #define CTL_AUTO_START 0x100 > > #ifdef _KERNEL > -#define SYSCTL_HANDLER_ARGS struct sysctl_oid *oidp, void *arg1, int arg2, \ > - struct sysctl_req *req > +#define SYSCTL_HANDLER_ARGS struct sysctl_oid *oidp, void *arg1, \ > + uintptr_t arg2, struct sysctl_req *req > > /* definitions for sysctl_req 'lock' member */ > #define REQ_UNLOCKED 0 /* not locked and not wired */ > @@ -158,7 +158,7 @@ > int oid_number; > u_int oid_kind; > void *oid_arg1; > - int oid_arg2; > + uintptr_t oid_arg2; > const char *oid_name; > int (*oid_handler)(SYSCTL_HANDLER_ARGS); > const char *oid_fmt; > > _______________________________________________ > freebsd-arch@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org" > -- John Baldwin