mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-13 22:54:24 -04:00
kern: Implement most of memory init (all cores hit main, but still more to do)
This commit is contained in:
parent
b2e522c0a0
commit
e7dee2a9fc
22 changed files with 1246 additions and 81 deletions
|
@ -97,8 +97,8 @@ namespace ams::kern::init::loader {
|
|||
/* TODO: Define these bits properly elsewhere, document exactly what each bit set is doing .*/
|
||||
constexpr u64 MairValue = 0x0000000044FF0400ul;
|
||||
constexpr u64 TcrValue = 0x00000011B5193519ul;
|
||||
cpu::SetMairEl1(MairValue);
|
||||
cpu::SetTcrEl1(TcrValue);
|
||||
cpu::MemoryAccessIndirectionRegisterAccessor(MairValue).Store();
|
||||
cpu::TranslationControlRegisterAccessor(TcrValue).Store();
|
||||
|
||||
/* Perform cpu-specific setup. */
|
||||
{
|
||||
|
@ -308,6 +308,10 @@ namespace ams::kern::init::loader {
|
|||
return GetInteger(virtual_base_address) - base_address;
|
||||
}
|
||||
|
||||
KPhysicalAddress AllocateKernelInitStack() {
|
||||
return g_initial_page_allocator.Allocate() + PageSize;
|
||||
}
|
||||
|
||||
uintptr_t GetFinalPageAllocatorState() {
|
||||
return g_initial_page_allocator.GetFinalState();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue