mirror of
https://github.com/Atmosphere-NX/Atmosphere-libs.git
synced 2025-08-06 07:29:33 +02:00
kern: pass kernel base from KernelLdr to Kernel
This commit is contained in:
parent
d7c77f731e
commit
44d728cc1c
@ -32,6 +32,7 @@ namespace ams::kern {
|
|||||||
struct InitialProcessBinaryLayout {
|
struct InitialProcessBinaryLayout {
|
||||||
uintptr_t address;
|
uintptr_t address;
|
||||||
uintptr_t _08;
|
uintptr_t _08;
|
||||||
|
uintptr_t kern_address;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct InitialProcessBinaryLayoutWithSize {
|
struct InitialProcessBinaryLayoutWithSize {
|
||||||
|
@ -53,7 +53,7 @@ namespace ams::kern {
|
|||||||
static size_t GetRealMemorySize();
|
static size_t GetRealMemorySize();
|
||||||
static size_t GetIntendedMemorySize();
|
static size_t GetIntendedMemorySize();
|
||||||
static KPhysicalAddress GetKernelPhysicalBaseAddress(KPhysicalAddress base_address);
|
static KPhysicalAddress GetKernelPhysicalBaseAddress(KPhysicalAddress base_address);
|
||||||
static void GetInitialProcessBinaryLayout(InitialProcessBinaryLayout *out);
|
static void GetInitialProcessBinaryLayout(InitialProcessBinaryLayout *out, KPhysicalAddress kern_base_address);
|
||||||
static bool ShouldIncreaseThreadResourceLimit();
|
static bool ShouldIncreaseThreadResourceLimit();
|
||||||
static void TurnOnCpu(u64 core_id, const ams::kern::init::KInitArguments *args);
|
static void TurnOnCpu(u64 core_id, const ams::kern::init::KInitArguments *args);
|
||||||
static size_t GetApplicationPoolSize();
|
static size_t GetApplicationPoolSize();
|
||||||
|
@ -46,10 +46,11 @@ namespace ams::kern {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void KSystemControlBase::Init::GetInitialProcessBinaryLayout(InitialProcessBinaryLayout *out) {
|
void KSystemControlBase::Init::GetInitialProcessBinaryLayout(InitialProcessBinaryLayout *out, KPhysicalAddress kern_base_address) {
|
||||||
*out = {
|
*out = {
|
||||||
.address = GetInteger(KSystemControl::Init::GetKernelPhysicalBaseAddress(ams::kern::MainMemoryAddress)) + KSystemControl::Init::GetIntendedMemorySize() - InitialProcessBinarySizeMax,
|
.address = GetInteger(KSystemControl::Init::GetKernelPhysicalBaseAddress(ams::kern::MainMemoryAddress)) + KSystemControl::Init::GetIntendedMemorySize() - InitialProcessBinarySizeMax,
|
||||||
._08 = 0,
|
._08 = 0,
|
||||||
|
.kern_address = GetInteger(kern_base_address),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user