ia64/xen-unstable

changeset 14424:0fadd0476e03

[IA64][MINIOS] Fixed some big-endian bugs and add HYPERVISOR_suspend

Signed-off-by: Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
author awilliam@xenbuild2.aw
date Tue Mar 20 09:51:45 2007 -0600 (2007-03-20)
parents c07b1dc6dc6d
children f74e837c3902
files extras/mini-os/arch/ia64/arch.mk extras/mini-os/arch/ia64/common.c extras/mini-os/arch/ia64/fw.S extras/mini-os/arch/ia64/mm.c extras/mini-os/arch/ia64/xencomm.c extras/mini-os/include/ia64/hypercall-ia64.h
line diff
     1.1 --- a/extras/mini-os/arch/ia64/arch.mk	Tue Mar 20 09:32:24 2007 -0600
     1.2 +++ b/extras/mini-os/arch/ia64/arch.mk	Tue Mar 20 09:51:45 2007 -0600
     1.3 @@ -1,3 +1,6 @@
     1.4 +# Build for Big Endian?
     1.5 +BIGENDIAN := n
     1.6 +
     1.7  ARCH_CFLAGS := -mfixed-range=f2-f5,f12-f15,f32-f127 -mconstant-gp
     1.8  ARCH_CFLAGS += -O2
     1.9  ARCH_ASFLAGS := -x assembler-with-cpp
    1.10 @@ -5,3 +8,13 @@ ARCH_ASFLAGS += -mfixed-range=f2-f5,f12-
    1.11  ARCH_ASFLAGS += -fno-builtin -fno-common -fno-strict-aliasing -mconstant-gp
    1.12  
    1.13  ARCH_LDFLAGS = -warn-common
    1.14 +
    1.15 +# Next lines are for big endian code !
    1.16 +ifeq ($(BIGENDIAN),y)
    1.17 +ARCH_CFLAGS += -mbig-endian -Wa,-mbe -Wa,-mlp64
    1.18 +ARCH_CFLAGS += -DBIG_ENDIAN
    1.19 +ARCH_ASFLAGS += -Wa,-mbe
    1.20 +ARCH_ASFLAGS += -DBIG_ENDIAN
    1.21 +ARCH_LDFLAGS = -EB -d
    1.22 +endif
    1.23 +
     2.1 --- a/extras/mini-os/arch/ia64/common.c	Tue Mar 20 09:32:24 2007 -0600
     2.2 +++ b/extras/mini-os/arch/ia64/common.c	Tue Mar 20 09:51:45 2007 -0600
     2.3 @@ -225,6 +225,7 @@ arch_print_info(void)
     2.4  	major = minor >> 16;
     2.5  	minor &= ~0xffffffff;
     2.6  	printk("Running on Xen version: %d.%d\n", major, minor);
     2.7 +#if 0
     2.8  	printk("machine addr of shared_info_t  : 0x%lx\n",
     2.9  	       start_info.shared_info);
    2.10  	printk("machine page number of shared page: 0x%lx\n",
    2.11 @@ -235,5 +236,8 @@ arch_print_info(void)
    2.12  	       start_info.console.domU.mfn);
    2.13  	printk("evtchn for console messages    : %d\n",
    2.14  	       start_info.console.domU.evtchn);
    2.15 -	printk("xen_guest_cmdline              : %s\n", boot_cmd_line);
    2.16 +#endif
    2.17 +	if(strlen(boot_cmd_line) > 0)
    2.18 +		printk("xen_guest_cmdline              : %s\n", boot_cmd_line);
    2.19  }
    2.20 +
     3.1 --- a/extras/mini-os/arch/ia64/fw.S	Tue Mar 20 09:32:24 2007 -0600
     3.2 +++ b/extras/mini-os/arch/ia64/fw.S	Tue Mar 20 09:51:45 2007 -0600
     3.3 @@ -33,6 +33,7 @@
     3.4  #include "ia64_cpu.h"
     3.5  #include "ia64_fpu.h"
     3.6  #include "offsets.h"
     3.7 +#include "xen/xen.h"
     3.8  
     3.9  
    3.10  /*
    3.11 @@ -517,3 +518,23 @@ ENTRY(__hypercall)
    3.12  	br.ret.sptk.many b0
    3.13  	;;
    3.14  END(__hypercall)
    3.15 +
    3.16 +/*
    3.17 + * Stub for suspend.
    3.18 + * Just force the stacked registers to be written in memory.
    3.19 + */
    3.20 +ENTRY(xencomm_arch_hypercall_suspend)
    3.21 +	;;
    3.22 +	alloc	r20=ar.pfs,0,0,6,0
    3.23 +	mov	r2=__HYPERVISOR_sched_op
    3.24 +	;;
    3.25 +	/* We don't want to deal with RSE.  */
    3.26 +	flushrs
    3.27 +	mov	r33=r32
    3.28 +	mov	r32=2		// SCHEDOP_shutdown
    3.29 +	;;
    3.30 +	break	0x1000
    3.31 +	;;
    3.32 +	br.ret.sptk.many b0
    3.33 +END(xencomm_arch_hypercall_suspend)
    3.34 +
     4.1 --- a/extras/mini-os/arch/ia64/mm.c	Tue Mar 20 09:32:24 2007 -0600
     4.2 +++ b/extras/mini-os/arch/ia64/mm.c	Tue Mar 20 09:51:45 2007 -0600
     4.3 @@ -127,7 +127,7 @@ void*
     4.4  map_frames(unsigned long* frames, unsigned long n)
     4.5  {
     4.6  	n = n;
     4.7 -	return (void*) __va(frames[0] << PAGE_SHIFT);
     4.8 +	return (void*) __va(SWAP(frames[0]) << PAGE_SHIFT);
     4.9  }
    4.10  
    4.11  void arch_init_p2m(unsigned long max_pfn)
     5.1 --- a/extras/mini-os/arch/ia64/xencomm.c	Tue Mar 20 09:32:24 2007 -0600
     5.2 +++ b/extras/mini-os/arch/ia64/xencomm.c	Tue Mar 20 09:51:45 2007 -0600
     5.3 @@ -171,13 +171,15 @@ xencommize_mini_grant_table_op(struct xe
     5.4  			return -EINVAL;
     5.5  		rc = xencomm_create_mini
     5.6  		        (xc_area, nbr_area,
     5.7 -		         xen_guest_handle(setup->frame_list),
     5.8 -		         setup->nr_frames
     5.9 +		         (void*)SWAP((uint64_t)
    5.10 +				     xen_guest_handle(setup->frame_list)),
    5.11 +		         SWAP(setup->nr_frames)
    5.12  		         * sizeof(*xen_guest_handle(setup->frame_list)),
    5.13  		         &desc1);
    5.14  		if (rc)
    5.15  			return rc;
    5.16 -		set_xen_guest_handle(setup->frame_list, (void *)desc1);
    5.17 +		set_xen_guest_handle(setup->frame_list,
    5.18 +				     (void *)SWAP((uint64_t)desc1));
    5.19  		break;
    5.20  	}
    5.21  	case GNTTABOP_dump_table:
    5.22 @@ -254,3 +256,15 @@ HYPERVISOR_grant_table_op(unsigned int c
    5.23  	return xencomm_mini_hypercall_grant_table_op(cmd, uop, count);
    5.24  }
    5.25  
    5.26 +	/* In fw.S */
    5.27 +extern int xencomm_arch_hypercall_suspend(struct xencomm_handle *arg);
    5.28 +int
    5.29 +HYPERVISOR_suspend(unsigned long srec)
    5.30 +{
    5.31 +        struct sched_shutdown arg;
    5.32 +
    5.33 +        arg.reason = (uint32_t)SWAP((uint32_t)SHUTDOWN_suspend);
    5.34 +
    5.35 +        return xencomm_arch_hypercall_suspend(xencomm_create_inline(&arg));
    5.36 +}
    5.37 +
     6.1 --- a/extras/mini-os/include/ia64/hypercall-ia64.h	Tue Mar 20 09:32:24 2007 -0600
     6.2 +++ b/extras/mini-os/include/ia64/hypercall-ia64.h	Tue Mar 20 09:51:45 2007 -0600
     6.3 @@ -138,7 +138,7 @@ xencomm_arch_event_channel_op(int cmd, v
     6.4  	if (unlikely(rc == -ENOSYS)) {
     6.5  		struct evtchn_op op;
     6.6  
     6.7 -		op.cmd = cmd;
     6.8 +		op.cmd = SWAP(cmd);
     6.9  		memcpy(&op.u, arg, sizeof(op.u));
    6.10  		rc = _hypercall1(int, event_channel_op_compat, &op);
    6.11  	}