Line | |
---|
1 | /****************************************************************************** |
---|
2 | * compat.c |
---|
3 | * |
---|
4 | * Implementations of legacy hypercalls. These call through to the new |
---|
5 | * hypercall after doing necessary argument munging. |
---|
6 | */ |
---|
7 | |
---|
8 | #include <xen/config.h> |
---|
9 | #include <xen/guest_access.h> |
---|
10 | #include <xen/hypercall.h> |
---|
11 | |
---|
12 | #ifndef COMPAT |
---|
13 | typedef long ret_t; |
---|
14 | #endif |
---|
15 | |
---|
16 | /* Legacy hypercall (as of 0x00030202). */ |
---|
17 | ret_t do_physdev_op_compat(XEN_GUEST_HANDLE(physdev_op_t) uop) |
---|
18 | { |
---|
19 | struct physdev_op op; |
---|
20 | |
---|
21 | if ( unlikely(copy_from_guest(&op, uop, 1) != 0) ) |
---|
22 | return -EFAULT; |
---|
23 | |
---|
24 | return do_physdev_op(op.cmd, guest_handle_from_ptr(&uop.p->u, void)); |
---|
25 | } |
---|
26 | |
---|
27 | #ifndef COMPAT |
---|
28 | |
---|
29 | /* Legacy hypercall (as of 0x00030202). */ |
---|
30 | long do_event_channel_op_compat(XEN_GUEST_HANDLE(evtchn_op_t) uop) |
---|
31 | { |
---|
32 | struct evtchn_op op; |
---|
33 | |
---|
34 | if ( unlikely(copy_from_guest(&op, uop, 1) != 0) ) |
---|
35 | return -EFAULT; |
---|
36 | |
---|
37 | return do_event_channel_op(op.cmd, guest_handle_from_ptr(&uop.p->u, void)); |
---|
38 | } |
---|
39 | |
---|
40 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.