list: change locking discipline

Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
Michael Shaw 2026-08-12 14:50:47 -04:00
commit 071a5651e0
Signed by: michaelsshaw
GPG key ID: 5A5E0FB20708A9E7
11 changed files with 61 additions and 15 deletions

View file

@ -2,5 +2,4 @@
obj-y += acpi/
obj-y += pci/
obj-y += term/
obj-m += ahci.o

View file

@ -57,6 +57,8 @@ size_t pci_find_device(u16 major, u16 minor, list_t *out)
{
size_t n = 0;
list_lock(out);
list_item_t *item = pci_devices.head;
while (item) {
@ -69,6 +71,8 @@ size_t pci_find_device(u16 major, u16 minor, list_t *out)
item = item->next;
}
list_unlock(out);
return n;
}
@ -125,7 +129,9 @@ static void host_probe_devices(struct pci_host *host)
if ((bars[2] & 0x6) == 0x4)
pdev->bar2 |= ((u64)bars[3] << 32);
list_lock(&pci_devices);
list_insert(&pci_devices, pdev);
list_unlock(&pci_devices);
if (func == 0) {
uint8_t header = (pci_config_read32(host, bus, dev, 0, 0x0C) >> 16) & 0xFF;
if (!(header & 0x80))