Map framebuffer with write-combining access mode to speed up physical hardware
This commit is contained in:
parent
26bb071b4d
commit
30aedfc97b
@ -57,6 +57,7 @@ enum ulong XCR0_PKRU = 0x100u;
|
|||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
/** MSR register numbers. @{ */
|
/** MSR register numbers. @{ */
|
||||||
|
enum uint MSR_PAT = 0x277u;
|
||||||
enum uint MSR_EFER = 0xC000_0080u;
|
enum uint MSR_EFER = 0xC000_0080u;
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ struct Hurl
|
|||||||
map_range(HULK_FRAMEBUFFER,
|
map_range(HULK_FRAMEBUFFER,
|
||||||
cast(ulong)header.bootinfo.fb.buffer,
|
cast(ulong)header.bootinfo.fb.buffer,
|
||||||
header.bootinfo.fb.height * header.bootinfo.fb.stride * 4u,
|
header.bootinfo.fb.height * header.bootinfo.fb.stride * 4u,
|
||||||
PT_WRITABLE | PT_NO_EXECUTE);
|
PT_PAT | PT_WRITABLE | PT_NO_EXECUTE);
|
||||||
/* Map framebuffer buffer1. */
|
/* Map framebuffer buffer1. */
|
||||||
map_range(cast(ulong)header.bootinfo.fb_buffer1_phys,
|
map_range(cast(ulong)header.bootinfo.fb_buffer1_phys,
|
||||||
cast(ulong)header.bootinfo.fb_buffer1_phys,
|
cast(ulong)header.bootinfo.fb_buffer1_phys,
|
||||||
@ -197,6 +197,10 @@ struct Hurl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Set PAT4 to indicate Write Combining so we can set the PAT bit in a
|
||||||
|
* page table entry to use Write Combining for that page. */
|
||||||
|
wrmsr(MSR_PAT, (rdmsr(MSR_PAT) & 0xFFFF_FF00_FFFF_FFFFu) | 0x0000_0001_0000_0000u);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Now that we have available physical pages to allocate from, we can
|
* Now that we have available physical pages to allocate from, we can
|
||||||
* build new page tables to replace the bootloader page tables.
|
* build new page tables to replace the bootloader page tables.
|
||||||
|
@ -11,7 +11,8 @@ enum ulong PT_WRITE_THROUGH = 0x8u;
|
|||||||
enum ulong PT_DISABLE_CACHE = 0x10u;
|
enum ulong PT_DISABLE_CACHE = 0x10u;
|
||||||
enum ulong PT_ACCESSED = 0x20u;
|
enum ulong PT_ACCESSED = 0x20u;
|
||||||
enum ulong PT_DIRTY = 0x40u;
|
enum ulong PT_DIRTY = 0x40u;
|
||||||
enum ulong PT_HUGE_PAGE = 0x80u;
|
enum ulong PT_PAT = 0x80u; /* Page table entry bit. */
|
||||||
|
enum ulong PT_HUGE_PAGE = 0x80u; /* Page directory entry bit. */
|
||||||
enum ulong PT_GLOBAL = 0x100u;
|
enum ulong PT_GLOBAL = 0x100u;
|
||||||
enum ulong PT_NO_EXECUTE = 0x8000_0000_0000_0000u;
|
enum ulong PT_NO_EXECUTE = 0x8000_0000_0000_0000u;
|
||||||
/** @} */
|
/** @} */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user