list: change locking discipline
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
parent
2cf76fd225
commit
071a5651e0
11 changed files with 61 additions and 15 deletions
|
|
@ -2,5 +2,4 @@
|
|||
obj-y += acpi/
|
||||
obj-y += pci/
|
||||
obj-y += term/
|
||||
|
||||
obj-m += ahci.o
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Reference in a new issue