Compare commits
No commits in common. "d86bf472114914785336e82535be4f6dead019b8" and "1c6c922b4586517a2c616fe637bf0da75a24bc59" have entirely different histories.
d86bf47211
...
1c6c922b45
@ -7,7 +7,6 @@ import hulk.hurl;
|
|||||||
import hulk.hippo;
|
import hulk.hippo;
|
||||||
import hulk.util;
|
import hulk.util;
|
||||||
import hulk.pagetable;
|
import hulk.pagetable;
|
||||||
import hulk.memory;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The A1 memory allocator is a one-shot memory allocator for kernel memory
|
* The A1 memory allocator is a one-shot memory allocator for kernel memory
|
||||||
@ -49,8 +48,6 @@ struct A1
|
|||||||
current_limit += PAGE_SIZE;
|
current_limit += PAGE_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset64(cast(void *)address, 0, size / 8);
|
|
||||||
|
|
||||||
return cast(void *)address;
|
return cast(void *)address;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,64 +0,0 @@
|
|||||||
/**
|
|
||||||
* Linked list functionality.
|
|
||||||
*/
|
|
||||||
module hulk.list;
|
|
||||||
|
|
||||||
import hulk.hurl.a1;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Linked list structure.
|
|
||||||
*/
|
|
||||||
struct List(T)
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Linked list item.
|
|
||||||
*/
|
|
||||||
T * item;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Next list entry.
|
|
||||||
*/
|
|
||||||
List!T * next;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add an item to this linked list.
|
|
||||||
*/
|
|
||||||
public void add(T * item)
|
|
||||||
{
|
|
||||||
List!T * last_entry = last_entry();
|
|
||||||
List!T * new_entry = A1.allocate!(List!T)();
|
|
||||||
last_entry.item = item;
|
|
||||||
last_entry.next = new_entry;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Allow foreach iteration across a List.
|
|
||||||
*/
|
|
||||||
public int opApply(scope int delegate(ref T) dg)
|
|
||||||
{
|
|
||||||
List!T * entry = &this;
|
|
||||||
while (entry.next != null)
|
|
||||||
{
|
|
||||||
int result = dg(*entry.item);
|
|
||||||
if (result != 0)
|
|
||||||
{
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
entry = entry.next;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the last linked list entry.
|
|
||||||
*/
|
|
||||||
private @property List!T * last_entry()
|
|
||||||
{
|
|
||||||
List!T * result = &this;
|
|
||||||
while (result.next != null)
|
|
||||||
{
|
|
||||||
result = result.next;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
@ -10,7 +10,6 @@ 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
|
||||||
{
|
{
|
||||||
@ -197,11 +196,6 @@ 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 |
|
||||||
@ -367,7 +361,6 @@ 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