root / hw / pci_host.h @ d81e54de
History | View | Annotate | Download (2 kB)
1 | 502a5395 | pbrook | /*
|
---|---|---|---|
2 | 502a5395 | pbrook | * QEMU Common PCI Host bridge configuration data space access routines.
|
3 | 502a5395 | pbrook | *
|
4 | 502a5395 | pbrook | * Copyright (c) 2006 Fabrice Bellard
|
5 | 5fafdf24 | ths | *
|
6 | 502a5395 | pbrook | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
7 | 502a5395 | pbrook | * of this software and associated documentation files (the "Software"), to deal
|
8 | 502a5395 | pbrook | * in the Software without restriction, including without limitation the rights
|
9 | 502a5395 | pbrook | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10 | 502a5395 | pbrook | * copies of the Software, and to permit persons to whom the Software is
|
11 | 502a5395 | pbrook | * furnished to do so, subject to the following conditions:
|
12 | 502a5395 | pbrook | *
|
13 | 502a5395 | pbrook | * The above copyright notice and this permission notice shall be included in
|
14 | 502a5395 | pbrook | * all copies or substantial portions of the Software.
|
15 | 502a5395 | pbrook | *
|
16 | 502a5395 | pbrook | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17 | 502a5395 | pbrook | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18 | 502a5395 | pbrook | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
19 | 502a5395 | pbrook | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20 | 502a5395 | pbrook | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21 | 502a5395 | pbrook | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22 | 502a5395 | pbrook | * THE SOFTWARE.
|
23 | 502a5395 | pbrook | */
|
24 | 502a5395 | pbrook | |
25 | 502a5395 | pbrook | /* Worker routines for a PCI host controller that uses an {address,data}
|
26 | 502a5395 | pbrook | register pair to access PCI configuration space. */
|
27 | 502a5395 | pbrook | |
28 | 4f5e19e6 | Isaku Yamahata | #ifndef PCI_HOST_H
|
29 | 4f5e19e6 | Isaku Yamahata | #define PCI_HOST_H
|
30 | 8026037b | blueswir1 | |
31 | 8a14daa5 | Gerd Hoffmann | #include "sysbus.h" |
32 | 9f6f0423 | Michael S. Tsirkin | #include "rwhandler.h" |
33 | 8a14daa5 | Gerd Hoffmann | |
34 | fb47a2e9 | Isaku Yamahata | struct PCIHostState {
|
35 | 8a14daa5 | Gerd Hoffmann | SysBusDevice busdev; |
36 | 9f6f0423 | Michael S. Tsirkin | ReadWriteHandler conf_handler; |
37 | 9f6f0423 | Michael S. Tsirkin | ReadWriteHandler data_handler; |
38 | 502a5395 | pbrook | uint32_t config_reg; |
39 | 502a5395 | pbrook | PCIBus *bus; |
40 | fb47a2e9 | Isaku Yamahata | }; |
41 | 502a5395 | pbrook | |
42 | b6243d99 | Isaku Yamahata | void pci_data_write(PCIBus *s, uint32_t addr, uint32_t val, int len); |
43 | b6243d99 | Isaku Yamahata | uint32_t pci_data_read(PCIBus *s, uint32_t addr, int len);
|
44 | b6243d99 | Isaku Yamahata | |
45 | 4f5e19e6 | Isaku Yamahata | /* for mmio */
|
46 | 6ebf5905 | Alexander Graf | int pci_host_conf_register_mmio(PCIHostState *s, int endian); |
47 | 6ebf5905 | Alexander Graf | int pci_host_data_register_mmio(PCIHostState *s, int endian); |
48 | 502a5395 | pbrook | |
49 | 4f5e19e6 | Isaku Yamahata | /* for ioio */
|
50 | f08b32fe | Isaku Yamahata | void pci_host_conf_register_ioport(pio_addr_t ioport, PCIHostState *s);
|
51 | 4f5e19e6 | Isaku Yamahata | void pci_host_data_register_ioport(pio_addr_t ioport, PCIHostState *s);
|
52 | 502a5395 | pbrook | |
53 | 4f5e19e6 | Isaku Yamahata | #endif /* PCI_HOST_H */ |