Module Name:    src
Committed By:   jym
Date:           Wed Mar 30 22:57:24 UTC 2011

Modified Files:
        src/sys/arch/xen/include/amd64: hypercalls.h
        src/sys/arch/xen/include/i386: hypercalls.h

Log Message:
Add the HYPERVISOR_sysctl() hypercall.

Although the hypercall arguments (like struct sysctl_readconsole) are not
compatible between different XEN_SYSCTL_INTERFACE_VERSIONs (one of the
reasons why the sysctl calls should only be used by xentools directly),
it's still practical to have when one wants to query Xen's dmesg from
ddb(4) in case of a panic.

Note: additional code is needed for readconsole() functionality, but adding
the hypercall should not cause any harm.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/xen/include/amd64/hypercalls.h
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/xen/include/i386/hypercalls.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/include/amd64/hypercalls.h
diff -u src/sys/arch/xen/include/amd64/hypercalls.h:1.5 src/sys/arch/xen/include/amd64/hypercalls.h:1.6
--- src/sys/arch/xen/include/amd64/hypercalls.h:1.5	Thu Nov 13 01:45:48 2008
+++ src/sys/arch/xen/include/amd64/hypercalls.h	Wed Mar 30 22:57:24 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: hypercalls.h,v 1.5 2008/11/13 01:45:48 cegger Exp $ */
+/* $NetBSD: hypercalls.h,v 1.6 2011/03/30 22:57:24 jym Exp $ */
 /******************************************************************************
  * hypercall.h
  * 
@@ -406,4 +406,10 @@
 	return _hypercall1(int, mca, mc);
 }
 
+static inline int
+HYPERVISOR_sysctl(void *sysctl)
+{
+	return _hypercall1(int, sysctl, sysctl);
+}
+
 #endif /* __HYPERCALL_H__ */

Index: src/sys/arch/xen/include/i386/hypercalls.h
diff -u src/sys/arch/xen/include/i386/hypercalls.h:1.10 src/sys/arch/xen/include/i386/hypercalls.h:1.11
--- src/sys/arch/xen/include/i386/hypercalls.h:1.10	Mon Oct 19 18:41:11 2009
+++ src/sys/arch/xen/include/i386/hypercalls.h	Wed Mar 30 22:57:24 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: hypercalls.h,v 1.10 2009/10/19 18:41:11 bouyer Exp $	*/
+/*	$NetBSD: hypercalls.h,v 1.11 2011/03/30 22:57:24 jym Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -534,4 +534,16 @@
 
     return ret;
 }
+
+static __inline int
+HYPERVISOR_sysctl(void *sysctl)
+{
+    int ret;
+    unsigned long ign1;
+
+    _hypercall(__HYPERVISOR_sysctl, _harg("1" (sysctl)),
+	_harg("=a" (ret), "=b" (ign1)));
+
+    return ret;
+}
 #endif /* _XENI386_HYPERVISOR_H_ */

Reply via email to