win-pvdrivers

annotate xenpci/hypercall_x86.h @ 804:6ea80e94e8cf

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