From 8ed9805d8ec90d16d11a52cc65768526eca62af1 Mon Sep 17 00:00:00 2001 From: Exverge Date: Mon, 6 Jul 2026 15:11:08 -0400 Subject: [PATCH] remove old debugging changes --- src/core/arm/nce/arm_nce.cpp | 6 +++++- src/core/arm/nce/arm_nce.s | 20 ++++++++++---------- src/core/arm/nce/arm_nce_asm_definitions.h | 2 ++ src/core/arm/nce/guest_context.h | 6 ++---- src/core/arm/nce/interpreter_visitor.h | 4 ++-- src/core/hle/kernel/svc/svc_debug_string.cpp | 2 +- 6 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/core/arm/nce/arm_nce.cpp b/src/core/arm/nce/arm_nce.cpp index 1935e90b92..0155471111 100644 --- a/src/core/arm/nce/arm_nce.cpp +++ b/src/core/arm/nce/arm_nce.cpp @@ -16,6 +16,10 @@ #include "core/hle/kernel/k_process.h" +#include +#include +#include + namespace Core { namespace { @@ -368,7 +372,7 @@ void ArmNce::SignalInterrupt(Kernel::KThread* thread) { // The running thread will unlock the thread context. #if defined(__linux__) syscall(SYS_tkill, m_thread_id, BreakFromRunCodeSignal); -#elif defined(TARGET_OS_MAC) && defined(__aarch64__) +#elif defined(__APPLE__) && defined(__aarch64__) asm volatile( "mov x0, %0\n" // m_thread_id "mov x1, %1\n" // BreakFromRunCodeSignal diff --git a/src/core/arm/nce/arm_nce.s b/src/core/arm/nce/arm_nce.s index 2e9af52b52..e43bb84040 100644 --- a/src/core/arm/nce/arm_nce.s +++ b/src/core/arm/nce/arm_nce.s @@ -8,7 +8,7 @@ movk reg, #(((val) >> 0x10) & 0xFFFF), lsl #16 #ifdef __APPLE__ -#define func(name) _##name +#define SYM(name) _##name .macro ASM_FUNCTION_START name @@ -19,7 +19,7 @@ _\name: .endm #else -#define func(name) name +#define SYM(name) name .macro ASM_FUNCTION_START name .section .text.\name, "ax", %progbits @@ -89,7 +89,7 @@ ASM_FUNCTION_START _ZN4Core6ArmNce37ReturnToRunCodeByExceptionLevelChangeEiPv mov x8, #(__NR_tkill) svc #0 #else - mov x16, #328 + mov x16, #(__pthread_pkill) svc #0x80 #endif @@ -104,7 +104,7 @@ ASM_FUNCTION_START _ZN4Core6ArmNce50ReturnToRunCodeByExceptionLevelChangeSignalH /* Call the context restorer with the raw context. */ mov x0, x2 - bl func(_ZN4Core6ArmNce19RestoreGuestContextEPv) + bl SYM(_ZN4Core6ArmNce19RestoreGuestContextEPv) /* Save the old value of tpidr_el0. */ mrs x8, tpidr_el0 @@ -115,7 +115,7 @@ ASM_FUNCTION_START _ZN4Core6ArmNce50ReturnToRunCodeByExceptionLevelChangeSignalH msr tpidr_el0, x0 /* Unlock the context. */ - bl func(_ZN4Core6ArmNce22UnlockThreadParametersEPv) + bl SYM(_ZN4Core6ArmNce22UnlockThreadParametersEPv) /* Returning from here will enter the guest. */ ldp x29, x30, [sp], #0x10 @@ -141,7 +141,7 @@ ASM_FUNCTION_START _ZN4Core6ArmNce29BreakFromRunCodeSignalHandlerEiPvS1_ /* Tail call the restorer. */ mov x1, x2 - b func(_ZN4Core6ArmNce16SaveGuestContextEPNS_12GuestContextEPv) + b SYM(_ZN4Core6ArmNce16SaveGuestContextEPNS_12GuestContextEPv) /* Returning from here will enter host code. */ @@ -163,7 +163,7 @@ ASM_FUNCTION_START _ZN4Core6ArmNce32GuestAlignmentFaultSignalHandlerEiPvS1_ /* Incorrect TLS magic, so this is a host fault. */ /* Tail call the handler. */ - b func(_ZN4Core6ArmNce24HandleHostAlignmentFaultEiPvS1_) + b SYM(_ZN4Core6ArmNce24HandleHostAlignmentFaultEiPvS1_) 1: /* Correct TLS magic, so this is a guest fault. */ @@ -180,7 +180,7 @@ ASM_FUNCTION_START _ZN4Core6ArmNce32GuestAlignmentFaultSignalHandlerEiPvS1_ msr tpidr_el0, x3 /* Call the handler. */ - bl func(_ZN4Core6ArmNce25HandleGuestAlignmentFaultEPNS_12GuestContextEPvS3_) + bl SYM(_ZN4Core6ArmNce25HandleGuestAlignmentFaultEPNS_12GuestContextEPvS3_) /* If the handler returned false, we want to preserve the host tpidr_el0. */ cbz x0, 2f @@ -206,7 +206,7 @@ ASM_FUNCTION_START _ZN4Core6ArmNce29GuestAccessFaultSignalHandlerEiPvS1_ /* Incorrect TLS magic, so this is a host fault. */ /* Tail call the handler. */ - b func(_ZN4Core6ArmNce21HandleHostAccessFaultEiPvS1_) + b SYM(_ZN4Core6ArmNce21HandleHostAccessFaultEiPvS1_) 1: /* Correct TLS magic, so this is a guest fault. */ @@ -223,7 +223,7 @@ ASM_FUNCTION_START _ZN4Core6ArmNce29GuestAccessFaultSignalHandlerEiPvS1_ msr tpidr_el0, x3 /* Call the handler. */ - bl func(_ZN4Core6ArmNce22HandleGuestAccessFaultEPNS_12GuestContextEPvS3_) + bl SYM(_ZN4Core6ArmNce22HandleGuestAccessFaultEPNS_12GuestContextEPvS3_) /* If the handler returned false, we want to preserve the host tpidr_el0. */ cbz x0, 2f diff --git a/src/core/arm/nce/arm_nce_asm_definitions.h b/src/core/arm/nce/arm_nce_asm_definitions.h index a89c40d4ac..c78468b6cc 100644 --- a/src/core/arm/nce/arm_nce_asm_definitions.h +++ b/src/core/arm/nce/arm_nce_asm_definitions.h @@ -16,6 +16,8 @@ #define SIGURG 16 #define SIGSEGV 11 #define SIGBUS 10 + +#define __pthread_pkill 328 #endif #define ReturnToRunCodeByExceptionLevelChangeSignal SIGUSR2 diff --git a/src/core/arm/nce/guest_context.h b/src/core/arm/nce/guest_context.h index 710949f421..59c6f67372 100644 --- a/src/core/arm/nce/guest_context.h +++ b/src/core/arm/nce/guest_context.h @@ -14,9 +14,7 @@ #include "core/arm/nce/arm_nce_asm_definitions.h" #ifdef __linux__ -#include -#include -#include +#include #endif namespace Core { @@ -142,7 +140,7 @@ static_assert(offsetof(HostContext, host_tpidr_el0) == HostContextTpidrEl0); static_assert(offsetof(HostContext, host_saved_regs) == HostContextRegs); static_assert(offsetof(HostContext, host_saved_vregs) == HostContextVregs); -#ifdef TARGET_OS_MAC +#ifdef __APPLE__ // ensure that fp and lr are next to the rest of the x registers so they can be accessed like an array static_assert(offsetof(_STRUCT_ARM_THREAD_STATE64, __sp) - offsetof(_STRUCT_ARM_THREAD_STATE64, __x) == sizeof(u64) * 31); #endif diff --git a/src/core/arm/nce/interpreter_visitor.h b/src/core/arm/nce/interpreter_visitor.h index 5311fca79c..d07cf61ae3 100644 --- a/src/core/arm/nce/interpreter_visitor.h +++ b/src/core/arm/nce/interpreter_visitor.h @@ -18,9 +18,9 @@ #include "core/arm/nce/visitor_base.h" namespace Core { - class KernelContext; +class KernelContext; - namespace Memory { +namespace Memory { class Memory; } diff --git a/src/core/hle/kernel/svc/svc_debug_string.cpp b/src/core/hle/kernel/svc/svc_debug_string.cpp index 9a3636b1ed..c190fa7a3f 100644 --- a/src/core/hle/kernel/svc/svc_debug_string.cpp +++ b/src/core/hle/kernel/svc/svc_debug_string.cpp @@ -50,7 +50,7 @@ Result OutputDebugString(Core::System& system, u64 address, u64 len) { if (flusher_data.msg_buffer.back() == '\n') flusher_data.msg_buffer.pop_back(); - LOG_CRITICAL(Debug_Emulated, "\n{}", flusher_data.msg_buffer); + LOG_INFO(Debug_Emulated, "\n{}", flusher_data.msg_buffer); flusher_data.msg_buffer.clear(); } if (stop_token.stop_requested()) break;