mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-24 00:24:38 +00:00
Kernel/aarch64: Remove specific aarch64 code in BootFramebufferConsole
The MemoryManager now works, so we can use the same code as on x86 to map the framebuffer. Since it uses the MemoryManager, the initialization of the BootFramebufferConsole has to happen after the MemoryManager is working.
This commit is contained in:
committed by
Andreas Kling
parent
57b1369475
commit
15b818cd57
@@ -6,34 +6,19 @@
|
||||
|
||||
#include <Kernel/Graphics/Console/BootFramebufferConsole.h>
|
||||
#include <Kernel/Locking/Spinlock.h>
|
||||
// FIXME: Port MemoryManager to aarch64
|
||||
#if !ARCH(AARCH64)
|
||||
# include <Kernel/Memory/MemoryManager.h>
|
||||
#endif
|
||||
#include <Kernel/Memory/MemoryManager.h>
|
||||
|
||||
namespace Kernel::Graphics {
|
||||
|
||||
// FIXME: Port MemoryManager to aarch64
|
||||
#if ARCH(AARCH64)
|
||||
BootFramebufferConsole::BootFramebufferConsole(u8* framebuffer_addr, size_t width, size_t height, size_t pitch)
|
||||
: GenericFramebufferConsoleImpl(width, height, pitch)
|
||||
, m_framebuffer(framebuffer_addr)
|
||||
#else
|
||||
BootFramebufferConsole::BootFramebufferConsole(PhysicalAddress framebuffer_addr, size_t width, size_t height, size_t pitch)
|
||||
: GenericFramebufferConsoleImpl(width, height, pitch)
|
||||
#endif
|
||||
{
|
||||
// FIXME: Port MemoryManager to aarch64
|
||||
#if ARCH(AARCH64)
|
||||
m_framebuffer_data = framebuffer_addr;
|
||||
#else
|
||||
// NOTE: We're very early in the boot process, memory allocations shouldn't really fail
|
||||
auto framebuffer_end = Memory::page_round_up(framebuffer_addr.offset(height * pitch * sizeof(u32)).get()).release_value();
|
||||
m_framebuffer = MM.allocate_kernel_region(framebuffer_addr.page_base(), framebuffer_end - framebuffer_addr.page_base().get(), "Boot Framebuffer"sv, Memory::Region::Access::ReadWrite).release_value();
|
||||
|
||||
[[maybe_unused]] auto result = m_framebuffer->set_write_combine(true);
|
||||
m_framebuffer_data = m_framebuffer->vaddr().offset(framebuffer_addr.offset_in_page()).as_ptr();
|
||||
#endif
|
||||
memset(m_framebuffer_data, 0, height * pitch * sizeof(u32));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user