mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-06-06 09:31:16 -04:00
thermosphere: major refactor of memory map
- use recursive stage 1 page table (thanks @fincs for this idea) - NULL now unmapped - no identity mapping - image + GICv2 now mapped at the same address for every platform - tempbss mapped just after "real" bss, can now steal unused mem from the latter - no hardcoded VAs for other MMIO devices - tegra: remove timers, use the generic timer instead
This commit is contained in:
parent
92a291cd41
commit
626f0ecb98
47 changed files with 795 additions and 469 deletions
|
@ -15,13 +15,11 @@
|
|||
*/
|
||||
|
||||
#include "core_ctx.h"
|
||||
#include "utils.h"
|
||||
#include "memory_map.h"
|
||||
|
||||
// start.s
|
||||
extern uintptr_t g_initialKernelEntrypoint;
|
||||
|
||||
extern u8 __stacks_top__[], __crash_stacks_top__[];
|
||||
|
||||
static atomic_uint g_activeCoreMask = 0;
|
||||
|
||||
// Prevents it from being put in BSS
|
||||
|
@ -34,11 +32,11 @@ CoreCtx g_coreCtxs[4] = {
|
|||
|
||||
void coreCtxInit(u32 coreId, bool isBootCore, u64 argument)
|
||||
{
|
||||
size_t crashStackSize = (__crash_stacks_top__ - __stacks_top__) / 4;
|
||||
size_t crashStackSize = 0x1000 / 4;
|
||||
currentCoreCtx = &g_coreCtxs[coreId];
|
||||
currentCoreCtx->isBootCore = isBootCore;
|
||||
currentCoreCtx->kernelArgument = argument;
|
||||
currentCoreCtx->crashStack = __crash_stacks_top__ - crashStackSize * coreId;
|
||||
currentCoreCtx->crashStack = (u8 *)(MEMORY_MAP_VA_CRASH_STACKS_TOP - crashStackSize * coreId);
|
||||
if (isBootCore && currentCoreCtx->kernelEntrypoint == 0) {
|
||||
currentCoreCtx->kernelEntrypoint = g_initialKernelEntrypoint;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue