win-pvdrivers

annotate xenpci/hypercall.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 da7ec4df7dd6
children e5651aba4e03
rev   line source
james@284 1 /*
james@284 2 PV Drivers for Windows Xen HVM Domains
james@284 3 Copyright (C) 2007 James Harper
james@284 4
james@284 5 This program is free software; you can redistribute it and/or
james@284 6 modify it under the terms of the GNU General Public License
james@284 7 as published by the Free Software Foundation; either version 2
james@284 8 of the License, or (at your option) any later version.
james@284 9
james@284 10 This program is distributed in the hope that it will be useful,
james@284 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
james@284 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
james@284 13 GNU General Public License for more details.
james@284 14
james@284 15 You should have received a copy of the GNU General Public License
james@284 16 along with this program; if not, write to the Free Software
james@284 17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
james@284 18 */
james@284 19
andy@323 20 #if defined(_X86_)
andy@323 21 #if defined(__MINGW32__)
andy@323 22 #include "hypercall_x86_mingw.h"
andy@301 23 #else
andy@323 24 #include "hypercall_x86.h"
andy@301 25 #endif
james@581 26 #elif defined(_AMD64_)
james@581 27 #include "hypercall_amd64.h"
james@581 28 #elif defined(__ia64__)
james@581 29 #include "hypercall_ia64.h"
james@284 30 #endif
james@284 31
james@284 32 static __inline ULONGLONG
james@284 33 hvm_get_parameter(PXENPCI_DEVICE_DATA xpdd, int hvm_param)
james@284 34 {
james@284 35 struct xen_hvm_param a;
james@284 36 int retval;
james@284 37
andy@398 38 FUNCTION_ENTER();
james@284 39 a.domid = DOMID_SELF;
james@284 40 a.index = hvm_param;
james@284 41 //a.value = via;
james@284 42 retval = HYPERVISOR_hvm_op(xpdd, HVMOP_get_param, &a);
james@284 43 KdPrint((__DRIVER_NAME " HYPERVISOR_hvm_op retval = %d\n", retval));
andy@398 44 FUNCTION_EXIT();
james@284 45 return a.value;
james@284 46 }
james@284 47
james@284 48 static __inline ULONGLONG
james@284 49 hvm_set_parameter(PXENPCI_DEVICE_DATA xpdd, int hvm_param, ULONGLONG value)
james@284 50 {
james@284 51 struct xen_hvm_param a;
james@284 52 int retval;
james@284 53
andy@398 54 FUNCTION_ENTER();
james@284 55 a.domid = DOMID_SELF;
james@284 56 a.index = hvm_param;
james@284 57 a.value = value;
james@284 58 //a.value = via;
james@284 59 retval = HYPERVISOR_hvm_op(xpdd, HVMOP_set_param, &a);
james@284 60 KdPrint((__DRIVER_NAME " HYPERVISOR_hvm_op retval = %d\n", retval));
andy@398 61 FUNCTION_EXIT();
james@284 62 return retval;
james@284 63 }
james@284 64
james@284 65 static __inline int
james@284 66 hvm_shutdown(PXENPCI_DEVICE_DATA xpdd, unsigned int reason)
james@284 67 {
james@284 68 struct sched_shutdown ss;
james@284 69 int retval;
james@284 70
andy@398 71 FUNCTION_ENTER();
james@284 72 ss.reason = reason;
james@284 73 retval = HYPERVISOR_sched_op(xpdd, SCHEDOP_shutdown, &ss);
andy@398 74 FUNCTION_EXIT();
james@284 75 return retval;
james@284 76 }
james@353 77
james@353 78 static __inline VOID
james@353 79 HYPERVISOR_yield(PXENPCI_DEVICE_DATA xpdd)
james@353 80 {
james@353 81 HYPERVISOR_sched_op(xpdd, SCHEDOP_yield, NULL);
james@353 82 }