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] add dom0vp hypercall interfaces

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [IA64] add dom0vp hypercall interfaces
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 27 Apr 2006 10:32:56 +0000
Delivery-date: Thu, 27 Apr 2006 03:43:22 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User awilliam@xxxxxxxxxxx
# Node ID d63c6ba11c6590600b223533ffaa673f1af7bfcf
# Parent  8a2b2b45e237a2dcbe914a642abe13682a7fd3b2
[IA64] add dom0vp hypercall interfaces

adds the dom0vp hypercall interfaces.

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>

diff -r 8a2b2b45e237 -r d63c6ba11c65 
linux-2.6-xen-sparse/include/asm-ia64/hypercall.h
--- a/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h Tue Apr 25 13:57:56 
2006 -0600
+++ b/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h Tue Apr 25 14:02:21 
2006 -0600
@@ -271,4 +271,210 @@ static inline void exit_idle(void) {}
 static inline void exit_idle(void) {}
 #define do_IRQ(irq, regs) __do_IRQ((irq), (regs))
 
+#ifdef CONFIG_XEN_IA64_DOM0_VP
+#include <asm/xen/privop.h>
+
+#define _hypercall_imm1(type, name, imm, a1)                   \
+({                                                             \
+       long __res;                                             \
+       __asm__ __volatile__ (";;\n"                            \
+                             "mov r14=%2\n"                    \
+                             "mov r15=%3\n"                    \
+                             "mov r2=%1\n"                     \
+                             "break 0x1000 ;;\n"               \
+                             "mov %0=r8 ;;\n"                  \
+                             : "=r" (__res)                    \
+                             : "i" (__HYPERVISOR_##name),      \
+                               "i" (imm),                      \
+                               "r" ((unsigned long)(a1))       \
+                             : "r14","r15","r2","r8",          \
+                               "memory" );                     \
+       (type)__res;                                            \
+})
+
+#define _hypercall_imm2(type, name, imm, a1, a2)               \
+({                                                             \
+       long __res;                                             \
+       __asm__ __volatile__ (";;\n"                            \
+                             "mov r14=%2\n"                    \
+                             "mov r15=%3\n"                    \
+                             "mov r16=%4\n"                    \
+                             "mov r2=%1\n"                     \
+                             "break 0x1000 ;;\n"               \
+                             "mov %0=r8 ;;\n"                  \
+                             : "=r" (__res)                    \
+                             : "i" (__HYPERVISOR_##name),      \
+                               "i" (imm),                      \
+                               "r" ((unsigned long)(a1)),      \
+                               "r" ((unsigned long)(a2))       \
+                             : "r14","r15","r16","r2","r8",    \
+                               "memory" );                     \
+       (type)__res;                                            \
+})
+
+#define _hypercall_imm3(type, name, imm, a1, a2, a3)           \
+({                                                             \
+       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),      \
+                               "i" (imm),                      \
+                               "r" ((unsigned long)(a1)),      \
+                               "r" ((unsigned long)(a2)),      \
+                               "r" ((unsigned long)(a3))       \
+                             : "r14","r15","r16","r17",        \
+                               "r2","r8",                      \
+                               "memory" );                     \
+       (type)__res;                                            \
+})
+
+#define _hypercall_imm4(type, name, imm, 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 r18=%6\n"                    \
+                             "mov r2=%1\n"                     \
+                             "break 0x1000 ;;\n"               \
+                             "mov %0=r8 ;;\n"                  \
+                             : "=r" (__res)                    \
+                             : "i" (__HYPERVISOR_##name),      \
+                               "i" (imm),                      \
+                               "r" ((unsigned long)(a1)),      \
+                               "r" ((unsigned long)(a2)),      \
+                               "r" ((unsigned long)(a3)),      \
+                               "r" ((unsigned long)(a4))       \
+                             : "r14","r15","r16","r17","r18",  \
+                               "r2","r8",                      \
+                               "memory" );                     \
+       (type)__res;                                            \
+})
+
+static inline unsigned long
+__HYPERVISOR_ioremap(unsigned long ioaddr, unsigned long size)
+{
+       return _hypercall_imm2(unsigned long, ia64_dom0vp_op,
+                              IA64_DOM0VP_ioremap, ioaddr, size);
+}
+
+static inline unsigned long
+HYPERVISOR_ioremap(unsigned long ioaddr, unsigned long size)
+{
+       unsigned long ret = ioaddr;
+       if (running_on_xen) {
+               ret = __HYPERVISOR_ioremap(ioaddr, size);
+       }
+       return ret;
+}
+
+static inline unsigned long
+__HYPERVISOR_phystomach(unsigned long gpfn)
+{
+       return _hypercall_imm1(unsigned long, ia64_dom0vp_op,
+                              IA64_DOM0VP_phystomach, gpfn);
+}
+
+static inline unsigned long
+HYPERVISOR_phystomach(unsigned long gpfn)
+{
+       unsigned long ret = gpfn;
+       if (running_on_xen) {
+               ret = __HYPERVISOR_phystomach(gpfn);
+       }
+       return ret;
+}
+
+static inline unsigned long
+__HYPERVISOR_machtophys(unsigned long mfn)
+{
+       return _hypercall_imm1(unsigned long, ia64_dom0vp_op,
+                              IA64_DOM0VP_machtophys, mfn);
+}
+
+static inline unsigned long
+HYPERVISOR_machtophys(unsigned long mfn)
+{
+       unsigned long ret = mfn;
+       if (running_on_xen) {
+               ret = __HYPERVISOR_machtophys(mfn);
+       }
+       return ret;
+}
+
+static inline unsigned long
+__HYPERVISOR_populate_physmap(unsigned long gpfn, unsigned int extent_order,
+                             unsigned int address_bits)
+{
+       return _hypercall_imm3(unsigned long, ia64_dom0vp_op,
+                              IA64_DOM0VP_populate_physmap, gpfn, 
+                              extent_order, address_bits);
+}
+
+static inline unsigned long
+HYPERVISOR_populate_physmap(unsigned long gpfn, unsigned int extent_order,
+                           unsigned int address_bits)
+{
+       unsigned long ret = 0;
+       if (running_on_xen) {
+               ret = __HYPERVISOR_populate_physmap(gpfn, extent_order,
+                                                   address_bits);
+       }
+       return ret;
+}
+
+static inline unsigned long
+__HYPERVISOR_zap_physmap(unsigned long gpfn, unsigned int extent_order)
+{
+       return _hypercall_imm2(unsigned long, ia64_dom0vp_op,
+                              IA64_DOM0VP_zap_physmap, gpfn, extent_order);
+}
+
+static inline unsigned long
+HYPERVISOR_zap_physmap(unsigned long gpfn, unsigned int extent_order)
+{
+       unsigned long ret = 0;
+       if (running_on_xen) {
+               ret = __HYPERVISOR_zap_physmap(gpfn, extent_order);
+       }
+       return ret;
+}
+
+static inline unsigned long
+__HYPERVISOR_add_physmap(unsigned long gpfn, unsigned long mfn,
+                        unsigned int flags, domid_t domid)
+{
+       return _hypercall_imm4(unsigned long, ia64_dom0vp_op,
+                              IA64_DOM0VP_add_physmap, gpfn, mfn, flags,
+                              domid);
+}
+static inline unsigned long
+HYPERVISOR_add_physmap(unsigned long gpfn, unsigned long mfn,
+                      unsigned int flags, domid_t domid)
+{
+       unsigned long ret = 0;
+       BUG_ON(!running_on_xen);//XXX
+       if (running_on_xen) {
+               ret = __HYPERVISOR_add_physmap(gpfn, mfn, flags, domid);
+       }
+       return ret;
+}
+#else
+#define HYPERVISOR_ioremap(ioaddr, size)               ({ioaddr;})
+#define HYPERVISOR_phystomach(gpfn)                    ({gpfn;})
+#define HYPERVISOR_machtophys(mfn)                     ({mfn;})
+#define HYPERVISOR_populate_physmap(gpfn, extent_order, address_bits) \
+                                                       ({0;})
+#define HYPERVISOR_zap_physmap(gpfn, extent_order)     ({0;})
+#define HYPERVISOR_add_physmap(gpfn, mfn, flags)       ({0;})
+#endif
 #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] add dom0vp hypercall interfaces, Xen patchbot -unstable <=