2 * ioreq.h: I/O request definitions for device models
3 * Copyright (c) 2004, Intel Corporation.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
16 * Place - Suite 330, Boston, MA 02111-1307 USA.
26 #define STATE_INVALID 0
27 #define STATE_IOREQ_READY 1
28 #define STATE_IOREQ_INPROCESS 2
29 #define STATE_IORESP_READY 3
31 #define IOREQ_TYPE_PIO 0 /* pio */
32 #define IOREQ_TYPE_COPY 1 /* mmio ops */
33 #define IOREQ_TYPE_AND 2
34 #define IOREQ_TYPE_OR 3
35 #define IOREQ_TYPE_XOR 4
36 #define IOREQ_TYPE_XCHG 5
39 * VMExit dispatcher should cooperate with instruction decoder to
40 * prepare this structure and notify service OS and DM by sending
44 uint64_t addr; /* physical address */
45 uint64_t size; /* size in bytes */
46 uint64_t count; /* for rep prefixes */
48 uint64_t data; /* data */
49 void *pdata; /* pointer to data */
52 uint8_t pdata_valid:1; /* if 1, use pdata above */
53 uint8_t dir:1; /* 1=read, 0=write */
55 uint8_t type; /* I/O type */
56 uint64_t io_count; /* How many IO done on a vcpu */
58 typedef struct ioreq ioreq_t;
60 struct global_iodata {
63 uint16_t pic_last_irr;
64 uint16_t pic_clear_irr;
66 typedef struct global_iodata global_iodata_t;
69 struct ioreq vp_ioreq;
70 /* Event channel port */
71 unsigned int vp_eport; /* VMX vcpu uses this to notify DM */
73 typedef struct vcpu_iodata vcpu_iodata_t;
75 struct shared_iopage {
76 struct global_iodata sp_global;
77 struct vcpu_iodata vcpu_iodata[1];
79 typedef struct shared_iopage shared_iopage_t;
81 #define IOREQ_BUFFER_SLOT_NUM 80
82 struct buffered_iopage {
83 unsigned long read_pointer;
84 unsigned long write_pointer;
85 ioreq_t ioreq[IOREQ_BUFFER_SLOT_NUM];
86 }; /* sizeof this structure must be in one page */
87 typedef struct buffered_iopage buffered_iopage_t;
89 #endif /* _IOREQ_H_ */
97 * indent-tabs-mode: nil