mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
Move PCI database part from pci.c to its own file pci_database.c
(Laurent Vivier) git-svn-id: svn://coreboot.org/openbios/openbios-devel@334 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
<library name="drivers" type="static" target="target">
|
<library name="drivers" type="static" target="target">
|
||||||
<object source="pci.c" condition="DRIVER_PCI"/>
|
<object source="pci.c" condition="DRIVER_PCI"/>
|
||||||
|
<object source="pci_database.c" condition="DRIVER_PCI"/>
|
||||||
<object source="ide.c" condition="DRIVER_IDE"/>
|
<object source="ide.c" condition="DRIVER_IDE"/>
|
||||||
<object source="timer.c" condition="DRIVER_IDE"/>
|
<object source="timer.c" condition="DRIVER_IDE"/>
|
||||||
<object source="kbd.c" condition="DRIVER_ADB"/>
|
<object source="kbd.c" condition="DRIVER_ADB"/>
|
||||||
|
|||||||
1150
drivers/pci.c
1150
drivers/pci.c
File diff suppressed because it is too large
Load Diff
1063
drivers/pci_database.c
Normal file
1063
drivers/pci_database.c
Normal file
File diff suppressed because it is too large
Load Diff
43
drivers/pci_database.h
Normal file
43
drivers/pci_database.h
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
typedef struct pci_config_t pci_config_t;
|
||||||
|
|
||||||
|
struct pci_config_t {
|
||||||
|
char path[256];
|
||||||
|
uint32_t regions[7];
|
||||||
|
uint32_t sizes[7];
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct pci_dev_t pci_dev_t;
|
||||||
|
struct pci_dev_t {
|
||||||
|
uint16_t vendor;
|
||||||
|
uint16_t product;
|
||||||
|
const char *type;
|
||||||
|
const char *name;
|
||||||
|
const char *model;
|
||||||
|
const char *compat;
|
||||||
|
int acells;
|
||||||
|
int scells;
|
||||||
|
int icells;
|
||||||
|
int (*config_cb)(const pci_config_t *config);
|
||||||
|
const void *private;
|
||||||
|
};
|
||||||
|
|
||||||
|
extern int ide_config_cb2(const pci_config_t *config);
|
||||||
|
extern int eth_config_cb(const pci_config_t *config);
|
||||||
|
extern int macio_config_cb(const pci_config_t *config);
|
||||||
|
extern int vga_config_cb(const pci_config_t *config);
|
||||||
|
|
||||||
|
static inline int pci_compat_len(pci_dev_t *dev)
|
||||||
|
{
|
||||||
|
int len, ret;
|
||||||
|
const char *path = dev->compat;
|
||||||
|
ret = 0;
|
||||||
|
while ((len = strlen(path)) != 0) {
|
||||||
|
ret += len + 1;
|
||||||
|
path += len + 1;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern const pci_dev_t *pci_find_device(uint8_t class, uint8_t subclass,
|
||||||
|
uint8_t iface, uint16_t vendor,
|
||||||
|
uint16_t product);
|
||||||
Reference in New Issue
Block a user