Store a List of discovered PCI devices
This commit is contained in:
parent
757f8f8c65
commit
d86bf47211
@ -10,6 +10,7 @@ import hulk.hurl.a1;
|
|||||||
import hulk.range;
|
import hulk.range;
|
||||||
import hulk.usb.xhci;
|
import hulk.usb.xhci;
|
||||||
import hulk.acpi;
|
import hulk.acpi;
|
||||||
|
import hulk.list;
|
||||||
|
|
||||||
struct Pci
|
struct Pci
|
||||||
{
|
{
|
||||||
@ -196,6 +197,11 @@ struct Pci
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Store a list of discovered PCI devices.
|
||||||
|
*/
|
||||||
|
public static __gshared List!Device devices;
|
||||||
|
|
||||||
private static uint read_config_register(Address address, uint register_id)
|
private static uint read_config_register(Address address, uint register_id)
|
||||||
{
|
{
|
||||||
uint cfg_addr = 0x8000_0000u |
|
uint cfg_addr = 0x8000_0000u |
|
||||||
@ -361,6 +367,7 @@ struct Pci
|
|||||||
if (config.vendor_id != 0xFFFFu)
|
if (config.vendor_id != 0xFFFFu)
|
||||||
{
|
{
|
||||||
Device * device = A1.allocate!Device();
|
Device * device = A1.allocate!Device();
|
||||||
|
devices.add(device);
|
||||||
device.initialize(Address(bus_nr, device_nr, function_nr), config);
|
device.initialize(Address(bus_nr, device_nr, function_nr), config);
|
||||||
if (device.multifunction)
|
if (device.multifunction)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user