thermosphere: rewrite debug pause & fix single step state machine

This commit is contained in:
TuxSH
2020-01-16 01:18:34 +00:00
parent 2753b6cf8f
commit 1c707d9ded
13 changed files with 92 additions and 46 deletions

View File

@@ -15,6 +15,7 @@
*/
#pragma once
#include <stdatomic.h>
#include <assert.h>
#include "utils.h"
#include "barrier.h"
@@ -22,7 +23,7 @@
struct ExceptionStackFrame;
typedef struct CoreCtx {
struct ExceptionStackFrame *userFrame; // @0x00
struct ExceptionStackFrame *guestFrame; // @0x00
u64 scratch; // @0x08
u8 *crashStack; // @0x10
u64 kernelArgument; // @0x18
@@ -42,6 +43,9 @@ typedef struct CoreCtx {
Barrier executedFunctionBarrier; // @0x50
bool executedFunctionSync; // @0x54
// Debug features
bool wasPaused; // @0x55
// Cache stuff
u32 setWayCounter; // @0x58
} CoreCtx;
@@ -49,6 +53,7 @@ typedef struct CoreCtx {
static_assert(offsetof(CoreCtx, warmboot) == 0x2E, "Wrong definition for CoreCtx");
static_assert(offsetof(CoreCtx, emulPtimerCval) == 0x38, "Wrong definition for CoreCtx");
static_assert(offsetof(CoreCtx, executedFunctionSync) == 0x54, "Wrong definition for CoreCtx");
static_assert(offsetof(CoreCtx, setWayCounter) == 0x58, "Wrong definition for CoreCtx");
extern CoreCtx g_coreCtxs[4];
register CoreCtx *currentCoreCtx asm("x18");