direct-io.hg

view xen/include/public/hvm/ioreq.h @ 12390:430e06e2aa08

[HVM][IA64] Due to IPF Guest Firmware will enumerate PCI, shutdown in
IPF doesn't work This patch makes shutdown work for IPF.

Signed-off-by, Anthony Xu <anthony.xu@intel.com>
author kfraser@localhost.localdomain
date Mon Nov 13 14:20:26 2006 +0000 (2006-11-13)
parents 6c975e642719
children 23dcc167b97e
line source
1 /*
2 * ioreq.h: I/O request definitions for device models
3 * Copyright (c) 2004, Intel Corporation.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to
7 * deal in the Software without restriction, including without limitation the
8 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9 * sell copies of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
22 */
24 #ifndef _IOREQ_H_
25 #define _IOREQ_H_
27 #define IOREQ_READ 1
28 #define IOREQ_WRITE 0
30 #define STATE_IOREQ_NONE 0
31 #define STATE_IOREQ_READY 1
32 #define STATE_IOREQ_INPROCESS 2
33 #define STATE_IORESP_READY 3
35 #define IOREQ_TYPE_PIO 0 /* pio */
36 #define IOREQ_TYPE_COPY 1 /* mmio ops */
37 #define IOREQ_TYPE_AND 2
38 #define IOREQ_TYPE_OR 3
39 #define IOREQ_TYPE_XOR 4
40 #define IOREQ_TYPE_XCHG 5
41 #define IOREQ_TYPE_ADD 6
43 /*
44 * VMExit dispatcher should cooperate with instruction decoder to
45 * prepare this structure and notify service OS and DM by sending
46 * virq
47 */
48 struct ioreq {
49 uint64_t addr; /* physical address */
50 uint64_t size; /* size in bytes */
51 uint64_t count; /* for rep prefixes */
52 uint64_t data; /* data (or paddr of data) */
53 uint8_t state:4;
54 uint8_t data_is_ptr:1; /* if 1, data above is the guest paddr
55 * of the real data to use. */
56 uint8_t dir:1; /* 1=read, 0=write */
57 uint8_t df:1;
58 uint8_t type; /* I/O type */
59 uint64_t io_count; /* How many IO done on a vcpu */
60 };
61 typedef struct ioreq ioreq_t;
63 struct vcpu_iodata {
64 struct ioreq vp_ioreq;
65 /* Event channel port */
66 unsigned int vp_eport; /* VMX vcpu uses this to notify DM */
67 };
68 typedef struct vcpu_iodata vcpu_iodata_t;
70 struct shared_iopage {
71 struct vcpu_iodata vcpu_iodata[1];
72 };
73 typedef struct shared_iopage shared_iopage_t;
75 #define IOREQ_BUFFER_SLOT_NUM 80
76 struct buffered_iopage {
77 unsigned long read_pointer;
78 unsigned long write_pointer;
79 ioreq_t ioreq[IOREQ_BUFFER_SLOT_NUM];
80 }; /* sizeof this structure must be in one page */
81 typedef struct buffered_iopage buffered_iopage_t;
83 #define ACPI_PM1A_EVT_BLK_ADDRESS 0x0000000000001f40
84 #define ACPI_PM1A_CNT_BLK_ADDRESS (ACPI_PM1A_EVT_BLK_ADDRESS + 0x04)
85 #define ACPI_PM_TMR_BLK_ADDRESS (ACPI_PM1A_EVT_BLK_ADDRESS + 0x08)
87 #endif /* _IOREQ_H_ */
89 /*
90 * Local variables:
91 * mode: C
92 * c-set-style: "BSD"
93 * c-basic-offset: 4
94 * tab-width: 4
95 * indent-tabs-mode: nil
96 * End:
97 */