mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
Kernel: Add a MMIO class for aarch64
It doesn't do anything yet except figure out the peripheral base address. Very likely belongs in Kernel, not Prekernel, eventually.
This commit is contained in:
parent
3a24eb323f
commit
d0b9c7a20b
Notes:
sideshowbarker
2024-07-18 03:40:29 +09:00
Author: https://github.com/nico
Commit: d0b9c7a20b
Pull-request: https://github.com/SerenityOS/serenity/pull/10133
Reviewed-by: https://github.com/linusg
4 changed files with 54 additions and 3 deletions
26
Kernel/Prekernel/Arch/aarch64/MMIO.cpp
Normal file
26
Kernel/Prekernel/Arch/aarch64/MMIO.cpp
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Nico Weber <thakis@chromium.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <Kernel/Prekernel/Arch/aarch64/MMIO.h>
|
||||
#include <Kernel/Prekernel/Arch/aarch64/MainIdRegister.h>
|
||||
|
||||
namespace Prekernel {
|
||||
|
||||
MMIO::MMIO()
|
||||
: m_base_address(0xFE00'0000)
|
||||
{
|
||||
MainIdRegister id;
|
||||
if (id.part_num() <= MainIdRegister::RaspberryPi3)
|
||||
m_base_address = 0x3F00'0000;
|
||||
}
|
||||
|
||||
MMIO& MMIO::the()
|
||||
{
|
||||
static MMIO instance;
|
||||
return instance;
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue