about summary refs log tree commit diff stats
path: root/src/libtools
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2025-03-13 18:09:25 +0100
committerptitSeb <sebastien.chev@gmail.com>2025-03-13 18:09:25 +0100
commitea067beac23dd10461dc74d5098c1772d7e74ca5 (patch)
tree23535c651bd2bc81b02fc400f13c43eb0898d422 /src/libtools
parent8905a31469406fee76588ddf36b42bde8358db63 (diff)
downloadbox64-ea067beac23dd10461dc74d5098c1772d7e74ca5.tar.gz
box64-ea067beac23dd10461dc74d5098c1772d7e74ca5.zip
[BOX32] Small changes in Signal32 handling
Diffstat (limited to 'src/libtools')
-rw-r--r--src/libtools/signal32.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libtools/signal32.c b/src/libtools/signal32.c
index bebb4f2e..8a4f103a 100644
--- a/src/libtools/signal32.c
+++ b/src/libtools/signal32.c
@@ -488,7 +488,7 @@ void my_sigactionhandler_oldcode_32(x64emu_t* emu, int32_t sig, int simple, sigi
     if(p) {
         pc = (void*)p->uc_mcontext.pc;
         if(db)
-            frame = (uintptr_t)p->uc_mcontext.regs[10+_SP];
+            frame = from_ptr((ptr_t)p->uc_mcontext.regs[10+_SP]);
     }
 #elif defined(LA64)
     dynablock_t* db = (dynablock_t*)cur_db;//FindDynablockFromNativeAddress(pc);
@@ -497,7 +497,7 @@ void my_sigactionhandler_oldcode_32(x64emu_t* emu, int32_t sig, int simple, sigi
     if(p) {
         pc = (void*)p->uc_mcontext.__pc;
         if(db)
-            frame = (uintptr_t)p->uc_mcontext.__gregs[12+_SP];
+            frame = from_ptr((ptr_t)p->uc_mcontext.__gregs[12+_SP]);
     }
 #elif defined(RV64)
     dynablock_t* db = (dynablock_t*)cur_db;//FindDynablockFromNativeAddress(pc);
@@ -506,7 +506,7 @@ void my_sigactionhandler_oldcode_32(x64emu_t* emu, int32_t sig, int simple, sigi
     if(p) {
         pc = (void*)p->uc_mcontext.__gregs[0];
         if(db)
-            frame = (uintptr_t)p->uc_mcontext.__gregs[9];
+            frame = from_ptr((ptr_t)p->uc_mcontext.__gregs[9]);
     }
 #else
 #error Unsupported architecture
@@ -523,9 +523,9 @@ void my_sigactionhandler_oldcode_32(x64emu_t* emu, int32_t sig, int simple, sigi
     int used_stack = 0;
     if(new_ss) {
         if(new_ss->ss_flags == SS_ONSTACK) { // already using it!
-            frame = ((uintptr_t)emu->regs[_SP].q[0] - 128) & ~0x0f;
+            frame = from_ptr(((ptr_t)emu->regs[_SP].q[0] - 128) & ~0x0f);
         } else {
-            frame = (uintptr_t)(((uintptr_t)new_ss->ss_sp + new_ss->ss_size - 16) & ~0x0f);
+            frame = from_ptr(((uintptr_t)new_ss->ss_sp + new_ss->ss_size - 16) & ~0x0f);
             used_stack = 1;
             new_ss->ss_flags = SS_ONSTACK;
         }