thermosphere: refactor exception handlers & add stolen time/emulated ptimer logic

This commit is contained in:
TuxSH
2020-01-08 22:18:56 +00:00
parent 2f999497df
commit f19c67435a
9 changed files with 151 additions and 118 deletions

View File

@@ -15,6 +15,7 @@
*/
#pragma once
#include <assert.h>
#include "utils.h"
#include "barrier.h"
#include "execute_function.h"
@@ -34,8 +35,14 @@ typedef struct CoreCtx {
void *executedFunctionArgs; // @0x30
Barrier executedFunctionBarrier; // @0x38
bool executedFunctionSync; // @0x3C
// Timer stuff
u64 emulPtimerOffsetThen; // @0x40. When setting cntp_cval_el0 and on interrupt
} CoreCtx;
static_assert(offsetof(CoreCtx, executedFunctionSync) == 0x3C, "Wrong definition for CoreCtx");
static_assert(offsetof(CoreCtx, emulPtimerOffsetThen) == 0x40, "Wrong definition for CoreCtx");
extern CoreCtx g_coreCtxs[4];
register CoreCtx *currentCoreCtx asm("x18");