Compare commits

..

No commits in common. "9504a2adab92f5acdb08252ad02610b1d73f144b" and "2a832bfb8b3636fd90c331836e5f990ff5ca4b35" have entirely different histories.

2 changed files with 7 additions and 15 deletions

View File

@ -28,8 +28,8 @@ struct Acpi
static struct Xsdt
{
XsdtHeader header;
/* Table pointers are not ulong-aligned! They begin at offset 36. */
align(4) ulong[1] tables;
uint _pad;
ulong[0] tables;
}
static struct MadtHeader
@ -73,16 +73,16 @@ struct Acpi
ulong address = xsdt.tables[i];
Hurl.identity_map_range(address, 4u, 0u);
uint signature = *cast(const(uint) *)address;
if (signature == APIC_SIGNATURE)
{
parse_apic_table(address);
}
Klog.writefln("Found ACPI table %08x (%c%c%c%c)",
signature,
signature & 0xFFu,
(signature >> 8u) & 0xFFu,
(signature >> 16u) & 0xFFu,
(signature >> 24u) & 0xFFu);
if (signature == APIC_SIGNATURE)
{
parse_apic_table(address);
}
}
}
@ -100,8 +100,8 @@ struct Acpi
if (madt_entry.type == 5u)
{
/* Found a 64-bit Local APIC Address Override entry. */
Klog.writefln("Found 64-bit APIC address: 0x%x", apic_address);
memcpy(cast(void *)&apic_address, cast(const(void) *)madt_entry + 4u, 8u);
Klog.writefln("Found 64-bit APIC address: 0x%x", apic_address);
}
}
}

View File

@ -183,11 +183,3 @@ struct PageTable
}
}
static assert(PageTable.sizeof == 4096u);
/**
* Get the base address of the page containing the given address.
*/
T page_address(T)(T address)
{
return cast(T)(cast(ulong)address & ~(PAGE_SIZE - 1u));
}