PERFORCE change 154200 for review
Marko Zec
zec at FreeBSD.org
Sat Dec 6 09:32:19 PST 2008
http://perforce.freebsd.org/chv.cgi?CH=154200
Change 154200 by zec at zec_tpx32 on 2008/12/06 17:31:48
Make options VIMAGE builds actually work by unbreaking
handlers for virtualized sysctls.
Affected files ...
.. //depot/projects/vimage/src/sys/kern/kern_sysctl.c#15 edit
.. //depot/projects/vimage/src/sys/netinet/in_pcb.c#45 edit
.. //depot/projects/vimage/src/sys/sys/sysctl.h#29 edit
Differences ...
==== //depot/projects/vimage/src/sys/kern/kern_sysctl.c#15 (text+ko) ====
@@ -881,7 +881,9 @@
{
int error, s, tt;
- tt = *(int *)oidp->oid_arg1;
+ SYSCTL_RESOLVE_V_ARG1();
+
+ tt = *(int *)arg1;
s = (int)((int64_t)tt * 1000 / hz);
error = sysctl_handle_int(oidp, &s, 0, req);
@@ -892,7 +894,7 @@
if (tt < 1)
return (EINVAL);
- *(int *)oidp->oid_arg1 = tt;
+ *(int *)arg1 = tt;
return (0);
}
==== //depot/projects/vimage/src/sys/netinet/in_pcb.c#45 (text+ko) ====
@@ -125,7 +125,9 @@
INIT_VNET_INET(curvnet);
int error;
- error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req);
+ SYSCTL_RESOLVE_V_ARG1();
+
+ error = sysctl_handle_int(oidp, arg1, arg2, req);
if (error == 0) {
RANGECHK(V_ipport_lowfirstauto, 1, IPPORT_RESERVED - 1);
RANGECHK(V_ipport_lowlastauto, 1, IPPORT_RESERVED - 1);
==== //depot/projects/vimage/src/sys/sys/sysctl.h#29 (text+ko) ====
@@ -415,21 +415,28 @@
#define SYSCTL_RESOLVE_V_ARG1() do { \
char *cp; \
switch (oidp->oid_v_subs) { \
+ case V_GLOBAL: \
+ /* do nothing - this is NOT a virtualized variable! */ \
+ break; \
case V_NET: \
cp = (char *) \
TD_TO_VNET(curthread)->mod_data[oidp->oid_v_mod]; \
+ arg1 = cp + (size_t) arg1; \
break; \
case V_PROCG: \
cp = (char *) TD_TO_VPROCG(curthread); \
+ arg1 = cp + (size_t) arg1; \
break; \
case V_CPU: \
cp = (char *) TD_TO_VCPU(curthread); \
+ arg1 = cp + (size_t) arg1; \
break; \
default: \
panic("unsupported module id %d", oidp->oid_v_subs); \
} \
- arg1 = cp + (size_t) arg1; \
} while (0)
+#else
+#define SYSCTL_RESOLVE_V_ARG1()
#endif
#endif /* _KERNEL */
More information about the p4-projects
mailing list