From owner-freebsd-arch@FreeBSD.ORG Thu Aug 5 22:12:22 2010 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AADF4106566C for ; Thu, 5 Aug 2010 22:12:22 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com [209.85.216.175]) by mx1.freebsd.org (Postfix) with ESMTP id 6CDAB8FC24 for ; Thu, 5 Aug 2010 22:12:22 +0000 (UTC) Received: by qyk11 with SMTP id 11so3817545qyk.13 for ; Thu, 05 Aug 2010 15:12:21 -0700 (PDT) Received: by 10.224.20.78 with SMTP id e14mr5337447qab.135.1281044725964; Thu, 05 Aug 2010 14:45:25 -0700 (PDT) Received: from [10.0.1.198] (udp022762uds.hawaiiantel.net [72.234.79.107]) by mx.google.com with ESMTPS id r38sm758747qcs.2.2010.08.05.14.45.23 (version=SSLv3 cipher=RC4-MD5); Thu, 05 Aug 2010 14:45:24 -0700 (PDT) Date: Thu, 5 Aug 2010 11:46:07 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: arch@freebsd.org Message-ID: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII Cc: Subject: 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: Thu, 05 Aug 2010 22:12:22 -0000 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? 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;