# HG changeset patch
# User Jimi Xenidis <[EMAIL PROTECTED]>
# Node ID 2765c83b576d5af048d381c481e33f597c2be258
# Parent  23cc5f7d71e01bc9908026b0f53e310ece230f60
[LINUX][XEN][POWERPC] implement HYPERVISOR_multicall()

Sadly, the xencomm thing makes performing the multicall loop in Xen
prohibitive, so for now we blow it out here.  I think some level of
atomicity is expected from the multicall so we precheck all the ops
and the turn off interrupts while we make all the calls.

Signed-off-by: Jimi Xenidis <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/xen/hcall.c |   34 ++++++++++++++++++++++++++++++++--
 1 files changed, 32 insertions(+), 2 deletions(-)

diff -r 23cc5f7d71e0 -r 2765c83b576d arch/powerpc/platforms/xen/hcall.c
--- a/arch/powerpc/platforms/xen/hcall.c        Mon Oct 09 17:20:44 2006 -0400
+++ b/arch/powerpc/platforms/xen/hcall.c        Mon Oct 09 19:57:42 2006 -0400
@@ -189,10 +189,40 @@ HYPERVISOR_poll(
 }
 EXPORT_SYMBOL(HYPERVISOR_poll);
 
+typedef ulong (mf_t)(ulong arg0, ...);
+
+static mf_t *multicall_funcs[] = {
+       [__HYPERVISOR_grant_table_op] = (mf_t *)HYPERVISOR_grant_table_op,
+};
+
 int HYPERVISOR_multicall(void *call_list, int nr_calls)
 {
-       BUG();
-       return -ENOSYS;
+       /* we blow out the multicall because the xencomm stuff is jsut
+        * too tricky */
+       multicall_entry_t *mcl = (multicall_entry_t *)call_list;
+       multicall_entry_t *c;
+       int i;
+       mf_t *mf;
+       int res;
+       ulong flags;
+
+       /* let make sure all the calls are supported */
+       for (i = 0; i < nr_calls; i++) {
+               mf = multicall_funcs[mcl[i].op];
+               BUG_ON(mf == NULL);
+       }
+       /* disable interrupts until we are done all calls */
+       local_irq_save(flags);
+       for (i = 0; i < nr_calls; i++) {
+               /* lookup supported multicalls */
+               c = &mcl[i];
+               mf = multicall_funcs[c->op];
+               res = mf(c->args[0], c->args[1], c->args[2],
+                        c->args[3], c->args[4], c->args[5]);
+               c->result = res;
+       }
+       local_irq_restore(flags);
+       return 0;
 }
 EXPORT_SYMBOL(HYPERVISOR_multicall);
 

_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@lists.xensource.com
http://lists.xensource.com/xen-ppc-devel

Reply via email to