From 1f4cc1cf884e0c7befdfea601def2291e54459be Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Wed, 10 May 2023 17:21:14 +0200 Subject: Optimized Exit bridge managment --- src/emu/x64emu.c | 11 ----------- src/emu/x64run_private.h | 7 +++++++ 2 files changed, 7 insertions(+), 11 deletions(-) (limited to 'src/emu') diff --git a/src/emu/x64emu.c b/src/emu/x64emu.c index d48b4912..620bea97 100755 --- a/src/emu/x64emu.c +++ b/src/emu/x64emu.c @@ -58,17 +58,6 @@ uint32_t* GetParityTab() return x86emu_parity_tab; } -void PushExit(x64emu_t* emu) -{ - uintptr_t endMarker = AddCheckBridge(my_context->system, NULL, NULL, 0, "ExitEmulation"); - Push(emu, endMarker); -} - -void* GetExit() -{ - return (void*)AddCheckBridge(my_context->system, NULL, NULL, 0, "ExitEmulation"); -} - static void internalX64Setup(x64emu_t* emu, box64context_t *context, uintptr_t start, uintptr_t stack, int stacksize, int ownstack) { emu->context = context; diff --git a/src/emu/x64run_private.h b/src/emu/x64run_private.h index 68db0670..23750022 100755 --- a/src/emu/x64run_private.h +++ b/src/emu/x64run_private.h @@ -4,6 +4,7 @@ #include #include "regs.h" #include "x64emu_private.h" +#include "box64context.h" typedef struct x64emu_s x64emu_t; typedef union rex_s { @@ -37,6 +38,12 @@ static inline void Push(x64emu_t *emu, uint64_t v) } #endif +static inline void PushExit(x64emu_t* emu) +{ + R_RSP -= 8; + *((uint64_t*)R_RSP) = my_context->exit_bridge; +} + // the op code definition can be found here: http://ref.x86asm.net/geek32.html reg64_t* GetECommon(x64emu_t* emu, uintptr_t* addr, rex_t rex, uint8_t m, uint8_t delta); -- cgit 1.4.1