2003-09-29 23:09:32 +04:00
|
|
|
#include <KernelExport.h>
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2003-09-17 05:00:14 +04:00
|
|
|
|
2003-09-17 19:54:35 +04:00
|
|
|
status_t pci_config_init(void);
|
|
|
|
uint32 pci_read_config(uint8 bus, uint8 device, uint8 function, uint8 offset, uint8 size);
|
|
|
|
void pci_write_config(uint8 bus, uint8 device, uint8 function, uint8 offset, uint8 size, uint32 value);
|
|
|
|
void * pci_ram_address(const void *physical_address_in_system_memory);
|
|
|
|
|
|
|
|
status_t pci_io_init(void);
|
|
|
|
uint8 pci_read_io_8(int mapped_io_addr);
|
|
|
|
void pci_write_io_8(int mapped_io_addr, uint8 value);
|
|
|
|
uint16 pci_read_io_16(int mapped_io_addr);
|
|
|
|
void pci_write_io_16(int mapped_io_addr, uint16 value);
|
|
|
|
uint32 pci_read_io_32(int mapped_io_addr);
|
|
|
|
void pci_write_io_32(int mapped_io_addr, uint32 value);
|
|
|
|
|
|
|
|
status_t pci_irq_init(void);
|
2003-09-29 23:09:32 +04:00
|
|
|
uint8 pci_read_irq(uint8 bus, uint8 device, uint8 function, uint8 pin);
|
|
|
|
void pci_write_irq(uint8 bus, uint8 device, uint8 function, uint8 pin, uint8 irq);
|
2003-09-17 19:54:35 +04:00
|
|
|
|
2003-09-29 23:09:32 +04:00
|
|
|
extern spinlock gConfigLock;
|
2003-09-17 19:54:35 +04:00
|
|
|
extern int gMaxBusDevices;
|
|
|
|
extern bool gIrqRouterAvailable;
|
2003-09-18 00:44:10 +04:00
|
|
|
|
2003-09-29 23:09:32 +04:00
|
|
|
#define PCI_LOCK_CONFIG(cpu_status) \
|
2003-09-18 00:44:10 +04:00
|
|
|
{ \
|
2003-09-29 23:09:32 +04:00
|
|
|
cpu_status = disable_interrupts(); \
|
2003-09-18 00:44:10 +04:00
|
|
|
acquire_spinlock(&gConfigLock); \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define PCI_UNLOCK_CONFIG(cpu_status) \
|
|
|
|
{ \
|
|
|
|
release_spinlock(&gConfigLock); \
|
|
|
|
restore_interrupts(cpu_status); \
|
|
|
|
}
|
2003-09-29 23:09:32 +04:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|