diff options
author | Eric Biederman <ebiederm@xmission.com> | 2003-06-12 19:23:51 +0000 |
---|---|---|
committer | Eric Biederman <ebiederm@xmission.com> | 2003-06-12 19:23:51 +0000 |
commit | 7a5416af9574095c6df28fb8192fe4c063afa8da (patch) | |
tree | 66cc3bb27f8319255ebab48ba774d584693d4c22 /src/include/device | |
parent | 540ae01cd341de75f5eb57906699ca24667d71cc (diff) | |
download | coreboot-7a5416af9574095c6df28fb8192fe4c063afa8da.tar.xz |
- Modify the freebios tree so the pci config space api is mostly in sync between
code that runs without ram and code that runs with ram.
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@869 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/include/device')
-rw-r--r-- | src/include/device/device.h | 30 | ||||
-rw-r--r-- | src/include/device/pci_ops.h | 17 |
2 files changed, 25 insertions, 22 deletions
diff --git a/src/include/device/device.h b/src/include/device/device.h index e8bcfe512f..def9f539ab 100644 --- a/src/include/device/device.h +++ b/src/include/device/device.h @@ -4,11 +4,13 @@ #include <device/resource.h> struct device; +typedef struct device * device_t; + struct device_operations { - void (*read_resources)(struct device *dev); - void (*set_resources)(struct device *dev); - void (*init)(struct device *dev); - unsigned int (*scan_bus)(struct device *bus, unsigned int max); + void (*read_resources)(device_t dev); + void (*set_resources)(device_t dev); + void (*init)(device_t dev); + unsigned int (*scan_bus)(device_t bus, unsigned int max); }; @@ -19,10 +21,10 @@ struct device_operations { */ struct device { - struct device *bus; /* bus this device is on */ - struct device *children; /* devices behind this bridge */ - struct device *sibling; /* next device on this bus */ - struct device *next; /* chain of all devices */ + device_t bus; /* bus this device is on */ + device_t children; /* devices behind this bridge */ + device_t sibling; /* next device on this bus */ + device_t next; /* chain of all devices */ unsigned int devfn; /* encoded device & function index */ unsigned short vendor; @@ -68,18 +70,18 @@ extern void dev_enable(void); extern void dev_initialize(void); /* Generic device helper functions */ -void append_device(struct device *dev); -void compute_allocate_resource(struct device *bus, struct resource *bridge, +void append_device(device_t dev); +void compute_allocate_resource(device_t bus, struct resource *bridge, unsigned long type_mask, unsigned long type); -void assign_resources(struct device *bus); +void assign_resources(device_t bus); void enumerate_static_device(void); unsigned long device_memory_base; /* Helper functions */ -struct device *dev_find_device (unsigned int vendor, unsigned int device, struct device *from); -struct device *dev_find_class (unsigned int class, struct device *from); -struct device *dev_find_slot (unsigned int bus, unsigned int devfn); +device_t dev_find_device (unsigned int vendor, unsigned int device, device_t from); +device_t dev_find_class (unsigned int class, device_t from); +device_t dev_find_slot (unsigned int bus, unsigned int devfn); /* Rounding for boundaries. * Due to some chip bugs, go ahead and roung IO to 16 diff --git a/src/include/device/pci_ops.h b/src/include/device/pci_ops.h index a789b23cd8..7f897370ec 100644 --- a/src/include/device/pci_ops.h +++ b/src/include/device/pci_ops.h @@ -2,14 +2,15 @@ #define PCI_OPS_H #include <stdint.h> -struct device; - -int pci_read_config_byte(struct device *dev, uint8_t where, uint8_t *val); -int pci_read_config_word(struct device *dev, uint8_t where, uint16_t *val); -int pci_read_config_dword(struct device *dev, uint8_t where, uint32_t *val); -int pci_write_config_byte(struct device *dev, uint8_t where, uint8_t val); -int pci_write_config_word(struct device *dev, uint8_t where, uint16_t val); -int pci_write_config_dword(struct device *dev, uint8_t where, uint32_t val); +#include <device/device.h> + +uint8_t pci_read_config8(device_t dev, unsigned where); +uint16_t pci_read_config16(device_t dev, unsigned where); +uint32_t pci_read_config32(device_t dev, unsigned where); +void pci_write_config8(device_t dev, unsigned where, uint8_t val); +void pci_write_config16(device_t dev, unsigned where, uint16_t val); +void pci_write_config32(device_t dev, unsigned where, uint32_t val); + void pci_set_method(void); #endif /* PCI_OPS_H */ |