1 |
/* |
/* |
2 |
* Cisco 7200 (Predator) simulation platform. |
* Cisco router simulation platform. |
3 |
* Copyright (c) 2005,2006 Christophe Fillot (cf@utc.fr) |
* Copyright (c) 2005,2006 Christophe Fillot (cf@utc.fr) |
4 |
*/ |
*/ |
5 |
|
|
7 |
#define __PCI_DEV_H__ |
#define __PCI_DEV_H__ |
8 |
|
|
9 |
#include "utils.h" |
#include "utils.h" |
|
//#include "pcireg.h" |
|
10 |
|
|
11 |
#define PCI_BUS_ADDR 0xcf8 |
#define PCI_BUS_ADDR 0xcf8 |
12 |
#define PCI_BUS_DATA 0xcfc |
#define PCI_BUS_DATA 0xcfc |
27 |
|
|
28 |
/* PCI function prototypes */ |
/* PCI function prototypes */ |
29 |
typedef void (*pci_init_t)(pci_dev_t *dev); |
typedef void (*pci_init_t)(pci_dev_t *dev); |
30 |
typedef m_uint32_t (*pci_reg_read_t)(cpu_mips_t *cpu,pci_dev_t *dev,int reg); |
typedef m_uint32_t (*pci_reg_read_t)(cpu_gen_t *cpu,pci_dev_t *dev,int reg); |
31 |
typedef void (*pci_reg_write_t)(cpu_mips_t *cpu,pci_dev_t *dev,int reg, |
typedef void (*pci_reg_write_t)(cpu_gen_t *cpu,pci_dev_t *dev,int reg, |
32 |
m_uint32_t value); |
m_uint32_t value); |
33 |
/* PCI device */ |
/* PCI device */ |
34 |
struct pci_device { |
struct pci_device { |
112 |
int bus,int device,int function); |
int bus,int device,int function); |
113 |
|
|
114 |
/* Handle the address register access */ |
/* Handle the address register access */ |
115 |
void pci_dev_addr_handler(cpu_mips_t *cpu,struct pci_bus *pci_bus, |
void pci_dev_addr_handler(cpu_gen_t *cpu,struct pci_bus *pci_bus, |
116 |
u_int op_type,int swap,m_uint64_t *data); |
u_int op_type,int swap,m_uint64_t *data); |
117 |
|
|
118 |
/* Handle the data register access */ |
/* Handle the data register access */ |
119 |
void pci_dev_data_handler(cpu_mips_t *cpu,struct pci_bus *pci_bus, |
void pci_dev_data_handler(cpu_gen_t *cpu,struct pci_bus *pci_bus, |
120 |
u_int op_type,int swap,m_uint64_t *data); |
u_int op_type,int swap,m_uint64_t *data); |
121 |
|
|
122 |
/* Add a PCI bridge */ |
/* Add a PCI bridge */ |