diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2023-05-10 17:21:14 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2023-05-10 17:21:14 +0200 |
| commit | 1f4cc1cf884e0c7befdfea601def2291e54459be (patch) | |
| tree | 53f57aeff400515e4a025725d3cd6bde22db0dd2 /src/emu | |
| parent | 92dd53177f0119c0638c057ea7da5204046846d0 (diff) | |
| download | box64-1f4cc1cf884e0c7befdfea601def2291e54459be.tar.gz box64-1f4cc1cf884e0c7befdfea601def2291e54459be.zip | |
Optimized Exit bridge managment
Diffstat (limited to 'src/emu')
| -rwxr-xr-x | src/emu/x64emu.c | 11 | ||||
| -rwxr-xr-x | src/emu/x64run_private.h | 7 |
2 files changed, 7 insertions, 11 deletions
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 <stdint.h> #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); |