ia64/xen-unstable

changeset 7513:b4263a0216a9

Enable test for running_on_xen from modules
Signed-off by: Dan Magenheimer <dan.magenheimer@hp.com>
author djm@kirby.fc.hp.com
date Thu Nov 03 21:37:29 2005 -0600 (2005-11-03)
parents 98209d207d14
children 5a4893a537ca
files linux-2.6-xen-sparse/arch/ia64/xen/Makefile linux-2.6-xen-sparse/arch/ia64/xen/xen_ksyms.c linux-2.6-xen-sparse/arch/ia64/xen/xensetup.S linux-2.6-xen-sparse/include/asm-ia64/xen/privop.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/ia64/xen/Makefile	Thu Nov 03 18:06:15 2005 -0600
     1.2 +++ b/linux-2.6-xen-sparse/arch/ia64/xen/Makefile	Thu Nov 03 21:37:29 2005 -0600
     1.3 @@ -2,4 +2,4 @@
     1.4  # Makefile for Xen components
     1.5  #
     1.6  
     1.7 -obj-y := hypercall.o xenivt.o xenentry.o xensetup.o xenpal.o xenhpski.o xenconsole.o
     1.8 +obj-y := hypercall.o xenivt.o xenentry.o xensetup.o xenpal.o xenhpski.o xenconsole.o xen_ksyms.o
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/linux-2.6-xen-sparse/arch/ia64/xen/xen_ksyms.c	Thu Nov 03 21:37:29 2005 -0600
     2.3 @@ -0,0 +1,12 @@
     2.4 +/*
     2.5 + * Architecture-specific kernel symbols
     2.6 + *
     2.7 + * Don't put any exports here unless it's defined in an assembler file.
     2.8 + * All other exports should be put directly after the definition.
     2.9 + */
    2.10 +
    2.11 +#include <linux/config.h>
    2.12 +#include <linux/module.h>
    2.13 +
    2.14 +extern int is_running_on_xen(void);
    2.15 +EXPORT_SYMBOL(is_running_on_xen);
     3.1 --- a/linux-2.6-xen-sparse/arch/ia64/xen/xensetup.S	Thu Nov 03 18:06:15 2005 -0600
     3.2 +++ b/linux-2.6-xen-sparse/arch/ia64/xen/xensetup.S	Thu Nov 03 21:37:29 2005 -0600
     3.3 @@ -25,3 +25,9 @@ GLOBAL_ENTRY(early_xen_setup)
     3.4  (p7)	mov cr.iva=r10
     3.5  	br.ret.sptk.many rp;;
     3.6  END(xen_init)
     3.7 +
     3.8 +GLOBAL_ENTRY(is_running_on_xen)
     3.9 +	movl r9=running_on_xen;;
    3.10 +	ld4 r8=[r9];;
    3.11 +	br.ret.sptk.many rp;;
    3.12 +END(is_running_on_xen)
     4.1 --- a/linux-2.6-xen-sparse/include/asm-ia64/xen/privop.h	Thu Nov 03 18:06:15 2005 -0600
     4.2 +++ b/linux-2.6-xen-sparse/include/asm-ia64/xen/privop.h	Thu Nov 03 21:37:29 2005 -0600
     4.3 @@ -36,7 +36,12 @@
     4.4  #endif
     4.5  
     4.6  #ifndef __ASSEMBLY__
     4.7 +#ifdef MODULE
     4.8 +extern int is_running_on_xen(void);
     4.9 +#define running_on_xen (is_running_on_xen())
    4.10 +#else
    4.11  extern int running_on_xen;
    4.12 +#endif
    4.13  
    4.14  #define	XEN_HYPER_SSM_I			asm("break 0x7");
    4.15  #define	XEN_HYPER_GET_IVR		asm("break 0x8");