0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef __XEN_PUBLIC_EVENT_CHANNEL_H__
0011 #define __XEN_PUBLIC_EVENT_CHANNEL_H__
0012
0013 #include <xen/interface/xen.h>
0014
0015 typedef uint32_t evtchn_port_t;
0016 DEFINE_GUEST_HANDLE(evtchn_port_t);
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026 #define EVTCHNOP_alloc_unbound 6
0027 struct evtchn_alloc_unbound {
0028
0029 domid_t dom, remote_dom;
0030
0031 evtchn_port_t port;
0032 };
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043 #define EVTCHNOP_bind_interdomain 0
0044 struct evtchn_bind_interdomain {
0045
0046 domid_t remote_dom;
0047 evtchn_port_t remote_port;
0048
0049 evtchn_port_t local_port;
0050 };
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060 #define EVTCHNOP_bind_virq 1
0061 struct evtchn_bind_virq {
0062
0063 uint32_t virq;
0064 uint32_t vcpu;
0065
0066 evtchn_port_t port;
0067 };
0068
0069
0070
0071
0072
0073
0074
0075 #define EVTCHNOP_bind_pirq 2
0076 struct evtchn_bind_pirq {
0077
0078 uint32_t pirq;
0079 #define BIND_PIRQ__WILL_SHARE 1
0080 uint32_t flags;
0081
0082 evtchn_port_t port;
0083 };
0084
0085
0086
0087
0088
0089
0090
0091 #define EVTCHNOP_bind_ipi 7
0092 struct evtchn_bind_ipi {
0093 uint32_t vcpu;
0094
0095 evtchn_port_t port;
0096 };
0097
0098
0099
0100
0101
0102
0103 #define EVTCHNOP_close 3
0104 struct evtchn_close {
0105
0106 evtchn_port_t port;
0107 };
0108
0109
0110
0111
0112
0113 #define EVTCHNOP_send 4
0114 struct evtchn_send {
0115
0116 evtchn_port_t port;
0117 };
0118
0119
0120
0121
0122
0123
0124
0125
0126
0127 #define EVTCHNOP_status 5
0128 struct evtchn_status {
0129
0130 domid_t dom;
0131 evtchn_port_t port;
0132
0133 #define EVTCHNSTAT_closed 0
0134 #define EVTCHNSTAT_unbound 1
0135 #define EVTCHNSTAT_interdomain 2
0136 #define EVTCHNSTAT_pirq 3
0137 #define EVTCHNSTAT_virq 4
0138 #define EVTCHNSTAT_ipi 5
0139 uint32_t status;
0140 uint32_t vcpu;
0141 union {
0142 struct {
0143 domid_t dom;
0144 } unbound;
0145 struct {
0146 domid_t dom;
0147 evtchn_port_t port;
0148 } interdomain;
0149 uint32_t pirq;
0150 uint32_t virq;
0151 } u;
0152 };
0153
0154
0155
0156
0157
0158
0159
0160
0161
0162
0163
0164 #define EVTCHNOP_bind_vcpu 8
0165 struct evtchn_bind_vcpu {
0166
0167 evtchn_port_t port;
0168 uint32_t vcpu;
0169 };
0170
0171
0172
0173
0174
0175 #define EVTCHNOP_unmask 9
0176 struct evtchn_unmask {
0177
0178 evtchn_port_t port;
0179 };
0180
0181
0182
0183
0184
0185
0186
0187 #define EVTCHNOP_reset 10
0188 struct evtchn_reset {
0189
0190 domid_t dom;
0191 };
0192 typedef struct evtchn_reset evtchn_reset_t;
0193
0194
0195
0196
0197 #define EVTCHNOP_init_control 11
0198 struct evtchn_init_control {
0199
0200 uint64_t control_gfn;
0201 uint32_t offset;
0202 uint32_t vcpu;
0203
0204 uint8_t link_bits;
0205 uint8_t _pad[7];
0206 };
0207
0208
0209
0210
0211 #define EVTCHNOP_expand_array 12
0212 struct evtchn_expand_array {
0213
0214 uint64_t array_gfn;
0215 };
0216
0217
0218
0219
0220 #define EVTCHNOP_set_priority 13
0221 struct evtchn_set_priority {
0222
0223 evtchn_port_t port;
0224 uint32_t priority;
0225 };
0226
0227 struct evtchn_op {
0228 uint32_t cmd;
0229 union {
0230 struct evtchn_alloc_unbound alloc_unbound;
0231 struct evtchn_bind_interdomain bind_interdomain;
0232 struct evtchn_bind_virq bind_virq;
0233 struct evtchn_bind_pirq bind_pirq;
0234 struct evtchn_bind_ipi bind_ipi;
0235 struct evtchn_close close;
0236 struct evtchn_send send;
0237 struct evtchn_status status;
0238 struct evtchn_bind_vcpu bind_vcpu;
0239 struct evtchn_unmask unmask;
0240 } u;
0241 };
0242 DEFINE_GUEST_HANDLE_STRUCT(evtchn_op);
0243
0244
0245
0246
0247
0248 #define EVTCHN_2L_NR_CHANNELS (sizeof(xen_ulong_t) * sizeof(xen_ulong_t) * 64)
0249
0250
0251
0252
0253
0254
0255 #define EVTCHN_FIFO_PRIORITY_MAX 0
0256 #define EVTCHN_FIFO_PRIORITY_DEFAULT 7
0257 #define EVTCHN_FIFO_PRIORITY_MIN 15
0258
0259 #define EVTCHN_FIFO_MAX_QUEUES (EVTCHN_FIFO_PRIORITY_MIN + 1)
0260
0261 typedef uint32_t event_word_t;
0262
0263 #define EVTCHN_FIFO_PENDING 31
0264 #define EVTCHN_FIFO_MASKED 30
0265 #define EVTCHN_FIFO_LINKED 29
0266 #define EVTCHN_FIFO_BUSY 28
0267
0268 #define EVTCHN_FIFO_LINK_BITS 17
0269 #define EVTCHN_FIFO_LINK_MASK ((1 << EVTCHN_FIFO_LINK_BITS) - 1)
0270
0271 #define EVTCHN_FIFO_NR_CHANNELS (1 << EVTCHN_FIFO_LINK_BITS)
0272
0273 struct evtchn_fifo_control_block {
0274 uint32_t ready;
0275 uint32_t _rsvd;
0276 event_word_t head[EVTCHN_FIFO_MAX_QUEUES];
0277 };
0278
0279 #endif