]>
Commit | Line | Data |
---|---|---|
abcbbb14 AP |
1 | /** @file\r |
2 | Functions to make Xen hypercalls.\r | |
3 | \r | |
4 | Copyright (C) 2014, Citrix Ltd.\r | |
5 | \r | |
6 | This program and the accompanying materials\r | |
7 | are licensed and made available under the terms and conditions of the BSD License\r | |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | \r | |
14 | **/\r | |
15 | \r | |
16 | #include <PiDxe.h>\r | |
abcbbb14 AP |
17 | \r |
18 | #include <IndustryStandard/Xen/hvm/params.h>\r | |
19 | #include <IndustryStandard/Xen/memory.h>\r | |
20 | \r | |
cd8ff8fd AB |
21 | #include <Library/DebugLib.h>\r |
22 | #include <Library/XenHypercallLib.h>\r | |
abcbbb14 AP |
23 | \r |
24 | UINT64\r | |
25 | XenHypercallHvmGetParam (\r | |
cec6ad0a | 26 | IN UINT32 Index\r |
abcbbb14 AP |
27 | )\r |
28 | {\r | |
29 | xen_hvm_param_t Parameter;\r | |
30 | INTN Error;\r | |
31 | \r | |
abcbbb14 AP |
32 | Parameter.domid = DOMID_SELF;\r |
33 | Parameter.index = Index;\r | |
bbc3758a | 34 | Error = XenHypercall2 (__HYPERVISOR_hvm_op,\r |
abcbbb14 AP |
35 | HVMOP_get_param, (INTN) &Parameter);\r |
36 | if (Error != 0) {\r | |
37 | DEBUG ((EFI_D_ERROR,\r | |
6394c35a LE |
38 | "XenHypercall: Error %Ld trying to get HVM parameter %d\n",\r |
39 | (INT64)Error, Index));\r | |
abcbbb14 AP |
40 | return 0;\r |
41 | }\r | |
42 | return Parameter.value;\r | |
43 | }\r | |
44 | \r | |
45 | INTN\r | |
46 | XenHypercallMemoryOp (\r | |
abcbbb14 AP |
47 | IN UINTN Operation,\r |
48 | IN OUT VOID *Arguments\r | |
49 | )\r | |
50 | {\r | |
bbc3758a | 51 | return XenHypercall2 (__HYPERVISOR_memory_op,\r |
abcbbb14 AP |
52 | Operation, (INTN) Arguments);\r |
53 | }\r | |
54 | \r | |
55 | INTN\r | |
56 | XenHypercallEventChannelOp (\r | |
abcbbb14 AP |
57 | IN INTN Operation,\r |
58 | IN OUT VOID *Arguments\r | |
59 | )\r | |
60 | {\r | |
bbc3758a | 61 | return XenHypercall2 (__HYPERVISOR_event_channel_op,\r |
abcbbb14 AP |
62 | Operation, (INTN) Arguments);\r |
63 | }\r |