Statistics
| Branch: | Revision:

root / hw / pci_host.h @ 9f6f0423

History | View | Annotate | Download (2.1 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_noswap_handler;
37 9f6f0423 Michael S. Tsirkin
    ReadWriteHandler conf_handler;
38 9f6f0423 Michael S. Tsirkin
    ReadWriteHandler data_handler;
39 502a5395 pbrook
    uint32_t config_reg;
40 502a5395 pbrook
    PCIBus *bus;
41 fb47a2e9 Isaku Yamahata
};
42 502a5395 pbrook
43 b6243d99 Isaku Yamahata
void pci_data_write(PCIBus *s, uint32_t addr, uint32_t val, int len);
44 b6243d99 Isaku Yamahata
uint32_t pci_data_read(PCIBus *s, uint32_t addr, int len);
45 b6243d99 Isaku Yamahata
46 4f5e19e6 Isaku Yamahata
/* for mmio */
47 f08b32fe Isaku Yamahata
int pci_host_conf_register_mmio(PCIHostState *s);
48 f08b32fe Isaku Yamahata
int pci_host_conf_register_mmio_noswap(PCIHostState *s);
49 f08b32fe Isaku Yamahata
int pci_host_data_register_mmio(PCIHostState *s);
50 502a5395 pbrook
51 4f5e19e6 Isaku Yamahata
/* for ioio */
52 f08b32fe Isaku Yamahata
void pci_host_conf_register_ioport(pio_addr_t ioport, PCIHostState *s);
53 4f5e19e6 Isaku Yamahata
void pci_host_data_register_ioport(pio_addr_t ioport, PCIHostState *s);
54 502a5395 pbrook
55 4f5e19e6 Isaku Yamahata
#endif /* PCI_HOST_H */