]>
Commit | Line | Data |
---|---|---|
6f14cc18 | 1 | /* Copyright (C) 2010 - 2015 UNISYS CORPORATION |
12e364b9 KC |
2 | * All rights reserved. |
3 | * | |
6f14cc18 BR |
4 | * This program is free software; you can redistribute it and/or modify it |
5 | * under the terms and conditions of the GNU General Public License, | |
6 | * version 2, as published by the Free Software Foundation. | |
12e364b9 KC |
7 | * |
8 | * This program is distributed in the hope that it will be useful, but | |
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or | |
11 | * NON INFRINGEMENT. See the GNU General Public License for more | |
12 | * details. | |
13 | */ | |
14 | ||
15 | #ifndef __IOMONINTF_H__ | |
16 | #define __IOMONINTF_H__ | |
17 | ||
18 | /* | |
19 | * This file contains all structures needed to support the VMCALLs for IO | |
20 | * Virtualization. The VMCALLs are provided by Monitor and used by IO code | |
21 | * running on IO Partitions. | |
22 | */ | |
23 | ||
24 | #ifdef __GNUC__ | |
25 | #include "iovmcall_gnuc.h" | |
26 | #endif /* */ | |
27 | #include "diagchannel.h" | |
28 | ||
29 | #ifdef VMCALL_IO_CONTROLVM_ADDR | |
30 | #undef VMCALL_IO_CONTROLVM_ADDR | |
31 | #endif /* */ | |
32 | ||
33 | /* define subsystem number for AppOS, used in uislib driver */ | |
a8d7f21d | 34 | #define MDS_APPOS 0x4000000000000000L /* subsystem = 62 - AppOS */ |
753541cc | 35 | enum vmcall_monitor_interface_method_tuple { /* VMCALL identification tuples */ |
12e364b9 KC |
36 | /* Note: when a new VMCALL is added: |
37 | * - the 1st 2 hex digits correspond to one of the | |
38 | * VMCALL_MONITOR_INTERFACE types and | |
39 | * - the next 2 hex digits are the nth relative instance of within a | |
40 | * type | |
41 | * E.G. for VMCALL_VIRTPART_RECYCLE_PART, | |
42 | * - the 0x02 identifies it as a VMCALL_VIRTPART type and | |
43 | * - the 0x01 identifies it as the 1st instance of a VMCALL_VIRTPART | |
44 | * type of VMCALL | |
45 | */ | |
46 | ||
47 | VMCALL_IO_CONTROLVM_ADDR = 0x0501, /* used by all Guests, not just | |
48 | * IO */ | |
49 | VMCALL_IO_DIAG_ADDR = 0x0508, | |
50 | VMCALL_IO_VISORSERIAL_ADDR = 0x0509, | |
51 | VMCALL_QUERY_GUEST_VIRTUAL_TIME_OFFSET = 0x0708, /* Allow caller to | |
52 | * query virtual time | |
53 | * offset */ | |
54 | VMCALL_CHANNEL_VERSION_MISMATCH = 0x0709, | |
55 | VMCALL_POST_CODE_LOGEVENT = 0x070B, /* LOGEVENT Post Code (RDX) with | |
56 | * specified subsystem mask (RCX | |
57 | * - monitor_subsystems.h) and | |
58 | * severity (RDX) */ | |
59 | VMCALL_GENERIC_SURRENDER_QUANTUM_FOREVER = 0x0802, /* Yield the | |
60 | * remainder & all | |
61 | * future quantums of | |
62 | * the caller */ | |
63 | VMCALL_MEASUREMENT_DO_NOTHING = 0x0901, | |
64 | VMCALL_UPDATE_PHYSICAL_TIME = 0x0a02 /* Allow | |
65 | * ULTRA_SERVICE_CAPABILITY_TIME | |
66 | * capable guest to make | |
67 | * VMCALL */ | |
753541cc | 68 | }; |
12e364b9 KC |
69 | |
70 | #define VMCALL_SUCCESS 0 | |
71 | #define VMCALL_SUCCESSFUL(result) (result == 0) | |
72 | ||
73 | #ifdef __GNUC__ | |
74 | #define unisys_vmcall(tuple, reg_ebx, reg_ecx) \ | |
75 | __unisys_vmcall_gnuc(tuple, reg_ebx, reg_ecx) | |
76 | #define unisys_extended_vmcall(tuple, reg_ebx, reg_ecx, reg_edx) \ | |
77 | __unisys_extended_vmcall_gnuc(tuple, reg_ebx, reg_ecx, reg_edx) | |
d835a90c BR |
78 | #define ISSUE_IO_VMCALL(method, param, result) \ |
79 | (result = unisys_vmcall(method, (param) & 0xFFFFFFFF, \ | |
12e364b9 | 80 | (param) >> 32)) |
2e81513b SM |
81 | #define ISSUE_IO_EXTENDED_VMCALL(method, param1, param2, param3) \ |
82 | unisys_extended_vmcall(method, param1, param2, param3) | |
12e364b9 KC |
83 | |
84 | /* The following uses VMCALL_POST_CODE_LOGEVENT interface but is currently | |
85 | * not used much */ | |
86 | #define ISSUE_IO_VMCALL_POSTCODE_SEVERITY(postcode, severity) \ | |
12e364b9 | 87 | ISSUE_IO_EXTENDED_VMCALL(VMCALL_POST_CODE_LOGEVENT, severity, \ |
512a67bc | 88 | MDS_APPOS, postcode) |
12e364b9 KC |
89 | #endif |
90 | ||
91 | /* Structures for IO VMCALLs */ | |
92 | ||
12e364b9 KC |
93 | /* ///////////// BEGIN PRAGMA PACK PUSH 1 ///////////////////////// */ |
94 | /* ///////////// ONLY STRUCT TYPE SHOULD BE BELOW */ | |
95 | #pragma pack(push, 1) | |
96 | /* Parameters to VMCALL_IO_CONTROLVM_ADDR interface */ | |
f42aea3c | 97 | struct vmcall_io_controlvm_addr_params { |
12e364b9 KC |
98 | /* The Guest-relative physical address of the ControlVm channel. |
99 | * This VMCall fills this in with the appropriate address. */ | |
f42aea3c | 100 | u64 address; /* contents provided by this VMCALL (OUT) */ |
12e364b9 KC |
101 | /* the size of the ControlVm channel in bytes This VMCall fills this |
102 | * in with the appropriate address. */ | |
f42aea3c BR |
103 | u32 channel_bytes; /* contents provided by this VMCALL (OUT) */ |
104 | u8 unused[4]; /* Unused Bytes in the 64-Bit Aligned Struct */ | |
105 | }; | |
12e364b9 KC |
106 | |
107 | #pragma pack(pop) | |
108 | /* ///////////// END PRAGMA PACK PUSH 1 /////////////////////////// */ | |
109 | ||
110 | /* ///////////// BEGIN PRAGMA PACK PUSH 1 ///////////////////////// */ | |
111 | /* ///////////// ONLY STRUCT TYPE SHOULD BE BELOW */ | |
112 | #pragma pack(push, 1) | |
113 | /* Parameters to VMCALL_IO_DIAG_ADDR interface */ | |
3dbf7b73 | 114 | struct vmcall_io_diag_addr_params { |
12e364b9 KC |
115 | /* The Guest-relative physical address of the diagnostic channel. |
116 | * This VMCall fills this in with the appropriate address. */ | |
3dbf7b73 BR |
117 | u64 address; /* contents provided by this VMCALL (OUT) */ |
118 | }; | |
12e364b9 KC |
119 | |
120 | #pragma pack(pop) | |
121 | /* ///////////// END PRAGMA PACK PUSH 1 /////////////////////////// */ | |
122 | ||
123 | /* ///////////// BEGIN PRAGMA PACK PUSH 1 ///////////////////////// */ | |
124 | /* ///////////// ONLY STRUCT TYPE SHOULD BE BELOW */ | |
125 | #pragma pack(push, 1) | |
126 | /* Parameters to VMCALL_IO_VISORSERIAL_ADDR interface */ | |
0520cfb1 | 127 | struct vmcall_io_visorserial_addr_params { |
12e364b9 KC |
128 | /* The Guest-relative physical address of the serial console |
129 | * channel. This VMCall fills this in with the appropriate | |
130 | * address. */ | |
0520cfb1 BR |
131 | u64 address; /* contents provided by this VMCALL (OUT) */ |
132 | }; | |
12e364b9 KC |
133 | |
134 | #pragma pack(pop) | |
135 | /* ///////////// END PRAGMA PACK PUSH 1 /////////////////////////// */ | |
136 | ||
137 | /* Parameters to VMCALL_CHANNEL_MISMATCH interface */ | |
a09ad889 BR |
138 | struct vmcall_channel_version_mismatch_params { |
139 | u8 chname[32]; /* Null terminated string giving name of channel | |
12e364b9 | 140 | * (IN) */ |
a09ad889 | 141 | u8 item_name[32]; /* Null terminated string giving name of |
12e364b9 | 142 | * mismatched item (IN) */ |
a09ad889 BR |
143 | u32 line_no; /* line# where invoked. (IN) */ |
144 | u8 file_name[36]; /* source code where invoked - Null terminated | |
12e364b9 | 145 | * string (IN) */ |
a09ad889 | 146 | }; |
12e364b9 KC |
147 | |
148 | #endif /* __IOMONINTF_H__ */ |