WKern
|
Go to the source code of this file.
Macros | |
#define | PCI_CONFIG_ADDRESS 0xCF8 |
#define | PCI_CONFIG_DATA 0xCFC |
#define | VIRTIO_REG(offset) |
Functions | |
u32 | PciConfigRead (u8 bus, u8 slot, u8 func, u8 offset) |
Reads a 32-bit value from PCI configuration space. | |
u32 | FindVirtionetDev () |
Search for VirtNet Device. |
Variables | |
u8 | virtio_irq = 0 |
u8 | virtio_bus = 0 |
u8 | virtio_slot = 0 |
u8 | virtio_func = 0 |
u32 | bar0 = 0 |
#define PCI_CONFIG_ADDRESS 0xCF8 |
Definition at line 18 of file scconfig.c.
#define PCI_CONFIG_DATA 0xCFC |
Definition at line 19 of file scconfig.c.
#define VIRTIO_REG | ( | offset | ) |
Definition at line 20 of file scconfig.c.
u32 FindVirtionetDev | ( | ) |
Reads a 32-bit value from PCI configuration space.
This function constructs a configuration address based on the given PCI bus, slot (device), function, and offset, and reads the corresponding 32-bit value from the PCI configuration space using I/O ports.
The offset must be aligned to a 4-byte boundary (i.e., bits 1 and 0 are masked out).
bus | PCI bus number (0–255). |
slot | PCI device number (0–31). |
func | PCI function number (0–7). |
offset | Offset into the configuration space (must be 4-byte aligned). |
Definition at line 48 of file scconfig.c.
u32 bar0 = 0 |
Definition at line 30 of file scconfig.c.
u8 virtio_bus = 0 |
Definition at line 26 of file scconfig.c.
u8 virtio_func = 0 |
Definition at line 28 of file scconfig.c.
u8 virtio_irq = 0 |
Definition at line 25 of file scconfig.c.
u8 virtio_slot = 0 |
Definition at line 27 of file scconfig.c.