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-devel

[Xen-devel] [PATCH 17 of 24] libxc: convert evtchn interfaces over to hy

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 17 of 24] libxc: convert evtchn interfaces over to hypercall buffers
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Mon, 06 Sep 2010 14:38:37 +0100
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Mon, 06 Sep 2010 07:04:17 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1283780300@xxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1283779691 -3600
# Node ID 0a24ab4ac4a43f4b36feea9e7c5ddd72b5f23872
# Parent  c42a409a5c56732462d9effa844ebc2f7d06ba60
libxc: convert evtchn interfaces over to hypercall buffers

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

diff -r c42a409a5c56 -r 0a24ab4ac4a4 tools/libxc/xc_evtchn.c
--- a/tools/libxc/xc_evtchn.c   Mon Sep 06 14:28:11 2010 +0100
+++ b/tools/libxc/xc_evtchn.c   Mon Sep 06 14:28:11 2010 +0100
@@ -22,31 +22,30 @@
 
 #include "xc_private.h"
 
-
 static int do_evtchn_op(xc_interface *xch, int cmd, void *arg,
                         size_t arg_size, int silently_fail)
 {
     int ret = -1;
     DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BOUNCE(arg, arg_size, XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
 
-    hypercall.op     = __HYPERVISOR_event_channel_op;
-    hypercall.arg[0] = cmd;
-    hypercall.arg[1] = (unsigned long)arg;
-
-    if ( lock_pages(xch, arg, arg_size) != 0 )
+    if ( xc_hypercall_bounce_pre(xch, arg) )
     {
         PERROR("do_evtchn_op: arg lock failed");
         goto out;
     }
 
+    hypercall.op     = __HYPERVISOR_event_channel_op;
+    hypercall.arg[0] = cmd;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
     if ((ret = do_xen_hypercall(xch, &hypercall)) < 0 && !silently_fail)
         ERROR("do_evtchn_op: HYPERVISOR_event_channel_op failed: %d", ret);
 
-    unlock_pages(xch, arg, arg_size);
+    xc_hypercall_bounce_post(xch, arg);
  out:
     return ret;
 }
-
 
 evtchn_port_or_error_t
 xc_evtchn_alloc_unbound(xc_interface *xch,

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

<Prev in Thread] Current Thread [Next in Thread>