win-pvdrivers

view xenpci/hypercall.h @ 643:1794a52f415d

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