2 * Permission is hereby granted, free of charge, to any person obtaining a copy
3 * of this software and associated documentation files (the "Software"), to
4 * deal in the Software without restriction, including without limitation the
5 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
6 * sell copies of the Software, and to permit persons to whom the Software is
7 * furnished to do so, subject to the following conditions:
9 * The above copyright notice and this permission notice shall be included in
10 * all copies or substantial portions of the Software.
12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
17 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
18 * DEALINGS IN THE SOFTWARE.
21 #ifndef __XEN_PUBLIC_PHYSDEV_H__
22 #define __XEN_PUBLIC_PHYSDEV_H__
25 * Prototype for this hypercall is:
26 * int physdev_op(int cmd, void *args)
27 * @cmd == PHYSDEVOP_??? (physdev operation).
28 * @args == Operation-specific extra arguments (NULL if none).
32 * Notify end-of-interrupt (EOI) for the specified IRQ.
33 * @arg == pointer to physdev_eoi structure.
35 #define PHYSDEVOP_eoi 12
40 typedef struct physdev_eoi physdev_eoi_t
;
41 DEFINE_XEN_GUEST_HANDLE(physdev_eoi_t
);
44 * Register a shared page for the hypervisor to indicate whether the guest
45 * must issue PHYSDEVOP_eoi. The semantics of PHYSDEVOP_eoi change slightly
46 * once the guest used this function in that the associated event channel
47 * will automatically get unmasked. The page registered is used as a bit
48 * array indexed by Xen's PIRQ value.
50 #define PHYSDEVOP_pirq_eoi_gmfn 17
51 struct physdev_pirq_eoi_gmfn
{
55 typedef struct physdev_pirq_eoi_gmfn physdev_pirq_eoi_gmfn_t
;
56 DEFINE_XEN_GUEST_HANDLE(physdev_pirq_eoi_gmfn_t
);
59 * Query the status of an IRQ line.
60 * @arg == pointer to physdev_irq_status_query structure.
62 #define PHYSDEVOP_irq_status_query 5
63 struct physdev_irq_status_query
{
67 uint32_t flags
; /* XENIRQSTAT_* */
69 typedef struct physdev_irq_status_query physdev_irq_status_query_t
;
70 DEFINE_XEN_GUEST_HANDLE(physdev_irq_status_query_t
);
72 /* Need to call PHYSDEVOP_eoi when the IRQ has been serviced? */
73 #define _XENIRQSTAT_needs_eoi (0)
74 #define XENIRQSTAT_needs_eoi (1U<<_XENIRQSTAT_needs_eoi)
76 /* IRQ shared by multiple guests? */
77 #define _XENIRQSTAT_shared (1)
78 #define XENIRQSTAT_shared (1U<<_XENIRQSTAT_shared)
81 * Set the current VCPU's I/O privilege level.
82 * @arg == pointer to physdev_set_iopl structure.
84 #define PHYSDEVOP_set_iopl 6
85 struct physdev_set_iopl
{
89 typedef struct physdev_set_iopl physdev_set_iopl_t
;
90 DEFINE_XEN_GUEST_HANDLE(physdev_set_iopl_t
);
93 * Set the current VCPU's I/O-port permissions bitmap.
94 * @arg == pointer to physdev_set_iobitmap structure.
96 #define PHYSDEVOP_set_iobitmap 7
97 struct physdev_set_iobitmap
{
99 #if __XEN_INTERFACE_VERSION__ >= 0x00030205
100 XEN_GUEST_HANDLE(uint8
) bitmap
;
106 typedef struct physdev_set_iobitmap physdev_set_iobitmap_t
;
107 DEFINE_XEN_GUEST_HANDLE(physdev_set_iobitmap_t
);
110 * Read or write an IO-APIC register.
111 * @arg == pointer to physdev_apic structure.
113 #define PHYSDEVOP_apic_read 8
114 #define PHYSDEVOP_apic_write 9
115 struct physdev_apic
{
117 unsigned long apic_physbase
;
122 typedef struct physdev_apic physdev_apic_t
;
123 DEFINE_XEN_GUEST_HANDLE(physdev_apic_t
);
126 * Allocate or free a physical upcall vector for the specified IRQ line.
127 * @arg == pointer to physdev_irq structure.
129 #define PHYSDEVOP_alloc_irq_vector 10
130 #define PHYSDEVOP_free_irq_vector 11
137 typedef struct physdev_irq physdev_irq_t
;
138 DEFINE_XEN_GUEST_HANDLE(physdev_irq_t
);
140 #define MAP_PIRQ_TYPE_MSI 0x0
141 #define MAP_PIRQ_TYPE_GSI 0x1
142 #define MAP_PIRQ_TYPE_UNKNOWN 0x2
144 #define PHYSDEVOP_map_pirq 13
145 struct physdev_map_pirq
{
162 typedef struct physdev_map_pirq physdev_map_pirq_t
;
163 DEFINE_XEN_GUEST_HANDLE(physdev_map_pirq_t
);
165 #define PHYSDEVOP_unmap_pirq 14
166 struct physdev_unmap_pirq
{
172 typedef struct physdev_unmap_pirq physdev_unmap_pirq_t
;
173 DEFINE_XEN_GUEST_HANDLE(physdev_unmap_pirq_t
);
175 #define PHYSDEVOP_manage_pci_add 15
176 #define PHYSDEVOP_manage_pci_remove 16
177 struct physdev_manage_pci
{
183 typedef struct physdev_manage_pci physdev_manage_pci_t
;
184 DEFINE_XEN_GUEST_HANDLE(physdev_manage_pci_t
);
186 #define PHYSDEVOP_restore_msi 19
187 struct physdev_restore_msi
{
192 typedef struct physdev_restore_msi physdev_restore_msi_t
;
193 DEFINE_XEN_GUEST_HANDLE(physdev_restore_msi_t
);
195 #define PHYSDEVOP_manage_pci_add_ext 20
196 struct physdev_manage_pci_ext
{
208 typedef struct physdev_manage_pci_ext physdev_manage_pci_ext_t
;
209 DEFINE_XEN_GUEST_HANDLE(physdev_manage_pci_ext_t
);
212 * Argument to physdev_op_compat() hypercall. Superceded by new physdev_op()
213 * hypercall since 0x00030202.
218 struct physdev_irq_status_query irq_status_query
;
219 struct physdev_set_iopl set_iopl
;
220 struct physdev_set_iobitmap set_iobitmap
;
221 struct physdev_apic apic_op
;
222 struct physdev_irq irq_op
;
225 typedef struct physdev_op physdev_op_t
;
226 DEFINE_XEN_GUEST_HANDLE(physdev_op_t
);
229 * Notify that some PIRQ-bound event channels have been unmasked.
230 * ** This command is obsolete since interface version 0x00030202 and is **
231 * ** unsupported by newer versions of Xen. **
233 #define PHYSDEVOP_IRQ_UNMASK_NOTIFY 4
236 * These all-capitals physdev operation names are superceded by the new names
237 * (defined above) since interface version 0x00030202.
239 #define PHYSDEVOP_IRQ_STATUS_QUERY PHYSDEVOP_irq_status_query
240 #define PHYSDEVOP_SET_IOPL PHYSDEVOP_set_iopl
241 #define PHYSDEVOP_SET_IOBITMAP PHYSDEVOP_set_iobitmap
242 #define PHYSDEVOP_APIC_READ PHYSDEVOP_apic_read
243 #define PHYSDEVOP_APIC_WRITE PHYSDEVOP_apic_write
244 #define PHYSDEVOP_ASSIGN_VECTOR PHYSDEVOP_alloc_irq_vector
245 #define PHYSDEVOP_FREE_VECTOR PHYSDEVOP_free_irq_vector
246 #define PHYSDEVOP_IRQ_NEEDS_UNMASK_NOTIFY XENIRQSTAT_needs_eoi
247 #define PHYSDEVOP_IRQ_SHARED XENIRQSTAT_shared
249 #endif /* __XEN_PUBLIC_PHYSDEV_H__ */
257 * indent-tabs-mode: nil