diff options
author | awilliam@xenbuild2.aw <awilliam@xenbuild2.aw> | 2007-03-20 09:51:45 -0600 |
---|---|---|
committer | awilliam@xenbuild2.aw <awilliam@xenbuild2.aw> | 2007-03-20 09:51:45 -0600 |
commit | 048f2c148c3aaad24e2c9420f6a3efc0e5031a13 (patch) | |
tree | 32bd2c15b21c0b1843f72899130decfe333c7a95 /extras/mini-os/arch | |
parent | 1264150f8c2f288986f2e79bc45cc89f129b62c8 (diff) | |
download | xen-048f2c148c3aaad24e2c9420f6a3efc0e5031a13.tar.gz xen-048f2c148c3aaad24e2c9420f6a3efc0e5031a13.tar.bz2 xen-048f2c148c3aaad24e2c9420f6a3efc0e5031a13.zip |
[IA64][MINIOS] Fixed some big-endian bugs and add HYPERVISOR_suspend
Signed-off-by: Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
Diffstat (limited to 'extras/mini-os/arch')
-rw-r--r-- | extras/mini-os/arch/ia64/arch.mk | 13 | ||||
-rw-r--r-- | extras/mini-os/arch/ia64/common.c | 6 | ||||
-rw-r--r-- | extras/mini-os/arch/ia64/fw.S | 21 | ||||
-rw-r--r-- | extras/mini-os/arch/ia64/mm.c | 2 | ||||
-rw-r--r-- | extras/mini-os/arch/ia64/xencomm.c | 20 |
5 files changed, 57 insertions, 5 deletions
diff --git a/extras/mini-os/arch/ia64/arch.mk b/extras/mini-os/arch/ia64/arch.mk index 066fad36fd..f1029de7be 100644 --- a/extras/mini-os/arch/ia64/arch.mk +++ b/extras/mini-os/arch/ia64/arch.mk @@ -1,3 +1,6 @@ +# Build for Big Endian? +BIGENDIAN := n + ARCH_CFLAGS := -mfixed-range=f2-f5,f12-f15,f32-f127 -mconstant-gp ARCH_CFLAGS += -O2 ARCH_ASFLAGS := -x assembler-with-cpp @@ -5,3 +8,13 @@ ARCH_ASFLAGS += -mfixed-range=f2-f5,f12-f15,f32-f127 -fomit-frame-pointer ARCH_ASFLAGS += -fno-builtin -fno-common -fno-strict-aliasing -mconstant-gp ARCH_LDFLAGS = -warn-common + +# Next lines are for big endian code ! +ifeq ($(BIGENDIAN),y) +ARCH_CFLAGS += -mbig-endian -Wa,-mbe -Wa,-mlp64 +ARCH_CFLAGS += -DBIG_ENDIAN +ARCH_ASFLAGS += -Wa,-mbe +ARCH_ASFLAGS += -DBIG_ENDIAN +ARCH_LDFLAGS = -EB -d +endif + diff --git a/extras/mini-os/arch/ia64/common.c b/extras/mini-os/arch/ia64/common.c index 7d99a4c191..13416d9542 100644 --- a/extras/mini-os/arch/ia64/common.c +++ b/extras/mini-os/arch/ia64/common.c @@ -225,6 +225,7 @@ arch_print_info(void) major = minor >> 16; minor &= ~0xffffffff; printk("Running on Xen version: %d.%d\n", major, minor); +#if 0 printk("machine addr of shared_info_t : 0x%lx\n", start_info.shared_info); printk("machine page number of shared page: 0x%lx\n", @@ -235,5 +236,8 @@ arch_print_info(void) start_info.console.domU.mfn); printk("evtchn for console messages : %d\n", start_info.console.domU.evtchn); - printk("xen_guest_cmdline : %s\n", boot_cmd_line); +#endif + if(strlen(boot_cmd_line) > 0) + printk("xen_guest_cmdline : %s\n", boot_cmd_line); } + diff --git a/extras/mini-os/arch/ia64/fw.S b/extras/mini-os/arch/ia64/fw.S index db89dfa934..48bb851e5d 100644 --- a/extras/mini-os/arch/ia64/fw.S +++ b/extras/mini-os/arch/ia64/fw.S @@ -33,6 +33,7 @@ #include "ia64_cpu.h" #include "ia64_fpu.h" #include "offsets.h" +#include "xen/xen.h" /* @@ -517,3 +518,23 @@ ENTRY(__hypercall) br.ret.sptk.many b0 ;; END(__hypercall) + +/* + * Stub for suspend. + * Just force the stacked registers to be written in memory. + */ +ENTRY(xencomm_arch_hypercall_suspend) + ;; + alloc r20=ar.pfs,0,0,6,0 + mov r2=__HYPERVISOR_sched_op + ;; + /* We don't want to deal with RSE. */ + flushrs + mov r33=r32 + mov r32=2 // SCHEDOP_shutdown + ;; + break 0x1000 + ;; + br.ret.sptk.many b0 +END(xencomm_arch_hypercall_suspend) + diff --git a/extras/mini-os/arch/ia64/mm.c b/extras/mini-os/arch/ia64/mm.c index dd1fb9dc78..cb1699a9ab 100644 --- a/extras/mini-os/arch/ia64/mm.c +++ b/extras/mini-os/arch/ia64/mm.c @@ -127,7 +127,7 @@ void* map_frames(unsigned long* frames, unsigned long n) { n = n; - return (void*) __va(frames[0] << PAGE_SHIFT); + return (void*) __va(SWAP(frames[0]) << PAGE_SHIFT); } void arch_init_p2m(unsigned long max_pfn) diff --git a/extras/mini-os/arch/ia64/xencomm.c b/extras/mini-os/arch/ia64/xencomm.c index 587576a0b4..03d163cb94 100644 --- a/extras/mini-os/arch/ia64/xencomm.c +++ b/extras/mini-os/arch/ia64/xencomm.c @@ -171,13 +171,15 @@ xencommize_mini_grant_table_op(struct xencomm_mini *xc_area, int *nbr_area, return -EINVAL; rc = xencomm_create_mini (xc_area, nbr_area, - xen_guest_handle(setup->frame_list), - setup->nr_frames + (void*)SWAP((uint64_t) + xen_guest_handle(setup->frame_list)), + SWAP(setup->nr_frames) * sizeof(*xen_guest_handle(setup->frame_list)), &desc1); if (rc) return rc; - set_xen_guest_handle(setup->frame_list, (void *)desc1); + set_xen_guest_handle(setup->frame_list, + (void *)SWAP((uint64_t)desc1)); break; } case GNTTABOP_dump_table: @@ -254,3 +256,15 @@ HYPERVISOR_grant_table_op(unsigned int cmd, void *uop, unsigned int count) return xencomm_mini_hypercall_grant_table_op(cmd, uop, count); } + /* In fw.S */ +extern int xencomm_arch_hypercall_suspend(struct xencomm_handle *arg); +int +HYPERVISOR_suspend(unsigned long srec) +{ + struct sched_shutdown arg; + + arg.reason = (uint32_t)SWAP((uint32_t)SHUTDOWN_suspend); + + return xencomm_arch_hypercall_suspend(xencomm_create_inline(&arg)); +} + |