PERFORCE change 168945 for review

Ana Kukec anchie at FreeBSD.org
Sun Sep 27 21:12:09 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=168945

Change 168945 by anchie at p4imunes on 2009/09/27 21:11:59

	The introduction of vnet_sysctl_handle_long() and
	vnet_sysctl_handle_ulong() functions.	

Affected files ...

.. //depot/projects/vimage/src/sys/net/vnet.c#5 edit
.. //depot/projects/vimage/src/sys/net/vnet.h#32 edit

Differences ...

==== //depot/projects/vimage/src/sys/net/vnet.c#5 (text+ko) ====

@@ -458,6 +458,15 @@
 }
 
 int
+vnet_sysctl_handle_long(SYSCTL_HANDLER_ARGS)
+{
+
+	if (arg1 != NULL)	
+		arg1 = (void *)(curvnet->vnet_data_base + (uintptr_t)arg1);
+	return (sysctl_handle_long(oidp, arg1, arg2, req));
+}
+
+int
 vnet_sysctl_handle_opaque(SYSCTL_HANDLER_ARGS)
 {
 
@@ -484,6 +493,15 @@
 	return (sysctl_handle_int(oidp, arg1, arg2, req));
 }
 
+int
+vnet_sysctl_handle_ulong(SYSCTL_HANDLER_ARGS)
+{
+
+	if (arg1 != NULL)
+		arg1 = (void *)(curvnet->vnet_data_base + (uintptr_t)arg1);
+	return (sysctl_handle_long(oidp, arg1, arg2, req));
+}
+
 /*
  * Support for special SYSINIT handlers registered via VNET_SYSINIT()
  * and VNET_SYSUNINIT().

==== //depot/projects/vimage/src/sys/net/vnet.h#32 (text+ko) ====

@@ -227,6 +227,8 @@
 int	vnet_sysctl_handle_opaque(SYSCTL_HANDLER_ARGS);
 int	vnet_sysctl_handle_string(SYSCTL_HANDLER_ARGS);
 int	vnet_sysctl_handle_uint(SYSCTL_HANDLER_ARGS);
+int	vnet_sysctl_handle_long(SYSCTL_HANDLER_ARGS);
+int	vnet_sysctl_handle_ulong(SYSCTL_HANDLER_ARGS);
 
 #define	SYSCTL_VNET_INT(parent, nbr, name, access, ptr, val, descr)	\
 	SYSCTL_OID(parent, nbr, name,					\
@@ -249,6 +251,14 @@
 	SYSCTL_OID(parent, nbr, name,					\
 	    CTLTYPE_UINT|CTLFLAG_MPSAFE|CTLFLAG_VNET|(access),		\
 	    ptr, val, vnet_sysctl_handle_uint, "IU", descr)
+#define SYSCTL_VNET_LONG(parent, nbr, name, access, ptr, val, descr)	\
+	SYSCTL_OID(parent, nbr, name,					\
+		CTLTYPE_LONG|CTLFLAG_MPSAFE|CTLFLAG_VNET|(access),	\
+		ptr, val, vnet_sysctl_handle_long, "L", descr)
+#define SYSCTL_VNET_ULONG(parent, nbr, name, access, ptr, val, descr)	\
+	SYSCTL_OID(parent, nbr, name,					\
+		CTLTYPE_ULONG|CTLFLAG_MPSAFE|CTLFLAG_VNET|(access),	\
+		ptr, val, vnet_sysctl_handle_ulong, "LU", descr)
 #define	VNET_SYSCTL_ARG(req, arg1) do {					\
 	if (arg1 != NULL)						\
 		arg1 = (void *)(TD_TO_VNET((req)->td)->vnet_data_base +	\


More information about the p4-projects mailing list