win-pvdrivers

view xenpci/hypercall_x86.h @ 1106:2d392ecdd366

Fix race is xenvbd causing 30 second freeze under high load
author James Harper <james.harper@bendigoit.com.au>
date Tue Nov 11 23:08:11 2014 +1100 (2014-11-11)
parents 471c94d04d8a
children
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(int cmd, void *arg) {
24 long __res;
25 __asm {
26 mov ebx, cmd
27 mov ecx, arg
28 mov eax, hypercall_stubs
29 add eax, (__HYPERVISOR_memory_op * 32)
30 call eax
31 mov [__res], eax
32 }
33 return __res;
34 }
36 static __inline int
37 HYPERVISOR_sched_op(int cmd, void *arg) {
38 long __res;
39 __asm {
40 mov ebx, cmd
41 mov ecx, arg
42 mov eax, hypercall_stubs
43 add eax, (__HYPERVISOR_sched_op * 32)
44 call eax
45 mov [__res], eax
46 }
47 return __res;
48 }
50 static __inline int
51 HYPERVISOR_xen_version(int cmd, void *arg) {
52 long __res;
53 __asm {
54 mov ebx, cmd
55 mov ecx, arg
56 mov eax, hypercall_stubs
57 add eax, (__HYPERVISOR_xen_version * 32)
58 call eax
59 mov [__res], eax
60 }
61 return __res;
62 }
64 static __inline int
65 HYPERVISOR_grant_table_op(int cmd, void *uop, unsigned int count) {
66 long __res;
67 __asm {
68 mov ebx, cmd
69 mov ecx, uop
70 mov edx, count
71 mov eax, hypercall_stubs
72 add eax, (__HYPERVISOR_grant_table_op * 32)
73 call eax
74 mov [__res], eax
75 }
76 return __res;
77 }
79 static __inline int
80 HYPERVISOR_hvm_op(int op, struct xen_hvm_param *arg) {
81 long __res;
82 __asm {
83 mov ebx, op
84 mov ecx, arg
85 mov eax, hypercall_stubs
86 add eax, (__HYPERVISOR_hvm_op * 32)
87 call eax
88 mov [__res], eax
89 }
90 return __res;
91 }
93 static __inline int
94 HYPERVISOR_event_channel_op(int cmd, void *op) {
95 long __res;
96 __asm {
97 mov ebx, cmd
98 mov ecx, op
99 mov eax, hypercall_stubs
100 add eax, (__HYPERVISOR_event_channel_op * 32)
101 call eax
102 mov [__res], eax
103 }
104 return __res;
105 }
107 static __inline int
108 HYPERVISOR_tmem_op(struct tmem_op *op) {
109 long __res;
110 __asm {
111 mov ebx, op
112 mov eax, hypercall_stubs
113 add eax, (__HYPERVISOR_tmem_op * 32)
114 call eax
115 mov [__res], eax
116 }
117 return __res;
118 }
120 #endif