thermosphere: fix x18 init, etc.

This commit is contained in:
TuxSH 2019-08-01 00:46:16 +02:00
parent 3fa9133814
commit a11b0b6e0e
5 changed files with 35 additions and 26 deletions

View file

@ -16,9 +16,23 @@
#include "core_ctx.h"
// start.s
extern uintptr_t g_initialKernelEntrypoint;
// Prevents it from being put in BSS
CoreCtx g_coreCtxs[4] = {
{ .coreId = 0 },
{ .coreId = 1 },
{ .coreId = 2 },
{ .coreId = 3 },
};
void coreCtxInit(u32 coreId, bool isColdbootCore, u64 argument)
{
currentCoreCtx = &g_coreCtxs[coreId];
currentCoreCtx->isColdbootCore = isColdbootCore;
currentCoreCtx->kernelArgument = argument;
if (isColdbootCore) {
currentCoreCtx->kernelEntrypoint = g_initialKernelEntrypoint;
}
}