From d86bf472114914785336e82535be4f6dead019b8 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Tue, 24 Oct 2023 08:49:11 -0400 Subject: [PATCH] Store a List of discovered PCI devices --- src/hulk/pci.d | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/hulk/pci.d b/src/hulk/pci.d index 2c7cb14..141661d 100644 --- a/src/hulk/pci.d +++ b/src/hulk/pci.d @@ -10,6 +10,7 @@ import hulk.hurl.a1; import hulk.range; import hulk.usb.xhci; import hulk.acpi; +import hulk.list; 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) { uint cfg_addr = 0x8000_0000u | @@ -361,6 +367,7 @@ struct Pci if (config.vendor_id != 0xFFFFu) { Device * device = A1.allocate!Device(); + devices.add(device); device.initialize(Address(bus_nr, device_nr, function_nr), config); if (device.multifunction) {