win-pvdrivers

view xenpci/hypercall_x86.h @ 641:4bb8c4fc6fa5

Added tag 0.10.0.91 for changeset 40c8aada72eb
author James Harper <james.harper@bendigoit.com.au>
date Sun Aug 23 18:00:14 2009 +1000 (2009-08-23)
parents 52533409dbbd
children 95159ee58473
line source
1 #ifndef HYPERCALL_X86_H
2 #define HYPERCALL_X86_H
3 /*
4 PV Drivers for Windows Xen HVM Domains
5 Copyright (C) 2007 James Harper
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; either version 2
10 of the License, or (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 */
22 static __inline int
23 HYPERVISOR_memory_op(PXENPCI_DEVICE_DATA xpdd, int cmd, void *arg)
24 {
25 char *hypercall_stubs = xpdd->hypercall_stubs;
26 long __res;
27 __asm {
28 mov ebx, cmd
29 mov ecx, arg
30 mov eax, hypercall_stubs
31 add eax, (__HYPERVISOR_memory_op * 32)
32 call eax
33 mov [__res], eax
34 }
35 return __res;
36 }
38 static __inline int
39 HYPERVISOR_sched_op(PXENPCI_DEVICE_DATA xpdd, int cmd, void *arg)
40 {
41 char *hypercall_stubs = xpdd->hypercall_stubs;
42 long __res;
43 __asm {
44 mov ebx, cmd
45 mov ecx, arg
46 mov eax, hypercall_stubs
47 add eax, (__HYPERVISOR_sched_op * 32)
48 call eax
49 mov [__res], eax
50 }
51 return __res;
52 }
54 static __inline int
55 HYPERVISOR_xen_version(PXENPCI_DEVICE_DATA xpdd, int cmd, void *arg)
56 {
57 char *hypercall_stubs = xpdd->hypercall_stubs;
58 long __res;
59 __asm {
60 mov ebx, cmd
61 mov ecx, arg
62 mov eax, hypercall_stubs
63 add eax, (__HYPERVISOR_xen_version * 32)
64 call eax
65 mov [__res], eax
66 }
67 return __res;
68 }
70 static __inline int
71 HYPERVISOR_grant_table_op(PXENPCI_DEVICE_DATA xpdd, int cmd, void *uop, unsigned int count)
72 {
73 char *hypercall_stubs = xpdd->hypercall_stubs;
74 long __res;
75 __asm {
76 mov ebx, cmd
77 mov ecx, uop
78 mov edx, count
79 mov eax, hypercall_stubs
80 add eax, (__HYPERVISOR_grant_table_op * 32)
81 call eax
82 mov [__res], eax
83 }
84 return __res;
85 }
87 static __inline int
88 HYPERVISOR_mmu_update(PXENPCI_DEVICE_DATA xpdd, mmu_update_t *req, int count, int *success_count, domid_t domid)
89 {
90 char *hypercall_stubs = xpdd->hypercall_stubs;
91 long __res;
92 long _domid = (long)domid;
93 __asm {
94 mov ebx, req
95 mov ecx, count
96 mov edx, success_count
97 mov edi, _domid
98 mov eax, hypercall_stubs
99 add eax, (__HYPERVISOR_mmu_update * 32)
100 call eax
101 mov [__res], eax
102 }
103 return __res;
104 }
106 static __inline int
107 HYPERVISOR_console_io(PXENPCI_DEVICE_DATA xpdd, int cmd, int count, char *string)
108 {
109 char *hypercall_stubs = xpdd->hypercall_stubs;
110 long __res;
111 __asm {
112 mov ebx, cmd
113 mov ecx, count
114 mov edx, string
115 mov eax, hypercall_stubs
116 add eax, (__HYPERVISOR_console_io * 32)
117 call eax
118 mov [__res], eax
119 }
120 return __res;
121 }
123 static __inline int
124 HYPERVISOR_hvm_op(PXENPCI_DEVICE_DATA xpdd, int op, struct xen_hvm_param *arg)
125 {
126 char *hypercall_stubs = xpdd->hypercall_stubs;
127 long __res;
128 __asm {
129 mov ebx, op
130 mov ecx, arg
131 mov eax, hypercall_stubs
132 add eax, (__HYPERVISOR_hvm_op * 32)
133 call eax
134 mov [__res], eax
135 }
136 return __res;
137 }
139 static __inline int
140 HYPERVISOR_event_channel_op(PXENPCI_DEVICE_DATA xpdd, int cmd, void *op)
141 {
142 char *hypercall_stubs = xpdd->hypercall_stubs;
143 long __res;
144 __asm {
145 mov ebx, cmd
146 mov ecx, op
147 mov eax, hypercall_stubs
148 add eax, (__HYPERVISOR_event_channel_op * 32)
149 call eax
150 mov [__res], eax
151 }
152 return __res;
153 }
155 #endif