Date: Thu, 5 Aug 2010 11:46:07 -1000 (HST) From: Jeff Roberson <jroberson@jroberson.net> To: arch@freebsd.org Subject: Change to sysctl to support linux kobj Message-ID: <alpine.BSF.2.00.1008051140280.1414@desktop>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.1008051140280.1414>
