WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [IA64] Cleanup hypercall.h

# HG changeset patch
# User awilliam@xxxxxxxxxxx
# Node ID b5a6da52257782cff7197db51372db2468596c68
# Parent  a220579c2aa8b579ae2019ca2133476c6482a0aa
[IA64] Cleanup hypercall.h

Cleanup to hypercall.h of ia64 xenlinux, and remove used stuff.

Signed-off-by Kevin Tian <kevin.tian@xxxxxxxxx>

diff -r a220579c2aa8 -r b5a6da522577 
linux-2.6-xen-sparse/include/asm-ia64/hypercall.h
--- a/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h Mon Feb 27 21:00:33 2006
+++ b/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h Tue Feb 28 17:13:55 2006
@@ -37,8 +37,6 @@
 #include <asm/page.h>
 #define virt_to_machine(v) __pa(v)
 #define machine_to_virt(m) __va(m)
-//#define virt_to_mfn(v)       (__pa(v) >> 14)
-//#define mfn_to_virt(m)       (__va(m << 14))
 #define virt_to_mfn(v) ((__pa(v)) >> PAGE_SHIFT)
 #define mfn_to_virt(m) (__va((m) << PAGE_SHIFT))
 
@@ -55,8 +53,8 @@
                              "mov %0=r8 ;;\n"                  \
                              : "=r" (__res)                    \
                              : "i" (__HYPERVISOR_##name)       \
-                             : "r2","r8"                       \
-                               "memory" );                     \
+                             : "r2","r8",                      \
+                               "memory" );                     \
        (type)__res;                                            \
 })
 
@@ -109,328 +107,86 @@
                                "r" ((unsigned long)(a1)),      \
                                "r" ((unsigned long)(a2)),      \
                                "r" ((unsigned long)(a3))       \
-                             : "r14","r15","r16","r2","r8",    \
-                               "memory" );                     \
+                             : "r14","r15","r16","r2","r8",    \
+                               "memory" );                     \
        (type)__res;                                            \
 })
 
-#if 0
-static inline int
-HYPERVISOR_set_trap_table(
-    trap_info_t *table)
-{
-#if 0
-    int ret;
-    unsigned long ignore;
-
-    __asm__ __volatile__ (
-        TRAP_INSTR
-        : "=a" (ret), "=b" (ignore)
-       : "0" (__HYPERVISOR_set_trap_table), "1" (table)
-       : "memory" );
-
-    return ret;
-#endif
-    return 1;
-}
-
-static inline int
-HYPERVISOR_mmu_update(
-    mmu_update_t *req, int count, int *success_count, domid_t domid)
-{
-#if 0
-    int ret;
-    unsigned long ign1, ign2, ign3, ign4;
-
-    __asm__ __volatile__ (
-        TRAP_INSTR
-        : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3), "=S" (ign4)
-       : "0" (__HYPERVISOR_mmu_update), "1" (req), "2" (count),
-        "3" (success_count), "4" (domid)
-       : "memory" );
-
-    return ret;
-#endif
-    return 1;
-}
-
-static inline int
-HYPERVISOR_mmuext_op(
-    struct mmuext_op *op, int count, int *success_count, domid_t domid)
-{
-#if 0
-    int ret;
-    unsigned long ign1, ign2, ign3, ign4;
-
-    __asm__ __volatile__ (
-        TRAP_INSTR
-        : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3), "=S" (ign4)
-       : "0" (__HYPERVISOR_mmuext_op), "1" (op), "2" (count),
-        "3" (success_count), "4" (domid)
-       : "memory" );
-
-    return ret;
-#endif
-    return 1;
-}
-
-static inline int
-HYPERVISOR_set_gdt(
-    unsigned long *frame_list, int entries)
-{
-#if 0
-    int ret;
-    unsigned long ign1, ign2;
-
-    __asm__ __volatile__ (
-        TRAP_INSTR
-        : "=a" (ret), "=b" (ign1), "=c" (ign2)
-       : "0" (__HYPERVISOR_set_gdt), "1" (frame_list), "2" (entries)
-       : "memory" );
-
-
-    return ret;
-#endif
-    return 1;
-}
-
-static inline int
-HYPERVISOR_stack_switch(
-    unsigned long ss, unsigned long esp)
-{
-#if 0
-    int ret;
-    unsigned long ign1, ign2;
-
-    __asm__ __volatile__ (
-        TRAP_INSTR
-        : "=a" (ret), "=b" (ign1), "=c" (ign2)
-       : "0" (__HYPERVISOR_stack_switch), "1" (ss), "2" (esp)
-       : "memory" );
-
-    return ret;
-#endif
-    return 1;
-}
-
-static inline int
-HYPERVISOR_set_callbacks(
-    unsigned long event_selector, unsigned long event_address,
-    unsigned long failsafe_selector, unsigned long failsafe_address)
-{
-#if 0
-    int ret;
-    unsigned long ign1, ign2, ign3, ign4;
-
-    __asm__ __volatile__ (
-        TRAP_INSTR
-        : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3), "=S" (ign4)
-       : "0" (__HYPERVISOR_set_callbacks), "1" (event_selector),
-         "2" (event_address), "3" (failsafe_selector), "4" (failsafe_address)
-       : "memory" );
-
-    return ret;
-#endif
-    return 1;
-}
-
-static inline int
-HYPERVISOR_fpu_taskswitch(
-    int set)
-{
-#if 0
-    int ret;
-    unsigned long ign;
-
-    __asm__ __volatile__ (
-        TRAP_INSTR
-        : "=a" (ret), "=b" (ign)
-        : "0" (__HYPERVISOR_fpu_taskswitch), "1" (set)
-        : "memory" );
-
-    return ret;
-#endif
-    return 1;
-}
+#define _hypercall4(type, name, a1, a2, a3, a4)                        \
+({                                                             \
+       long __res;                                             \
+       __asm__ __volatile__ (";;\n"                            \
+                             "mov r14=%2\n"                    \
+                             "mov r15=%3\n"                    \
+                             "mov r16=%4\n"                    \
+                             "mov r17=%5\n"                    \
+                             "mov r2=%1\n"                     \
+                             "break 0x1000 ;;\n"               \
+                             "mov %0=r8 ;;\n"                  \
+                             : "=r" (__res)                    \
+                             : "i" (__HYPERVISOR_##name),      \
+                               "r" ((unsigned long)(a1)),      \
+                               "r" ((unsigned long)(a2)),      \
+                               "r" ((unsigned long)(a3)),      \
+                               "r" ((unsigned long)(a4))       \
+                             : "r14","r15","r16","r2","r8",    \
+                               "r17","memory" );               \
+       (type)__res;                                            \
+})
+
+#define _hypercall5(type, name, a1, a2, a3, a4, a5)            \
+({                                                             \
+       long __res;                                             \
+       __asm__ __volatile__ (";;\n"                            \
+                             "mov r14=%2\n"                    \
+                             "mov r15=%3\n"                    \
+                             "mov r16=%4\n"                    \
+                             "mov r17=%5\n"                    \
+                             "mov r18=%6\n"                    \
+                             "mov r2=%1\n"                     \
+                             "break 0x1000 ;;\n"               \
+                             "mov %0=r8 ;;\n"                  \
+                             : "=r" (__res)                    \
+                             : "i" (__HYPERVISOR_##name),      \
+                               "r" ((unsigned long)(a1)),      \
+                               "r" ((unsigned long)(a2)),      \
+                               "r" ((unsigned long)(a3)),      \
+                               "r" ((unsigned long)(a4)),      \
+                               "r" ((unsigned long)(a5))       \
+                             : "r14","r15","r16","r2","r8",    \
+                               "r17","r18","memory" );         \
+       (type)__res;                                            \
+})
 
 static inline int
 HYPERVISOR_sched_op(
     int cmd, unsigned long arg)
 {
-    return 1;
-}
-
-static inline int
-HYPERVISOR_suspend(
-    unsigned long srec)
-{
-    return 1;
+       return _hypercall2(int, sched_op, cmd, arg);
 }
 
 static inline long
 HYPERVISOR_set_timer_op(
     u64 timeout)
 {
-#if 0
-    int ret;
     unsigned long timeout_hi = (unsigned long)(timeout>>32);
     unsigned long timeout_lo = (unsigned long)timeout;
-    unsigned long ign1, ign2;
-
-    __asm__ __volatile__ (
-        TRAP_INSTR
-        : "=a" (ret), "=b" (ign1), "=c" (ign2)
-       : "0" (__HYPERVISOR_set_timer_op), "b" (timeout_lo), "c" (timeout_hi)
-       : "memory");
-
-    return ret;
-#endif
-    return 1;
+    return _hypercall2(long, set_timer_op, timeout_lo, timeout_hi);
 }
 
 static inline int
 HYPERVISOR_dom0_op(
     dom0_op_t *dom0_op)
 {
-#if 0
-    int ret;
-    unsigned long ign1;
-
     dom0_op->interface_version = DOM0_INTERFACE_VERSION;
-    __asm__ __volatile__ (
-        TRAP_INSTR
-        : "=a" (ret), "=b" (ign1)
-       : "0" (__HYPERVISOR_dom0_op), "1" (dom0_op)
-       : "memory");
-
-    return ret;
-#endif
-    return 1;
-}
-
-static inline int
-HYPERVISOR_set_debugreg(
-    int reg, unsigned long value)
-{
-#if 0
-    int ret;
-    unsigned long ign1, ign2;
-    __asm__ __volatile__ (
-        TRAP_INSTR
-        : "=a" (ret), "=b" (ign1), "=c" (ign2)
-       : "0" (__HYPERVISOR_set_debugreg), "1" (reg), "2" (value)
-       : "memory" );
-
-    return ret;
-#endif
-    return 1;
-}
-
-static inline unsigned long
-HYPERVISOR_get_debugreg(
-    int reg)
-{
-#if 0
-    unsigned long ret;
-    unsigned long ign;
-    __asm__ __volatile__ (
-        TRAP_INSTR
-        : "=a" (ret), "=b" (ign)
-       : "0" (__HYPERVISOR_get_debugreg), "1" (reg)
-       : "memory" );
-
-    return ret;
-#endif
-    return 1;
-}
-
-static inline int
-HYPERVISOR_update_descriptor(
-    unsigned long ma, unsigned long word1, unsigned long word2)
-{
-#if 0
-    int ret;
-    unsigned long ign1, ign2, ign3;
-
-    __asm__ __volatile__ (
-        TRAP_INSTR
-        : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3)
-       : "0" (__HYPERVISOR_update_descriptor), "1" (ma), "2" (word1),
-         "3" (word2)
-       : "memory" );
-
-    return ret;
-#endif
-    return 1;
-}
-
-static inline int
-HYPERVISOR_set_fast_trap(
-    int idx)
-{
-#if 0
-    int ret;
-    unsigned long ign;
-
-    __asm__ __volatile__ (
-        TRAP_INSTR
-        : "=a" (ret), "=b" (ign)
-       : "0" (__HYPERVISOR_set_fast_trap), "1" (idx)
-       : "memory" );
-
-    return ret;
-#endif
-    return 1;
-}
-
-static inline int
-HYPERVISOR_dom_mem_op(
-    unsigned int op, unsigned long *extent_list,
-    unsigned long nr_extents, unsigned int extent_order)
-{
-#if 0
-    int ret;
-    unsigned long ign1, ign2, ign3, ign4, ign5;
-
-    __asm__ __volatile__ (
-        TRAP_INSTR
-        : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3), "=S" (ign4),
-         "=D" (ign5)
-       : "0" (__HYPERVISOR_dom_mem_op), "1" (op), "2" (extent_list),
-         "3" (nr_extents), "4" (extent_order), "5" (DOMID_SELF)
-        : "memory" );
-
-    return ret;
-#endif
-    return 1;
+    return _hypercall1(int, dom0_op, dom0_op);
 }
 
 static inline int
 HYPERVISOR_multicall(
     void *call_list, int nr_calls)
 {
-#if 0
-    int ret;
-    unsigned long ign1, ign2;
-
-    __asm__ __volatile__ (
-        TRAP_INSTR
-        : "=a" (ret), "=b" (ign1), "=c" (ign2)
-       : "0" (__HYPERVISOR_multicall), "1" (call_list), "2" (nr_calls)
-       : "memory" );
-
-    return ret;
-#endif
-    return 1;
-}
-#endif
-
-static inline int
-HYPERVISOR_update_va_mapping(
-    unsigned long va, pte_t new_val, unsigned long flags)
-{
-    /* no-op */
-    return 1;
+    return _hypercall2(int, multicall, call_list, nr_calls);
 }
 
 static inline int
@@ -447,26 +203,12 @@
     return _hypercall1(int, event_channel_op, op);
 }
 
-#if 0
 static inline int
 HYPERVISOR_xen_version(
-    int cmd)
-{
-#if 0
-    int ret;
-    unsigned long ignore;
-
-    __asm__ __volatile__ (
-        TRAP_INSTR
-        : "=a" (ret), "=b" (ignore)
-       : "0" (__HYPERVISOR_xen_version), "1" (cmd)
-       : "memory" );
-
-    return ret;
-#endif
-    return 1;
-}
-#endif
+    int cmd, void *arg)
+{
+    return _hypercall2(int, xen_version, cmd, arg);
+}
 
 static inline int
 HYPERVISOR_console_io(
@@ -475,26 +217,12 @@
     return _hypercall3(int, console_io, cmd, count, str);
 }
 
-#if 0
 static inline int
 HYPERVISOR_physdev_op(
     void *physdev_op)
 {
-#if 0
-    int ret;
-    unsigned long ign;
-
-    __asm__ __volatile__ (
-        TRAP_INSTR
-        : "=a" (ret), "=b" (ign)
-       : "0" (__HYPERVISOR_physdev_op), "1" (physdev_op)
-       : "memory" );
-
-    return ret;
-#endif
-    return 1;
-}
-#endif
+    return _hypercall1(int, physdev_op, physdev_op);
+}
 
 static inline int
 HYPERVISOR_grant_table_op(
@@ -503,46 +231,23 @@
     return _hypercall3(int, grant_table_op, cmd, uop, count);
 }
 
-#if 0
-static inline int
-HYPERVISOR_update_va_mapping_otherdomain(
-    unsigned long va, pte_t new_val, unsigned long flags, domid_t domid)
-{
-#if 0
-    int ret;
-    unsigned long ign1, ign2, ign3, ign4;
-
-    __asm__ __volatile__ (
-        TRAP_INSTR
-        : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3), "=S" (ign4)
-       : "0" (__HYPERVISOR_update_va_mapping_otherdomain),
-          "1" (va), "2" ((new_val).pte_low), "3" (flags), "4" (domid) :
-        "memory" );
-    
-    return ret;
-#endif
-    return 1;
-}
-
-static inline int
-HYPERVISOR_vm_assist(
-    unsigned int cmd, unsigned int type)
-{
-#if 0
-    int ret;
-    unsigned long ign1, ign2;
-
-    __asm__ __volatile__ (
-        TRAP_INSTR
-        : "=a" (ret), "=b" (ign1), "=c" (ign2)
-       : "0" (__HYPERVISOR_vm_assist), "1" (cmd), "2" (type)
-       : "memory" );
-
-    return ret;
-#endif
-    return 1;
-}
-
-#endif
+static inline int
+HYPERVISOR_vcpu_op(
+       int cmd, int vcpuid, void *extra_args)
+{
+    return _hypercall3(int, vcpu_op, cmd, vcpuid, extra_args);
+}
+
+static inline int
+HYPERVISOR_suspend(
+       unsigned long srec)
+{
+    return _hypercall3(int, sched_op, SCHEDOP_shutdown,
+                       SHUTDOWN_suspend, srec);
+}
+
+extern fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs);
+static inline void exit_idle(void) {}
+#define do_IRQ(irq, regs) __do_IRQ((irq), (regs))
 
 #endif /* __HYPERCALL_H__ */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [IA64] Cleanup hypercall.h, Xen patchbot -unstable <=