kern: Implement most of memory init (all cores hit main, but still more to do)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user