# HG changeset patch # User dietmar.hahn@xxxxxxxxxxxxxxxxxxx # Node ID 1a3df0faa4a609ca582538248c40c3ec3ff93cce # Parent 1584263f9fc50d16cfc5e060e996eb8025de3d31 Fixed some bugs for the big-endian stuff and added HYPERVISOR_suspend stuff. Signed-off-by: Dietmar Hahn diff -r 1584263f9fc5 -r 1a3df0faa4a6 extras/mini-os/arch/ia64/arch.mk --- a/extras/mini-os/arch/ia64/arch.mk Thu Mar 15 09:04:23 2007 -0600 +++ b/extras/mini-os/arch/ia64/arch.mk Tue Mar 20 14:43:48 2007 +0100 @@ -1,3 +1,7 @@ ARCH_CFLAGS := -mfixed-range=f2-f5,f12-f +# LE for little endian or BE foir big endian +ENDIANESS=LE +#ENDIANESS=BE + ARCH_CFLAGS := -mfixed-range=f2-f5,f12-f15,f32-f127 -mconstant-gp ARCH_CFLAGS += -O2 ARCH_ASFLAGS := -x assembler-with-cpp @@ -5,3 +9,13 @@ ARCH_ASFLAGS += -fno-builtin -fno-common ARCH_ASFLAGS += -fno-builtin -fno-common -fno-strict-aliasing -mconstant-gp ARCH_LDFLAGS = -warn-common + +# Next lines are for big endian code ! +ifeq ($(ENDIANESS),BE) +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 -r 1584263f9fc5 -r 1a3df0faa4a6 extras/mini-os/arch/ia64/common.c --- a/extras/mini-os/arch/ia64/common.c Thu Mar 15 09:04:23 2007 -0600 +++ b/extras/mini-os/arch/ia64/common.c Tue Mar 20 14:43:48 2007 +0100 @@ -225,6 +225,7 @@ arch_print_info(void) major = minor >> 16; minor &= ~0xffffffff; printk("Running on Xen version: %d.%d\n", major, minor); + /* 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); -} + */ + if(strlen(boot_cmd_line) > 0) + printk("xen_guest_cmdline : %s\n", boot_cmd_line); +} + diff -r 1584263f9fc5 -r 1a3df0faa4a6 extras/mini-os/arch/ia64/fw.S --- a/extras/mini-os/arch/ia64/fw.S Thu Mar 15 09:04:23 2007 -0600 +++ b/extras/mini-os/arch/ia64/fw.S Tue Mar 20 14:43:48 2007 +0100 @@ -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 -r 1584263f9fc5 -r 1a3df0faa4a6 extras/mini-os/arch/ia64/mm.c --- a/extras/mini-os/arch/ia64/mm.c Thu Mar 15 09:04:23 2007 -0600 +++ b/extras/mini-os/arch/ia64/mm.c Tue Mar 20 14:43:48 2007 +0100 @@ -127,7 +127,7 @@ map_frames(unsigned long* frames, unsign 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 -r 1584263f9fc5 -r 1a3df0faa4a6 extras/mini-os/arch/ia64/xencomm.c --- a/extras/mini-os/arch/ia64/xencomm.c Thu Mar 15 09:04:23 2007 -0600 +++ b/extras/mini-os/arch/ia64/xencomm.c Tue Mar 20 14:43:48 2007 +0100 @@ -171,13 +171,14 @@ xencommize_mini_grant_table_op(struct xe 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 +255,15 @@ HYPERVISOR_grant_table_op(unsigned int c 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)); +} + diff -r 1584263f9fc5 -r 1a3df0faa4a6 extras/mini-os/include/ia64/hypercall-ia64.h --- a/extras/mini-os/include/ia64/hypercall-ia64.h Thu Mar 15 09:04:23 2007 -0600 +++ b/extras/mini-os/include/ia64/hypercall-ia64.h Tue Mar 20 14:43:48 2007 +0100 @@ -138,7 +138,7 @@ xencomm_arch_event_channel_op(int cmd, v if (unlikely(rc == -ENOSYS)) { struct evtchn_op op; - op.cmd = cmd; + op.cmd = SWAP(cmd); memcpy(&op.u, arg, sizeof(op.u)); rc = _hypercall1(int, event_channel_op_compat, &op); }