WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] linux/x86: don't hardcode is_running_on_xen() for pv

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] linux/x86: don't hardcode is_running_on_xen() for pv drivers
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: Thu, 07 Feb 2008 09:30:30 +0000
Delivery-date: Thu, 07 Feb 2008 01:30:31 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Allowing graceful failure of these modules when inadvertently loaded on
native kernels.

Almost as usual, written and tested on 2.6.16.54 and made apply to the
2.6.18 tree without further testing.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

--- a/include/asm-i386/mach-xen/asm/hypervisor.h
+++ b/include/asm-i386/mach-xen/asm/hypervisor.h
@@ -145,7 +145,12 @@ u64 jiffies_to_st(unsigned long jiffies)
 #define MULTI_UVMDOMID_INDEX 4
 #endif
 
+#ifdef CONFIG_XEN
 #define is_running_on_xen() 1
+#else
+extern char *hypercall_stubs;
+#define is_running_on_xen() (!!hypercall_stubs)
+#endif
 
 static inline int
 HYPERVISOR_yield(




_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] linux/x86: don't hardcode is_running_on_xen() for pv drivers, Jan Beulich <=