ia64/xen-unstable

changeset 15122:2fb4ab0c174a

[IA64] memmap: move pal_call_stub from xenasm.S

Now lives in dom_fw_asm.S to be shared by xen and libxc.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Alex Williamson <alex.williamson@hp.com>
date Mon May 21 13:53:34 2007 -0600 (2007-05-21)
parents 8dbc11034f82
children f8b0d7a46b4d
files xen/arch/ia64/xen/Makefile xen/arch/ia64/xen/dom_fw_asm.S xen/arch/ia64/xen/dom_fw_common.c xen/arch/ia64/xen/xenasm.S xen/include/asm-ia64/dom_fw.h
line diff
     1.1 --- a/xen/arch/ia64/xen/Makefile	Mon May 21 13:50:05 2007 -0600
     1.2 +++ b/xen/arch/ia64/xen/Makefile	Mon May 21 13:53:34 2007 -0600
     1.3 @@ -6,6 +6,7 @@ obj-y += acpi.o
     1.4  obj-y += dom0_ops.o
     1.5  obj-y += domain.o
     1.6  obj-y += dom_fw.o
     1.7 +obj-y += dom_fw_asm.o
     1.8  obj-y += fw_emul.o
     1.9  obj-y += hpsimserial.o
    1.10  obj-y += hypercall.o
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/xen/arch/ia64/xen/dom_fw_asm.S	Mon May 21 13:53:34 2007 -0600
     2.3 @@ -0,0 +1,41 @@
     2.4 +// moved from xenasm.S to be shared by xen and libxc
     2.5 +/*
     2.6 + * Assembly support routines for Xen/ia64
     2.7 + *
     2.8 + * Copyright (C) 2004 Hewlett-Packard Co
     2.9 + *      Dan Magenheimer <dan.magenheimer@hp.com>
    2.10 + *
    2.11 + * Copyright (c) 2007 Isaku Yamahata <yamahata at valinux co jp>
    2.12 + *                    VA Linux Systems Japan K.K.
    2.13 + */
    2.14 +
    2.15 +//  These instructions are copied in the domains.
    2.16 +//  This is the virtual PAL, which simply does a hypercall.
    2.17 +//  The size is 2 bundles (32 Bytes).  It handles both static and stacked
    2.18 +//    convention.
    2.19 +//  If you modify this code, you have to modify dom_fw.h (for the size) and
    2.20 +//   dom_fw_pal_hypercall_patch.
    2.21 +
    2.22 +// This file is shared with xen and libxc.
    2.23 +// GLOBAL_ENTRY() end END() macro can't be used.
    2.24 +
    2.25 +//GLOBAL_ENTRY(xen_ia64_pal_call_stub)
    2.26 +.global xen_ia64_pal_call_stub;
    2.27 +.align 32;
    2.28 +.proc xen_ia64_pal_call_stub;
    2.29 +xen_ia64_pal_call_stub:
    2.30 +	{
    2.31 +	 .mii
    2.32 +	addl r2=0x1000,r0	//  Hypercall number (Value is patched).
    2.33 +	mov r9=256
    2.34 +	;; 
    2.35 +	cmp.gtu p7,p8=r9,r28		/* r32 <= 255? */
    2.36 +	}
    2.37 +	{
    2.38 +	 .mbb
    2.39 +	break 0x1000		//  Hypercall vector (Value is patched).
    2.40 +(p7)	br.cond.sptk.few rp
    2.41 +(p8)	br.ret.sptk.few rp
    2.42 +	}
    2.43 +//END(xen_ia64_pal_call_stub)
    2.44 +.endp xen_ia64_pal_call_stub
     3.1 --- a/xen/arch/ia64/xen/dom_fw_common.c	Mon May 21 13:50:05 2007 -0600
     3.2 +++ b/xen/arch/ia64/xen/dom_fw_common.c	Mon May 21 13:53:34 2007 -0600
     3.3 @@ -110,17 +110,19 @@ build_hypercall_bundle(uint64_t *imva, u
     3.4  static void
     3.5  build_pal_hypercall_bundles(uint64_t *imva, uint64_t brkimm, uint64_t hypnum)
     3.6  {
     3.7 -	extern unsigned long pal_call_stub[];
     3.8 +	extern unsigned long xen_ia64_pal_call_stub[];
     3.9  	IA64_BUNDLE bundle;
    3.10  	INST64_A5 slot_a5;
    3.11  	INST64_M37 slot_m37;
    3.12  
    3.13 -	/* The source of the hypercall stub is the pal_call_stub function
    3.14 -	   defined in xenasm.S.  */
    3.15 +	/*
    3.16 +	 * The source of the hypercall stub is
    3.17 +	 * the xen_ia64_pal_call_stub function defined in dom_fw_asm.S. 
    3.18 +	 */
    3.19  
    3.20  	/* Copy the first bundle and patch the hypercall number.  */
    3.21 -	bundle.i64[0] = pal_call_stub[0];
    3.22 -	bundle.i64[1] = pal_call_stub[1];
    3.23 +	bundle.i64[0] = xen_ia64_pal_call_stub[0];
    3.24 +	bundle.i64[1] = xen_ia64_pal_call_stub[1];
    3.25  	slot_a5.inst = bundle.slot0;
    3.26  	slot_a5.imm7b = hypnum;
    3.27  	slot_a5.imm9d = hypnum >> 7;
    3.28 @@ -132,8 +134,8 @@ build_pal_hypercall_bundles(uint64_t *im
    3.29  	ia64_fc(imva + 1);
    3.30  	
    3.31  	/* Copy the second bundle and patch the hypercall vector.  */
    3.32 -	bundle.i64[0] = pal_call_stub[2];
    3.33 -	bundle.i64[1] = pal_call_stub[3];
    3.34 +	bundle.i64[0] = xen_ia64_pal_call_stub[2];
    3.35 +	bundle.i64[1] = xen_ia64_pal_call_stub[3];
    3.36  	slot_m37.inst = bundle.slot0;
    3.37  	slot_m37.imm20a = brkimm;
    3.38  	slot_m37.i = brkimm >> 20;
     4.1 --- a/xen/arch/ia64/xen/xenasm.S	Mon May 21 13:50:05 2007 -0600
     4.2 +++ b/xen/arch/ia64/xen/xenasm.S	Mon May 21 13:53:34 2007 -0600
     4.3 @@ -356,26 +356,3 @@ stacked:
     4.4  	br.ret.sptk.few rp
     4.5  END(pal_emulator_static)
     4.6  
     4.7 -//  These instructions are copied in the domains.
     4.8 -//  This is the virtual PAL, which simply does a hypercall.
     4.9 -//  The size is 2 bundles (32 Bytes).  It handles both static and stacked
    4.10 -//    convention.
    4.11 -//  If you modify this code, you have to modify dom_fw.h (for the size) and
    4.12 -//   dom_fw_pal_hypercall_patch.
    4.13 -GLOBAL_ENTRY(pal_call_stub)
    4.14 -	{
    4.15 -	 .mii
    4.16 -	addl r2=0x1000,r0	//  Hypercall number (Value is patched).
    4.17 -	mov r9=256
    4.18 -	;; 
    4.19 -	cmp.gtu p7,p8=r9,r28		/* r32 <= 255? */
    4.20 -	}
    4.21 -	{
    4.22 -	 .mbb
    4.23 -	break 0x1000		//  Hypercall vector (Value is patched).
    4.24 -(p7)	br.cond.sptk.few rp
    4.25 -(p8)	br.ret.sptk.few rp
    4.26 -	}
    4.27 -END(pal_call_stub)
    4.28 -
    4.29 -
     5.1 --- a/xen/include/asm-ia64/dom_fw.h	Mon May 21 13:50:05 2007 -0600
     5.2 +++ b/xen/include/asm-ia64/dom_fw.h	Mon May 21 13:53:34 2007 -0600
     5.3 @@ -59,7 +59,8 @@
     5.4   * rp=b0 indicates the return point.
     5.5   *
     5.6   * A single hypercall is used for all PAL calls.
     5.7 - * The hypercall stub is pal_call_stub (xenasm.S).  Its size is 2 bundles.
     5.8 + * The hypercall stub is xen_ia64_pal_call_stub (dom_fw_asm.S). 
     5.9 + * Its size is 2 bundles.
    5.10   */
    5.11  
    5.12  #define FW_HYPERCALL_PAL_CALL_INDEX	0x80UL