module and uses an internal PCIlib extracted from Linux 2.4.x.
|
Find PCI Devices (IPC interface) |
Locate PCI devices based on their properties.
We use busno:devfn as PCI device handle.
|
long | l4_io_pci_find_device_component (CORBA_Object _dice_corba_obj, unsigned short vendor_id, unsigned short device_id, l4_io_pdev_t start_at, l4_io_pci_dev_t *pci_dev, CORBA_Server_Environment *_dice_corba_env) |
| Locate PCI device according to vendor and device id.
|
long | l4_io_pci_find_slot_component (CORBA_Object _dice_corba_obj, unsigned long bus, unsigned long slot, l4_io_pci_dev_t *pci_dev, CORBA_Server_Environment *_dice_corba_env) |
| Locate PCI device according to bus and slot info.
|
long | l4_io_pci_find_class_component (CORBA_Object _dice_corba_obj, unsigned long class_id, l4_io_pdev_t start_at, l4_io_pci_dev_t *pci_dev, CORBA_Server_Environment *_dice_corba_env) |
| Locate PCI device according to device class id.
|
Read PCI Configuration Space (IPC interface) |
Read the PCI configuration space portions (byte, word, dword).
|
long | l4_io_pci_read_config_byte_component (CORBA_Object _dice_corba_obj, l4_io_pdev_t pdev, long offset, unsigned char *val, CORBA_Server_Environment *_dice_corba_env) |
| Read one byte of PCI configuration space.
|
long | l4_io_pci_read_config_word_component (CORBA_Object _dice_corba_obj, l4_io_pdev_t pdev, long offset, unsigned short *val, CORBA_Server_Environment *_dice_corba_env) |
| Read one word of PCI configuration space.
|
long | l4_io_pci_read_config_dword_component (CORBA_Object _dice_corba_obj, l4_io_pdev_t pdev, long offset, l4_uint32_t *val, CORBA_Server_Environment *_dice_corba_env) |
| Read one double word of PCI configuration space.
|
Modify PCI Configuration Space (IPC interface) |
Write portions of PCI configuration space (bytes, word, dwords).
- Todo:
- Maybe check for well-known region that should _not_ be altered. Implementation.
|
long | l4_io_pci_write_config_byte_component (CORBA_Object _dice_corba_obj, l4_io_pdev_t pdev, long offset, unsigned char val, CORBA_Server_Environment *_dice_corba_env) |
| Write one byte into PCI configuration space.
|
long | l4_io_pci_write_config_word_component (CORBA_Object _dice_corba_obj, l4_io_pdev_t pdev, long offset, unsigned short val, CORBA_Server_Environment *_dice_corba_env) |
| Write one word into PCI configuration space.
|
long | l4_io_pci_write_config_dword_component (CORBA_Object _dice_corba_obj, l4_io_pdev_t pdev, long offset, unsigned long val, CORBA_Server_Environment *_dice_corba_env) |
| Write one double word into PCI configuration space.
|
PCI Device Initialization (IPC interface) |
Activation, Busmastering and Power Management (PM).
|
long | l4_io_pci_enable_device_component (CORBA_Object _dice_corba_obj, l4_io_pdev_t pdev, CORBA_Server_Environment *_dice_corba_env) |
| Initialize device before it's used by a driver.
|
long | l4_io_pci_disable_device_component (CORBA_Object _dice_corba_obj, l4_io_pdev_t pdev, CORBA_Server_Environment *_dice_corba_env) |
| Finalize device after use.
|
long | l4_io_pci_set_master_component (CORBA_Object _dice_corba_obj, l4_io_pdev_t pdev, CORBA_Server_Environment *_dice_corba_env) |
| Enable Busmastering for PCI device.
|
long | l4_io_pci_set_power_state_component (CORBA_Object _dice_corba_obj, l4_io_pdev_t pdev, int *state, CORBA_Server_Environment *_dice_corba_env) |
| Set power management state for PCI device.
|
Resource Management Glue for PCIlib |
Linux' PCI subsystem _expects_ the new, hierarchical resource management system.
So it has to be mapped to io's flat allocation scheme:
- callback requests/releases only for IORESOURCE_BUSY regions
- announce top-level I/O memory regions (I/O has to initiate mappings from sigma0 or whomsoever)
Shame: Almost all of this is from Linux 2.4.x.
- Test:
- krishna: central root resources are essential - io{port,mem}_resource
- Test:
- krishna: no resources can be released (this only means no HOTPLUGGING is supported)
|
static struct resource * | __request_resource (struct resource *root, struct resource *new) |
| Generic resource requests.
|
struct resource * | __request_region (struct resource *parent, unsigned long start, unsigned long n, const char *name) |
| Generic region requests.
|
static int | __find_resource (struct resource *root, struct resource *new, unsigned long size, unsigned long min, unsigned long max, unsigned long align, void(*alignf)(void *, struct resource *, unsigned long, unsigned long), void *alignf_data) |
| Generic Find empty slot in the resource tree given range and alignment.
|
int | request_resource (struct resource *root, struct resource *new) |
| Linux resource requests.
|
int | allocate_resource (struct resource *root, struct resource *new, unsigned long size, unsigned long min, unsigned long max, unsigned long align, void(*alignf)(void *, struct resource *, unsigned long, unsigned long), void *alignf_data) |
| Linux resource allocation.
|
Interrupt Line Request Glue for PCIlib |
Mapping of PCIlib interrupt allocation.
|
int | request_irq (unsigned int irq, void(*handler)(int, void *, struct pt_regs *), unsigned long flags, const char *name, void *id) |
| Request interrupt.
|
void | free_irq (unsigned int irq, void *id) |
| Free Interrupt.
|
Memory Management Glue for PCIlib |
void * | kmalloc (size_t size, int gfp) |
| Well known kmalloc.
|
void | kfree (const void *obj) |
| Well known kfree.
|
unsigned long | FASTCALL (__get_free_pages(unsigned int gfp, unsigned int order)) |
| Well known __get_free_pages.
|
void | FASTCALL (free_pages(unsigned long addr, unsigned int order)) |
| Well known free_pages.
|
PCIlib interface |
- Todo:
- /proc fs has to be optional
|
int | PCI_init (int list) |
| PCIlib initialization.
|
unsigned short | PCI_linux_to_io (void *linux_pdev, void *l4io_pdev) |
| Info Type Conversion.
|
Functions |
int | io_pci_init (int list) |
| PCI module initialization.
|
module and uses an internal PCIlib extracted from Linux 2.4.x.
For now I don't know where to draw the red line in the PCI subsystem. Linux drivers make instant use of PCI specific macros/functions. I think many of the structs has to be kept in io and the driver server... we'll see.