thermosphere: barrier & active core mask

This commit is contained in:
TuxSH
2019-08-12 23:24:30 +02:00
parent c34df08ed9
commit 322d796004
7 changed files with 111 additions and 14 deletions

View File

@@ -15,12 +15,15 @@
*/
#include "core_ctx.h"
#include "utils.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
CoreCtx g_coreCtxs[4] = {
{ .coreId = 0 },
@@ -40,3 +43,13 @@ void coreCtxInit(u32 coreId, bool isBootCore, u64 argument)
currentCoreCtx->kernelEntrypoint = g_initialKernelEntrypoint;
}
}
void setCurrentCoreActive(void)
{
atomic_fetch_or(&g_activeCoreMask, BIT(currentCoreCtx->coreId));
}
u32 getActiveCoreMask(void)
{
return (u32)atomic_load(&g_activeCoreMask);
}