ia64/xen-unstable

view xen/include/public/physdev.h @ 19836:d9890e67d2b7

tools: add SHAREDIR to buildmakevars2file

c/s 19818 dropped SHAREDIR from xen/util/path.py, which broke the "xm
new" command. This patch adds SHAREDIR back to the new
buildmakevars2file-closure function.

Signed-off-by: Ryan O'Connor <rjo@cs.ubc.ca>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jun 25 13:05:10 2009 +0100 (2009-06-25)
parents aaab04808ee7
children
line source
1 /*
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:
8 *
9 * The above copyright notice and this permission notice shall be included in
10 * all copies or substantial portions of the Software.
11 *
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.
19 */
21 #ifndef __XEN_PUBLIC_PHYSDEV_H__
22 #define __XEN_PUBLIC_PHYSDEV_H__
24 #include "xen.h"
26 /*
27 * Prototype for this hypercall is:
28 * int physdev_op(int cmd, void *args)
29 * @cmd == PHYSDEVOP_??? (physdev operation).
30 * @args == Operation-specific extra arguments (NULL if none).
31 */
33 /*
34 * Notify end-of-interrupt (EOI) for the specified IRQ.
35 * @arg == pointer to physdev_eoi structure.
36 */
37 #define PHYSDEVOP_eoi 12
38 struct physdev_eoi {
39 /* IN */
40 uint32_t irq;
41 };
42 typedef struct physdev_eoi physdev_eoi_t;
43 DEFINE_XEN_GUEST_HANDLE(physdev_eoi_t);
45 /*
46 * Register a shared page for the hypervisor to indicate whether the guest
47 * must issue PHYSDEVOP_eoi. The semantics of PHYSDEVOP_eoi change slightly
48 * once the guest used this function in that the associated event channel
49 * will automatically get unmasked. The page registered is used as a bit
50 * array indexed by Xen's PIRQ value.
51 */
52 #define PHYSDEVOP_pirq_eoi_gmfn 17
53 struct physdev_pirq_eoi_gmfn {
54 /* IN */
55 xen_pfn_t gmfn;
56 };
57 typedef struct physdev_pirq_eoi_gmfn physdev_pirq_eoi_gmfn_t;
58 DEFINE_XEN_GUEST_HANDLE(physdev_pirq_eoi_gmfn_t);
60 /*
61 * Query the status of an IRQ line.
62 * @arg == pointer to physdev_irq_status_query structure.
63 */
64 #define PHYSDEVOP_irq_status_query 5
65 struct physdev_irq_status_query {
66 /* IN */
67 uint32_t irq;
68 /* OUT */
69 uint32_t flags; /* XENIRQSTAT_* */
70 };
71 typedef struct physdev_irq_status_query physdev_irq_status_query_t;
72 DEFINE_XEN_GUEST_HANDLE(physdev_irq_status_query_t);
74 /* Need to call PHYSDEVOP_eoi when the IRQ has been serviced? */
75 #define _XENIRQSTAT_needs_eoi (0)
76 #define XENIRQSTAT_needs_eoi (1U<<_XENIRQSTAT_needs_eoi)
78 /* IRQ shared by multiple guests? */
79 #define _XENIRQSTAT_shared (1)
80 #define XENIRQSTAT_shared (1U<<_XENIRQSTAT_shared)
82 /*
83 * Set the current VCPU's I/O privilege level.
84 * @arg == pointer to physdev_set_iopl structure.
85 */
86 #define PHYSDEVOP_set_iopl 6
87 struct physdev_set_iopl {
88 /* IN */
89 uint32_t iopl;
90 };
91 typedef struct physdev_set_iopl physdev_set_iopl_t;
92 DEFINE_XEN_GUEST_HANDLE(physdev_set_iopl_t);
94 /*
95 * Set the current VCPU's I/O-port permissions bitmap.
96 * @arg == pointer to physdev_set_iobitmap structure.
97 */
98 #define PHYSDEVOP_set_iobitmap 7
99 struct physdev_set_iobitmap {
100 /* IN */
101 #if __XEN_INTERFACE_VERSION__ >= 0x00030205
102 XEN_GUEST_HANDLE(uint8) bitmap;
103 #else
104 uint8_t *bitmap;
105 #endif
106 uint32_t nr_ports;
107 };
108 typedef struct physdev_set_iobitmap physdev_set_iobitmap_t;
109 DEFINE_XEN_GUEST_HANDLE(physdev_set_iobitmap_t);
111 /*
112 * Read or write an IO-APIC register.
113 * @arg == pointer to physdev_apic structure.
114 */
115 #define PHYSDEVOP_apic_read 8
116 #define PHYSDEVOP_apic_write 9
117 struct physdev_apic {
118 /* IN */
119 unsigned long apic_physbase;
120 uint32_t reg;
121 /* IN or OUT */
122 uint32_t value;
123 };
124 typedef struct physdev_apic physdev_apic_t;
125 DEFINE_XEN_GUEST_HANDLE(physdev_apic_t);
127 /*
128 * Allocate or free a physical upcall vector for the specified IRQ line.
129 * @arg == pointer to physdev_irq structure.
130 */
131 #define PHYSDEVOP_alloc_irq_vector 10
132 #define PHYSDEVOP_free_irq_vector 11
133 struct physdev_irq {
134 /* IN */
135 uint32_t irq;
136 /* IN or OUT */
137 uint32_t vector;
138 };
139 typedef struct physdev_irq physdev_irq_t;
140 DEFINE_XEN_GUEST_HANDLE(physdev_irq_t);
142 #define MAP_PIRQ_TYPE_MSI 0x0
143 #define MAP_PIRQ_TYPE_GSI 0x1
144 #define MAP_PIRQ_TYPE_UNKNOWN 0x2
146 #define PHYSDEVOP_map_pirq 13
147 struct physdev_map_pirq {
148 domid_t domid;
149 /* IN */
150 int type;
151 /* IN */
152 int index;
153 /* IN or OUT */
154 int pirq;
155 /* IN */
156 int bus;
157 /* IN */
158 int devfn;
159 /* IN */
160 int entry_nr;
161 /* IN */
162 uint64_t table_base;
163 };
164 typedef struct physdev_map_pirq physdev_map_pirq_t;
165 DEFINE_XEN_GUEST_HANDLE(physdev_map_pirq_t);
167 #define PHYSDEVOP_unmap_pirq 14
168 struct physdev_unmap_pirq {
169 domid_t domid;
170 /* IN */
171 int pirq;
172 };
174 typedef struct physdev_unmap_pirq physdev_unmap_pirq_t;
175 DEFINE_XEN_GUEST_HANDLE(physdev_unmap_pirq_t);
177 #define PHYSDEVOP_manage_pci_add 15
178 #define PHYSDEVOP_manage_pci_remove 16
179 struct physdev_manage_pci {
180 /* IN */
181 uint8_t bus;
182 uint8_t devfn;
183 };
185 typedef struct physdev_manage_pci physdev_manage_pci_t;
186 DEFINE_XEN_GUEST_HANDLE(physdev_manage_pci_t);
188 #define PHYSDEVOP_restore_msi 19
189 struct physdev_restore_msi {
190 /* IN */
191 uint8_t bus;
192 uint8_t devfn;
193 };
194 typedef struct physdev_restore_msi physdev_restore_msi_t;
195 DEFINE_XEN_GUEST_HANDLE(physdev_restore_msi_t);
197 #define PHYSDEVOP_manage_pci_add_ext 20
198 struct physdev_manage_pci_ext {
199 /* IN */
200 uint8_t bus;
201 uint8_t devfn;
202 unsigned is_extfn;
203 unsigned is_virtfn;
204 struct {
205 uint8_t bus;
206 uint8_t devfn;
207 } physfn;
208 };
210 typedef struct physdev_manage_pci_ext physdev_manage_pci_ext_t;
211 DEFINE_XEN_GUEST_HANDLE(physdev_manage_pci_ext_t);
213 /*
214 * Argument to physdev_op_compat() hypercall. Superceded by new physdev_op()
215 * hypercall since 0x00030202.
216 */
217 struct physdev_op {
218 uint32_t cmd;
219 union {
220 struct physdev_irq_status_query irq_status_query;
221 struct physdev_set_iopl set_iopl;
222 struct physdev_set_iobitmap set_iobitmap;
223 struct physdev_apic apic_op;
224 struct physdev_irq irq_op;
225 } u;
226 };
227 typedef struct physdev_op physdev_op_t;
228 DEFINE_XEN_GUEST_HANDLE(physdev_op_t);
230 /*
231 * Notify that some PIRQ-bound event channels have been unmasked.
232 * ** This command is obsolete since interface version 0x00030202 and is **
233 * ** unsupported by newer versions of Xen. **
234 */
235 #define PHYSDEVOP_IRQ_UNMASK_NOTIFY 4
237 /*
238 * These all-capitals physdev operation names are superceded by the new names
239 * (defined above) since interface version 0x00030202.
240 */
241 #define PHYSDEVOP_IRQ_STATUS_QUERY PHYSDEVOP_irq_status_query
242 #define PHYSDEVOP_SET_IOPL PHYSDEVOP_set_iopl
243 #define PHYSDEVOP_SET_IOBITMAP PHYSDEVOP_set_iobitmap
244 #define PHYSDEVOP_APIC_READ PHYSDEVOP_apic_read
245 #define PHYSDEVOP_APIC_WRITE PHYSDEVOP_apic_write
246 #define PHYSDEVOP_ASSIGN_VECTOR PHYSDEVOP_alloc_irq_vector
247 #define PHYSDEVOP_FREE_VECTOR PHYSDEVOP_free_irq_vector
248 #define PHYSDEVOP_IRQ_NEEDS_UNMASK_NOTIFY XENIRQSTAT_needs_eoi
249 #define PHYSDEVOP_IRQ_SHARED XENIRQSTAT_shared
251 #endif /* __XEN_PUBLIC_PHYSDEV_H__ */
253 /*
254 * Local variables:
255 * mode: C
256 * c-set-style: "BSD"
257 * c-basic-offset: 4
258 * tab-width: 4
259 * indent-tabs-mode: nil
260 * End:
261 */