Clean up ApicRegister
This commit is contained in:
parent
95b9e4558a
commit
5231930543
@ -11,20 +11,12 @@ 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
|
||||
{
|
||||
ApicRegister[2] _reserved0;
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user