1 /* Copyright (C) 2010 - 2013 UNISYS CORPORATION
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or (at
7 * your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
12 * NON INFRINGEMENT. See the GNU General Public License for more
16 #ifndef __IOMONINTF_H__
17 #define __IOMONINTF_H__
20 * This file contains all structures needed to support the VMCALLs for IO
21 * Virtualization. The VMCALLs are provided by Monitor and used by IO code
22 * running on IO Partitions.
26 #include "iovmcall_gnuc.h"
28 #include "diagchannel.h"
30 #ifdef VMCALL_IO_CONTROLVM_ADDR
31 #undef VMCALL_IO_CONTROLVM_ADDR
34 /* define subsystem number for AppOS, used in uislib driver */
35 #define MDS_APPOS 0x4000000000000000L /* subsystem = 62 - AppOS */
36 typedef enum { /* VMCALL identification tuples */
37 /* Note: when a new VMCALL is added:
38 * - the 1st 2 hex digits correspond to one of the
39 * VMCALL_MONITOR_INTERFACE types and
40 * - the next 2 hex digits are the nth relative instance of within a
42 * E.G. for VMCALL_VIRTPART_RECYCLE_PART,
43 * - the 0x02 identifies it as a VMCALL_VIRTPART type and
44 * - the 0x01 identifies it as the 1st instance of a VMCALL_VIRTPART
48 VMCALL_IO_CONTROLVM_ADDR = 0x0501, /* used by all Guests, not just
50 VMCALL_IO_DIAG_ADDR = 0x0508,
51 VMCALL_IO_VISORSERIAL_ADDR = 0x0509,
52 VMCALL_QUERY_GUEST_VIRTUAL_TIME_OFFSET = 0x0708, /* Allow caller to
55 VMCALL_CHANNEL_VERSION_MISMATCH = 0x0709,
56 VMCALL_POST_CODE_LOGEVENT = 0x070B, /* LOGEVENT Post Code (RDX) with
57 * specified subsystem mask (RCX
58 * - monitor_subsystems.h) and
60 VMCALL_GENERIC_SURRENDER_QUANTUM_FOREVER = 0x0802, /* Yield the
64 VMCALL_MEASUREMENT_DO_NOTHING = 0x0901,
65 VMCALL_UPDATE_PHYSICAL_TIME = 0x0a02 /* Allow
66 * ULTRA_SERVICE_CAPABILITY_TIME
67 * capable guest to make
69 } VMCALL_MONITOR_INTERFACE_METHOD_TUPLE;
71 #define VMCALL_SUCCESS 0
72 #define VMCALL_SUCCESSFUL(result) (result == 0)
75 #define unisys_vmcall(tuple, reg_ebx, reg_ecx) \
76 __unisys_vmcall_gnuc(tuple, reg_ebx, reg_ecx)
77 #define unisys_extended_vmcall(tuple, reg_ebx, reg_ecx, reg_edx) \
78 __unisys_extended_vmcall_gnuc(tuple, reg_ebx, reg_ecx, reg_edx)
79 #define ISSUE_IO_VMCALL(InterfaceMethod, param, result) \
80 (result = unisys_vmcall(InterfaceMethod, (param) & 0xFFFFFFFF, \
82 #define ISSUE_IO_EXTENDED_VMCALL(InterfaceMethod, param1, param2, \
84 (result = unisys_extended_vmcall(InterfaceMethod, param1, \
87 /* The following uses VMCALL_POST_CODE_LOGEVENT interface but is currently
89 #define ISSUE_IO_VMCALL_POSTCODE_SEVERITY(postcode, severity) \
91 U32 _tempresult = VMCALL_SUCCESS; \
92 ISSUE_IO_EXTENDED_VMCALL(VMCALL_POST_CODE_LOGEVENT, severity, \
93 MDS_APPOS, postcode, _tempresult); \
97 /* Structures for IO VMCALLs */
99 /* ///////////// BEGIN PRAGMA PACK PUSH 1 ///////////////////////// */
100 /* ///////////// ONLY STRUCT TYPE SHOULD BE BELOW */
101 #pragma pack(push, 1)
109 /* ///////////// END PRAGMA PACK PUSH 1 /////////////////////////// */
110 typedef struct phys_info IO_DATA_STRUCTURE;
112 /* ///////////// BEGIN PRAGMA PACK PUSH 1 ///////////////////////// */
113 /* ///////////// ONLY STRUCT TYPE SHOULD BE BELOW */
114 #pragma pack(push, 1)
115 /* Parameters to VMCALL_IO_CONTROLVM_ADDR interface */
116 typedef struct _VMCALL_IO_CONTROLVM_ADDR_PARAMS {
117 /* The Guest-relative physical address of the ControlVm channel.
118 * This VMCall fills this in with the appropriate address. */
119 U64 ChannelAddress; /* contents provided by this VMCALL (OUT) */
120 /* the size of the ControlVm channel in bytes This VMCall fills this
121 * in with the appropriate address. */
122 U32 ChannelBytes; /* contents provided by this VMCALL (OUT) */
123 U8 Unused[4]; /* Unused Bytes in the 64-Bit Aligned Struct */
124 } VMCALL_IO_CONTROLVM_ADDR_PARAMS;
127 /* ///////////// END PRAGMA PACK PUSH 1 /////////////////////////// */
129 /* ///////////// BEGIN PRAGMA PACK PUSH 1 ///////////////////////// */
130 /* ///////////// ONLY STRUCT TYPE SHOULD BE BELOW */
131 #pragma pack(push, 1)
132 /* Parameters to VMCALL_IO_DIAG_ADDR interface */
133 typedef struct _VMCALL_IO_DIAG_ADDR_PARAMS {
134 /* The Guest-relative physical address of the diagnostic channel.
135 * This VMCall fills this in with the appropriate address. */
136 U64 ChannelAddress; /* contents provided by this VMCALL (OUT) */
137 } VMCALL_IO_DIAG_ADDR_PARAMS;
140 /* ///////////// END PRAGMA PACK PUSH 1 /////////////////////////// */
142 /* ///////////// BEGIN PRAGMA PACK PUSH 1 ///////////////////////// */
143 /* ///////////// ONLY STRUCT TYPE SHOULD BE BELOW */
144 #pragma pack(push, 1)
145 /* Parameters to VMCALL_IO_VISORSERIAL_ADDR interface */
146 typedef struct _VMCALL_IO_VISORSERIAL_ADDR_PARAMS {
147 /* The Guest-relative physical address of the serial console
148 * channel. This VMCall fills this in with the appropriate
150 U64 ChannelAddress; /* contents provided by this VMCALL (OUT) */
151 } VMCALL_IO_VISORSERIAL_ADDR_PARAMS;
154 /* ///////////// END PRAGMA PACK PUSH 1 /////////////////////////// */
156 /* Parameters to VMCALL_CHANNEL_MISMATCH interface */
157 typedef struct _VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS {
158 U8 ChannelName[32]; /* Null terminated string giving name of channel
160 U8 ItemName[32]; /* Null terminated string giving name of
161 * mismatched item (IN) */
162 U32 SourceLineNumber; /* line# where invoked. (IN) */
163 U8 SourceFileName[36]; /* source code where invoked - Null terminated
165 } VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS;
167 #endif /* __IOMONINTF_H__ */