win-pvdrivers

annotate common/include/public/physdev.h @ 146:b474e898b409

patches to change 'long' types in the headers to something that is the same as sizeof(void *) under i386 and amd64 architectures
author James Harper <james.harper@bendigoit.com.au>
date Wed Jan 23 13:01:20 2008 +1100 (2008-01-23)
parents 5712dede5a1b
children
rev   line source
andy@12 1 /*
andy@12 2 * Permission is hereby granted, free of charge, to any person obtaining a copy
andy@12 3 * of this software and associated documentation files (the "Software"), to
andy@12 4 * deal in the Software without restriction, including without limitation the
andy@12 5 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
andy@12 6 * sell copies of the Software, and to permit persons to whom the Software is
andy@12 7 * furnished to do so, subject to the following conditions:
andy@12 8 *
andy@12 9 * The above copyright notice and this permission notice shall be included in
andy@12 10 * all copies or substantial portions of the Software.
andy@12 11 *
andy@12 12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
andy@12 13 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
andy@12 14 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
andy@12 15 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
andy@12 16 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
andy@12 17 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
andy@12 18 * DEALINGS IN THE SOFTWARE.
andy@12 19 */
andy@12 20
andy@12 21 #ifndef __XEN_PUBLIC_PHYSDEV_H__
andy@12 22 #define __XEN_PUBLIC_PHYSDEV_H__
andy@12 23
andy@12 24 /*
andy@12 25 * Prototype for this hypercall is:
andy@12 26 * int physdev_op(int cmd, void *args)
andy@12 27 * @cmd == PHYSDEVOP_??? (physdev operation).
andy@12 28 * @args == Operation-specific extra arguments (NULL if none).
andy@12 29 */
andy@12 30
andy@12 31 /*
andy@12 32 * Notify end-of-interrupt (EOI) for the specified IRQ.
andy@12 33 * @arg == pointer to physdev_eoi structure.
andy@12 34 */
andy@12 35 #define PHYSDEVOP_eoi 12
andy@12 36 struct physdev_eoi {
andy@12 37 /* IN */
andy@12 38 uint32_t irq;
andy@12 39 };
andy@12 40 typedef struct physdev_eoi physdev_eoi_t;
andy@12 41 DEFINE_XEN_GUEST_HANDLE(physdev_eoi_t);
andy@12 42
andy@12 43 /*
andy@12 44 * Query the status of an IRQ line.
andy@12 45 * @arg == pointer to physdev_irq_status_query structure.
andy@12 46 */
andy@12 47 #define PHYSDEVOP_irq_status_query 5
andy@12 48 struct physdev_irq_status_query {
andy@12 49 /* IN */
andy@12 50 uint32_t irq;
andy@12 51 /* OUT */
andy@12 52 uint32_t flags; /* XENIRQSTAT_* */
andy@12 53 };
andy@12 54 typedef struct physdev_irq_status_query physdev_irq_status_query_t;
andy@12 55 DEFINE_XEN_GUEST_HANDLE(physdev_irq_status_query_t);
andy@12 56
andy@12 57 /* Need to call PHYSDEVOP_eoi when the IRQ has been serviced? */
andy@12 58 #define _XENIRQSTAT_needs_eoi (0)
andy@12 59 #define XENIRQSTAT_needs_eoi (1U<<_XENIRQSTAT_needs_eoi)
andy@12 60
andy@12 61 /* IRQ shared by multiple guests? */
andy@12 62 #define _XENIRQSTAT_shared (1)
andy@12 63 #define XENIRQSTAT_shared (1U<<_XENIRQSTAT_shared)
andy@12 64
andy@12 65 /*
andy@12 66 * Set the current VCPU's I/O privilege level.
andy@12 67 * @arg == pointer to physdev_set_iopl structure.
andy@12 68 */
andy@12 69 #define PHYSDEVOP_set_iopl 6
andy@12 70 struct physdev_set_iopl {
andy@12 71 /* IN */
andy@12 72 uint32_t iopl;
andy@12 73 };
andy@12 74 typedef struct physdev_set_iopl physdev_set_iopl_t;
andy@12 75 DEFINE_XEN_GUEST_HANDLE(physdev_set_iopl_t);
andy@12 76
andy@12 77 /*
andy@12 78 * Set the current VCPU's I/O-port permissions bitmap.
andy@12 79 * @arg == pointer to physdev_set_iobitmap structure.
andy@12 80 */
andy@12 81 #define PHYSDEVOP_set_iobitmap 7
andy@12 82 struct physdev_set_iobitmap {
andy@12 83 /* IN */
andy@12 84 XEN_GUEST_HANDLE_00030205(uint8_t) bitmap;
andy@12 85 uint32_t nr_ports;
andy@12 86 };
andy@12 87 typedef struct physdev_set_iobitmap physdev_set_iobitmap_t;
andy@12 88 DEFINE_XEN_GUEST_HANDLE(physdev_set_iobitmap_t);
andy@12 89
andy@12 90 /*
andy@12 91 * Read or write an IO-APIC register.
andy@12 92 * @arg == pointer to physdev_apic structure.
andy@12 93 */
andy@12 94 #define PHYSDEVOP_apic_read 8
andy@12 95 #define PHYSDEVOP_apic_write 9
andy@12 96 struct physdev_apic {
andy@12 97 /* IN */
james@146 98 xen_ulong_t apic_physbase;
andy@12 99 uint32_t reg;
andy@12 100 /* IN or OUT */
andy@12 101 uint32_t value;
andy@12 102 };
andy@12 103 typedef struct physdev_apic physdev_apic_t;
andy@12 104 DEFINE_XEN_GUEST_HANDLE(physdev_apic_t);
andy@12 105
andy@12 106 /*
andy@12 107 * Allocate or free a physical upcall vector for the specified IRQ line.
andy@12 108 * @arg == pointer to physdev_irq structure.
andy@12 109 */
andy@12 110 #define PHYSDEVOP_alloc_irq_vector 10
andy@12 111 #define PHYSDEVOP_free_irq_vector 11
andy@12 112 struct physdev_irq {
andy@12 113 /* IN */
andy@12 114 uint32_t irq;
andy@12 115 /* IN or OUT */
andy@12 116 uint32_t vector;
andy@12 117 };
andy@12 118 typedef struct physdev_irq physdev_irq_t;
andy@12 119 DEFINE_XEN_GUEST_HANDLE(physdev_irq_t);
andy@12 120
andy@12 121 /*
andy@12 122 * Argument to physdev_op_compat() hypercall. Superceded by new physdev_op()
andy@12 123 * hypercall since 0x00030202.
andy@12 124 */
andy@12 125 struct physdev_op {
andy@12 126 uint32_t cmd;
andy@12 127 union {
andy@12 128 struct physdev_irq_status_query irq_status_query;
andy@12 129 struct physdev_set_iopl set_iopl;
andy@12 130 struct physdev_set_iobitmap set_iobitmap;
andy@12 131 struct physdev_apic apic_op;
andy@12 132 struct physdev_irq irq_op;
andy@12 133 } u;
andy@12 134 };
andy@12 135 typedef struct physdev_op physdev_op_t;
andy@12 136 DEFINE_XEN_GUEST_HANDLE(physdev_op_t);
andy@12 137
andy@12 138 /*
andy@12 139 * Notify that some PIRQ-bound event channels have been unmasked.
andy@12 140 * ** This command is obsolete since interface version 0x00030202 and is **
andy@12 141 * ** unsupported by newer versions of Xen. **
andy@12 142 */
andy@12 143 #define PHYSDEVOP_IRQ_UNMASK_NOTIFY 4
andy@12 144
andy@12 145 /*
andy@12 146 * These all-capitals physdev operation names are superceded by the new names
andy@12 147 * (defined above) since interface version 0x00030202.
andy@12 148 */
andy@12 149 #define PHYSDEVOP_IRQ_STATUS_QUERY PHYSDEVOP_irq_status_query
andy@12 150 #define PHYSDEVOP_SET_IOPL PHYSDEVOP_set_iopl
andy@12 151 #define PHYSDEVOP_SET_IOBITMAP PHYSDEVOP_set_iobitmap
andy@12 152 #define PHYSDEVOP_APIC_READ PHYSDEVOP_apic_read
andy@12 153 #define PHYSDEVOP_APIC_WRITE PHYSDEVOP_apic_write
andy@12 154 #define PHYSDEVOP_ASSIGN_VECTOR PHYSDEVOP_alloc_irq_vector
andy@12 155 #define PHYSDEVOP_FREE_VECTOR PHYSDEVOP_free_irq_vector
andy@12 156 #define PHYSDEVOP_IRQ_NEEDS_UNMASK_NOTIFY XENIRQSTAT_needs_eoi
andy@12 157 #define PHYSDEVOP_IRQ_SHARED XENIRQSTAT_shared
andy@12 158
andy@12 159 #endif /* __XEN_PUBLIC_PHYSDEV_H__ */
andy@12 160
andy@12 161 /*
andy@12 162 * Local variables:
andy@12 163 * mode: C
andy@12 164 * c-set-style: "BSD"
andy@12 165 * c-basic-offset: 4
andy@12 166 * tab-width: 4
andy@12 167 * indent-tabs-mode: nil
andy@12 168 * End:
andy@12 169 */