debuggers.hg

view xen/include/public/io/ioreq.h @ 6644:29808fef9148

merge?
author cl349@firebug.cl.cam.ac.uk
date Sat Sep 03 18:24:46 2005 +0000 (2005-09-03)
parents 20140d3fbf83 f27205ea60ef
children b6c98fe62e1a
line source
1 /*
2 * ioreq.h: I/O request definitions for device models
3 * Copyright (c) 2004, Intel Corporation.
4 *
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.
8 *
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
12 * more details.
13 *
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.
17 *
18 */
20 #ifndef _IOREQ_H_
21 #define _IOREQ_H_
23 #define IOREQ_READ 1
24 #define IOREQ_WRITE 0
26 #define STATE_INVALID 0
27 #define STATE_IOREQ_READY 1
28 #define STATE_IOREQ_INPROCESS 2
29 #define STATE_IORESP_READY 3
30 #define STATE_IORESP_HOOK 4
32 #define IOREQ_TYPE_PIO 0 /* pio */
33 #define IOREQ_TYPE_COPY 1 /* mmio ops */
34 #define IOREQ_TYPE_AND 2
35 #define IOREQ_TYPE_OR 3
36 #define IOREQ_TYPE_XOR 4
38 /*
39 * VMExit dispatcher should cooperate with instruction decoder to
40 * prepare this structure and notify service OS and DM by sending
41 * virq
42 */
43 typedef struct {
44 u64 addr; /* physical address */
45 u64 size; /* size in bytes */
46 u64 count; /* for rep prefixes */
47 union {
48 u64 data; /* data */
49 void *pdata; /* pointer to data */
50 } u;
51 u8 state:4;
52 u8 pdata_valid:1; /* if 1, use pdata above */
53 u8 dir:1; /* 1=read, 0=write */
54 u8 df:1;
55 u8 type; /* I/O type */
56 } ioreq_t;
58 #define MAX_VECTOR 256
59 #define BITS_PER_BYTE 8
60 #define INTR_LEN (MAX_VECTOR/(BITS_PER_BYTE * sizeof(u64)))
62 typedef struct {
63 u64 pic_intr[INTR_LEN];
64 u64 pic_mask[INTR_LEN];
65 int eport; /* Event channel port */
66 } global_iodata_t;
68 typedef struct {
69 ioreq_t vp_ioreq;
70 unsigned long vp_intr[INTR_LEN];
71 } vcpu_iodata_t;
73 typedef struct {
74 global_iodata_t sp_global;
75 vcpu_iodata_t vcpu_iodata[1];
76 } shared_iopage_t;
78 #endif /* _IOREQ_H_ */