diff --git a/src/hulk/apic.d b/src/hulk/apic.d index e8e6a9f..6ca50cd 100644 --- a/src/hulk/apic.d +++ b/src/hulk/apic.d @@ -11,19 +11,11 @@ struct apic { static struct ApicRegister { - private uint register; + public uint value; + alias value this; + private ubyte[12] _padding; - - public uint read() const - { - return register; - } - - public void write(uint value) - { - register = value; - } - }; + } static struct ApicRegisters { @@ -55,7 +47,7 @@ struct apic ApicRegister current_count; ApicRegister[4] _reserved3; ApicRegister divide_configuration; - }; + } public static void initialize() { @@ -63,7 +55,7 @@ struct apic cast(ApicRegisters *)acpi.apic_address; hurl.map(cast(ulong)apic_registers, cast(ulong)apic_registers, PT_WRITABLE | PT_WRITE_THROUGH | PT_DISABLE_CACHE | PT_NO_EXECUTE); - klog.writefln("LAPIC ID: 0x%08x", apic_registers.lapic_id.read()); - klog.writefln("LAPIC version: 0x%08x", apic_registers.lapic_version.read()); + klog.writefln("LAPIC ID: 0x%08x", apic_registers.lapic_id.value); + klog.writefln("LAPIC version: 0x%08x", apic_registers.lapic_version.value); } }