From 3d0f97bda3dc7eef86c9f0c8100cee7a9a288da3 Mon Sep 17 00:00:00 2001 From: MasaGratoR Date: Sun, 28 Dec 2025 17:26:01 +0100 Subject: [PATCH 01/16] Update svcGetDebugEvent informations --- nx/include/switch/kernel/svc.h | 140 ++++++++++++++++++++++++++++++++- 1 file changed, 139 insertions(+), 1 deletion(-) diff --git a/nx/include/switch/kernel/svc.h b/nx/include/switch/kernel/svc.h index 3009fe5f1..8aa8b1d42 100644 --- a/nx/include/switch/kernel/svc.h +++ b/nx/include/switch/kernel/svc.h @@ -290,6 +290,144 @@ typedef enum { IoPoolType_PcieA2 = 0, ///< Physical address range 0x12000000-0x1FFFFFFF } IoPoolType; +typedef enum { + DebugEvent_CreateProcess = 0, + DebugEvent_CreateThread = 1, + DebugEvent_ExitProcess = 2, + DebugEvent_ExitThread = 3, + DebugEvent_Exception = 4, +} DebugEvent; + +typedef enum { + ProcessExitReason_ExitProcess = 0, + ProcessExitReason_TerminateProcess = 1, + ProcessExitReason_Exception = 2, +} ProcessExitReason; + +typedef enum { + ThreadExitReason_ExitThread = 0, + ThreadExitReason_TerminateThread = 1, + ThreadExitReason_ExitProcess = 2, + ThreadExitReason_TerminateProcess = 3, +} ThreadExitReason; + +typedef enum { + DebugException_UndefinedInstruction = 0, + DebugException_InstructionAbort = 1, + DebugException_DataAbort = 2, + DebugException_AlignmentFault = 3, + DebugException_DebuggerAttached = 4, + DebugException_BreakPoint = 5, + DebugException_UserBreak = 6, + DebugException_DebuggerBreak = 7, + DebugException_UndefinedSystemCall = 8, + DebugException_MemorySystemError = 9, +} DebugException; + +typedef enum { + BreakPointType_HardwareInstruction = 0, + BreakPointType_HardwareData = 1, +} BreakPointType; + +typedef enum { + DebugEventFlag_Stopped = 1, +} DebugEventFlag; + +typedef enum { + CreateProcessFlagAddressSpace_32bit = 0, + CreateProcessFlagAddressSpace_64bitDeprecated = 1, + CreateProcessFlagAddressSpace_32bitWithoutAlias = 2, + CreateProcessFlagAddressSpace_64bit = 3, +} CreateProcessFlagAddressSpace; + +typedef enum { + CreateProcessFlagPoolPartition_Application = 0, + CreateProcessFlagPoolPartition_Applet = 1, + CreateProcessFlagPoolPartition_System = 2, + CreateProcessFlagPoolPartition_SystemUnsafe = 3, +} CreateProcessFlagPoolPartition; + +typedef struct { + u32 type; ///< \ref DebugEvent + u32 flags; ///< \ref DebugEventFlag + u64 thread_id; + + union { + struct { + u64 program_id; + u64 process_id; + char name[0xC]; + struct { + u32 is_64bit: 1; + u32 address_space: 3; ///< \ref CreateProcessFlagAddressSpace + u32 enable_debug: 1; + u32 enable_aslr: 1; + u32 is_application: 1; + u32 use_secure_memory: 1; ///< [1.0.0-3.0.2] + u32 pool_partition: 4; ///< [5.0.0+] \ref CreateProcessFlagPoolPartition + u32 optimize_memory_allocation: 1; ///< [7.0.0+] + u32 disable_device_address_space_merge: 1; ///< [11.0.0+] + u32 enable_alias_region_extra_size: 1; ///< [18.0.0+] + u32 reserved: 17; + } flags; + void* user_exception_context_address; ///< [5.0.0+] + } create_process; ///< DebugEvent_CreateProcess + + struct { + u64 thread_id; + void* tls_address; + void* entrypoint; ///< [1.0.0-10.2.0] + } create_thread; ///< DebugEvent_CreateThread + + struct { + u32 reason; ///< \ref ProcessExitReason + } exit_process; ///< DebugEvent_ExitProcess + + struct { + u32 reason; ///< \ref ThreadExitReason + } exit_thread; ///< DebugEvent_ExitThread + + struct { + u32 type; ///< \ref DebugException + void* address; + union { + struct { + u32 insn; + } undefined_instruction; ///< DebugException_UndefinedInstruction + + struct { + void* address; + } data_abort; ///< DebugException_DataAbort + + struct { + void* address; + } alignment_fault; ///< DebugException_AlignmentFault + + struct { + u32 type; ///< \ref BreakPointType + void* address; + } break_point; ///< \ref DebugException_BreakPoint + + struct { + u32 break_reason; ///< \ref BreakReason + void* address; + size_t size; + } user_break; ///< \ref DebugException_UserBreak + + struct { + u64 active_thread_ids[4]; + } debugger_break; ///< DebugException_DebuggerBreak + + struct { + u32 id; + } undefined_system_call; ///< DebugException_UndefinedSystemCall + + u64 raw; + } specific; + } exception; ///< DebugEvent_Exception + } info; +} DebugEventInfo; + ///@name Memory management ///@{ @@ -1265,7 +1403,7 @@ Result svcTerminateDebugProcess(Handle debug); * @note Syscall number 0x63. * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available. */ -Result svcGetDebugEvent(void* event_out, Handle debug); +Result svcGetDebugEvent(DebugEventInfo* event_out, Handle debug); /** * @brief Continues a debugging session. From 246cb81d6832d200e38e9021105baf5a183aeaac Mon Sep 17 00:00:00 2001 From: MasaGratoR Date: Sun, 28 Dec 2025 17:32:52 +0100 Subject: [PATCH 02/16] Fix --- nx/include/switch/kernel/svc.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nx/include/switch/kernel/svc.h b/nx/include/switch/kernel/svc.h index 8aa8b1d42..f941492f1 100644 --- a/nx/include/switch/kernel/svc.h +++ b/nx/include/switch/kernel/svc.h @@ -290,6 +290,7 @@ typedef enum { IoPoolType_PcieA2 = 0, ///< Physical address range 0x12000000-0x1FFFFFFF } IoPoolType; +/// DebugEvent types typedef enum { DebugEvent_CreateProcess = 0, DebugEvent_CreateThread = 1, @@ -298,12 +299,14 @@ typedef enum { DebugEvent_Exception = 4, } DebugEvent; +/// Process exit reasons typedef enum { ProcessExitReason_ExitProcess = 0, ProcessExitReason_TerminateProcess = 1, ProcessExitReason_Exception = 2, } ProcessExitReason; +/// Thread exit reasons typedef enum { ThreadExitReason_ExitThread = 0, ThreadExitReason_TerminateThread = 1, @@ -311,6 +314,7 @@ typedef enum { ThreadExitReason_TerminateProcess = 3, } ThreadExitReason; +/// typedef enum { DebugException_UndefinedInstruction = 0, DebugException_InstructionAbort = 1, @@ -321,7 +325,7 @@ typedef enum { DebugException_UserBreak = 6, DebugException_DebuggerBreak = 7, DebugException_UndefinedSystemCall = 8, - DebugException_MemorySystemError = 9, + DebugException_MemorySystemError = 9, ///< [2.0.0+] } DebugException; typedef enum { From 864c81d15270ab1ad8306fdddc093625ecc20367 Mon Sep 17 00:00:00 2001 From: MasaGratoR Date: Sun, 28 Dec 2025 17:42:01 +0100 Subject: [PATCH 03/16] Fixes --- nx/include/switch/kernel/svc.h | 42 ++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/nx/include/switch/kernel/svc.h b/nx/include/switch/kernel/svc.h index f941492f1..bec9f1c6f 100644 --- a/nx/include/switch/kernel/svc.h +++ b/nx/include/switch/kernel/svc.h @@ -314,7 +314,7 @@ typedef enum { ThreadExitReason_TerminateProcess = 3, } ThreadExitReason; -/// +/// Debug exception types typedef enum { DebugException_UndefinedInstruction = 0, DebugException_InstructionAbort = 1, @@ -328,15 +328,18 @@ typedef enum { DebugException_MemorySystemError = 9, ///< [2.0.0+] } DebugException; +/// Break point types typedef enum { BreakPointType_HardwareInstruction = 0, BreakPointType_HardwareData = 1, } BreakPointType; +/// DebugEvent flags typedef enum { DebugEventFlag_Stopped = 1, } DebugEventFlag; +/// Address space types for CreateProcessFlags typedef enum { CreateProcessFlagAddressSpace_32bit = 0, CreateProcessFlagAddressSpace_64bitDeprecated = 1, @@ -344,12 +347,23 @@ typedef enum { CreateProcessFlagAddressSpace_64bit = 3, } CreateProcessFlagAddressSpace; -typedef enum { - CreateProcessFlagPoolPartition_Application = 0, - CreateProcessFlagPoolPartition_Applet = 1, - CreateProcessFlagPoolPartition_System = 2, - CreateProcessFlagPoolPartition_SystemUnsafe = 3, -} CreateProcessFlagPoolPartition; +/// Flags for svcCreateProcess and CreateProcess event +typedef union { + struct { + u32 is_64bit: 1; + u32 address_space: 3; ///< \ref CreateProcessFlagAddressSpace + u32 enable_debug: 1; ///< [2.0.0+] + u32 enable_aslr: 1; + u32 is_application: 1; + u32 use_secure_memory: 1; ///< [1.0.0-3.0.2] + u32 pool_partition: 4; ///< [5.0.0+] \ref PhysicalMemorySystemInfo + u32 optimize_memory_allocation: 1; ///< [7.0.0+] Only allowed in combination with is_application + u32 disable_device_address_space_merge: 1; ///< [11.0.0+] + u32 enable_alias_region_extra_size: 1; ///< [18.0.0+] + u32 reserved: 17; + } flags; + u32 raw; +} CreateProcessFlags; typedef struct { u32 type; ///< \ref DebugEvent @@ -361,19 +375,7 @@ typedef struct { u64 program_id; u64 process_id; char name[0xC]; - struct { - u32 is_64bit: 1; - u32 address_space: 3; ///< \ref CreateProcessFlagAddressSpace - u32 enable_debug: 1; - u32 enable_aslr: 1; - u32 is_application: 1; - u32 use_secure_memory: 1; ///< [1.0.0-3.0.2] - u32 pool_partition: 4; ///< [5.0.0+] \ref CreateProcessFlagPoolPartition - u32 optimize_memory_allocation: 1; ///< [7.0.0+] - u32 disable_device_address_space_merge: 1; ///< [11.0.0+] - u32 enable_alias_region_extra_size: 1; ///< [18.0.0+] - u32 reserved: 17; - } flags; + u32 flags; ///< \ref CreateProcessFlags void* user_exception_context_address; ///< [5.0.0+] } create_process; ///< DebugEvent_CreateProcess From 1b4114ee1ce65f4995da85f4a2847c3e1ea0ef97 Mon Sep 17 00:00:00 2001 From: MasaGratoR Date: Sun, 28 Dec 2025 17:51:26 +0100 Subject: [PATCH 04/16] Fixes --- nx/include/switch/kernel/svc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx/include/switch/kernel/svc.h b/nx/include/switch/kernel/svc.h index bec9f1c6f..17875d50b 100644 --- a/nx/include/switch/kernel/svc.h +++ b/nx/include/switch/kernel/svc.h @@ -336,7 +336,7 @@ typedef enum { /// DebugEvent flags typedef enum { - DebugEventFlag_Stopped = 1, + DebugEventFlag_Stopped = BIT(1), } DebugEventFlag; /// Address space types for CreateProcessFlags From 05477ded7abbf3adfddec9edb19ccc35d01a8f40 Mon Sep 17 00:00:00 2001 From: MasaGratoR Date: Sun, 28 Dec 2025 17:56:34 +0100 Subject: [PATCH 05/16] Fix --- nx/include/switch/kernel/svc.h | 1 + 1 file changed, 1 insertion(+) diff --git a/nx/include/switch/kernel/svc.h b/nx/include/switch/kernel/svc.h index 17875d50b..047f96c19 100644 --- a/nx/include/switch/kernel/svc.h +++ b/nx/include/switch/kernel/svc.h @@ -365,6 +365,7 @@ typedef union { u32 raw; } CreateProcessFlags; +/// DebugEventInfo structure typedef struct { u32 type; ///< \ref DebugEvent u32 flags; ///< \ref DebugEventFlag From eabf63b9bc92dfe4ba5b2d19b6e65c3dce6ef957 Mon Sep 17 00:00:00 2001 From: MasaGratoR Date: Sun, 28 Dec 2025 18:01:38 +0100 Subject: [PATCH 06/16] Fixes --- nx/include/switch/kernel/svc.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/nx/include/switch/kernel/svc.h b/nx/include/switch/kernel/svc.h index 047f96c19..b434405d8 100644 --- a/nx/include/switch/kernel/svc.h +++ b/nx/include/switch/kernel/svc.h @@ -372,28 +372,33 @@ typedef struct { u64 thread_id; union { + /// DebugEvent_CreateProcess struct { u64 program_id; u64 process_id; char name[0xC]; u32 flags; ///< \ref CreateProcessFlags void* user_exception_context_address; ///< [5.0.0+] - } create_process; ///< DebugEvent_CreateProcess + } create_process; + /// DebugEvent_CreateThread struct { u64 thread_id; void* tls_address; void* entrypoint; ///< [1.0.0-10.2.0] - } create_thread; ///< DebugEvent_CreateThread + } create_thread; + /// DebugEvent_ExitProcess struct { u32 reason; ///< \ref ProcessExitReason - } exit_process; ///< DebugEvent_ExitProcess + } exit_process; + /// DebugEvent_ExitThread struct { u32 reason; ///< \ref ThreadExitReason - } exit_thread; ///< DebugEvent_ExitThread + } exit_thread; + /// DebugEvent_Exception struct { u32 type; ///< \ref DebugException void* address; @@ -431,7 +436,7 @@ typedef struct { u64 raw; } specific; - } exception; ///< DebugEvent_Exception + } exception; } info; } DebugEventInfo; From a0340a669a16b39bb44954dd879272e15fefd7f9 Mon Sep 17 00:00:00 2001 From: MasaGratoR Date: Sun, 28 Dec 2025 18:46:00 +0100 Subject: [PATCH 07/16] Fixes --- nx/include/switch/kernel/svc.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/nx/include/switch/kernel/svc.h b/nx/include/switch/kernel/svc.h index b434405d8..8a5417d6e 100644 --- a/nx/include/switch/kernel/svc.h +++ b/nx/include/switch/kernel/svc.h @@ -347,6 +347,14 @@ typedef enum { CreateProcessFlagAddressSpace_64bit = 3, } CreateProcessFlagAddressSpace; +/// Address space types for CreateProcessFlags +typedef enum { + CreateProcessFlagAddressSpace_32bit = 0, + CreateProcessFlagAddressSpace_64bitDeprecated = 1, + CreateProcessFlagAddressSpace_32bitWithoutAlias = 2, + CreateProcessFlagAddressSpace_64bit = 3, +} CreateProcessFlagPoolPartition; + /// Flags for svcCreateProcess and CreateProcess event typedef union { struct { @@ -355,8 +363,7 @@ typedef union { u32 enable_debug: 1; ///< [2.0.0+] u32 enable_aslr: 1; u32 is_application: 1; - u32 use_secure_memory: 1; ///< [1.0.0-3.0.2] - u32 pool_partition: 4; ///< [5.0.0+] \ref PhysicalMemorySystemInfo + u32 pool_partition: 4; ///< [4.0.0-4.1.0] 1 = UseSecureMemory, [5.0.0+] \ref PhysicalMemorySystemInfo u32 optimize_memory_allocation: 1; ///< [7.0.0+] Only allowed in combination with is_application u32 disable_device_address_space_merge: 1; ///< [11.0.0+] u32 enable_alias_region_extra_size: 1; ///< [18.0.0+] From 50958d8758ea81dc57c9e4913885aa1838c0092b Mon Sep 17 00:00:00 2001 From: MasaGratoR Date: Sun, 28 Dec 2025 18:47:34 +0100 Subject: [PATCH 08/16] Fixes --- nx/include/switch/kernel/svc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx/include/switch/kernel/svc.h b/nx/include/switch/kernel/svc.h index 8a5417d6e..6dbd2fdcf 100644 --- a/nx/include/switch/kernel/svc.h +++ b/nx/include/switch/kernel/svc.h @@ -367,7 +367,7 @@ typedef union { u32 optimize_memory_allocation: 1; ///< [7.0.0+] Only allowed in combination with is_application u32 disable_device_address_space_merge: 1; ///< [11.0.0+] u32 enable_alias_region_extra_size: 1; ///< [18.0.0+] - u32 reserved: 17; + u32 reserved: 18; } flags; u32 raw; } CreateProcessFlags; From 0feed9a106bb6c60f15cb8d15aec3a14f5037f98 Mon Sep 17 00:00:00 2001 From: MasaGratoR Date: Sun, 28 Dec 2025 18:52:21 +0100 Subject: [PATCH 09/16] Fixes --- nx/include/switch/kernel/svc.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/nx/include/switch/kernel/svc.h b/nx/include/switch/kernel/svc.h index 6dbd2fdcf..5f8c9ea94 100644 --- a/nx/include/switch/kernel/svc.h +++ b/nx/include/switch/kernel/svc.h @@ -347,14 +347,6 @@ typedef enum { CreateProcessFlagAddressSpace_64bit = 3, } CreateProcessFlagAddressSpace; -/// Address space types for CreateProcessFlags -typedef enum { - CreateProcessFlagAddressSpace_32bit = 0, - CreateProcessFlagAddressSpace_64bitDeprecated = 1, - CreateProcessFlagAddressSpace_32bitWithoutAlias = 2, - CreateProcessFlagAddressSpace_64bit = 3, -} CreateProcessFlagPoolPartition; - /// Flags for svcCreateProcess and CreateProcess event typedef union { struct { From 508db656e0c5ed826c3bbb0f72295713fb3db1d4 Mon Sep 17 00:00:00 2001 From: MasaGratoR Date: Sun, 28 Dec 2025 18:55:16 +0100 Subject: [PATCH 10/16] Fixes --- nx/include/switch/kernel/svc.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nx/include/switch/kernel/svc.h b/nx/include/switch/kernel/svc.h index 5f8c9ea94..24d42a92e 100644 --- a/nx/include/switch/kernel/svc.h +++ b/nx/include/switch/kernel/svc.h @@ -341,10 +341,10 @@ typedef enum { /// Address space types for CreateProcessFlags typedef enum { - CreateProcessFlagAddressSpace_32bit = 0, - CreateProcessFlagAddressSpace_64bitDeprecated = 1, + CreateProcessFlagAddressSpace_32bit = 0, + CreateProcessFlagAddressSpace_64bitDeprecated = 1, CreateProcessFlagAddressSpace_32bitWithoutAlias = 2, - CreateProcessFlagAddressSpace_64bit = 3, + CreateProcessFlagAddressSpace_64bit = 3, } CreateProcessFlagAddressSpace; /// Flags for svcCreateProcess and CreateProcess event From 3bfe5dd2ef2991cc6b807d1a9a705c0af378ae0f Mon Sep 17 00:00:00 2001 From: MasaGratoR Date: Sun, 28 Dec 2025 18:59:20 +0100 Subject: [PATCH 11/16] Fixes --- nx/include/switch/kernel/svc.h | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/nx/include/switch/kernel/svc.h b/nx/include/switch/kernel/svc.h index 24d42a92e..265953eb6 100644 --- a/nx/include/switch/kernel/svc.h +++ b/nx/include/switch/kernel/svc.h @@ -401,37 +401,44 @@ typedef struct { struct { u32 type; ///< \ref DebugException void* address; - union { + union + /// DebugException_UndefinedInstruction struct { u32 insn; - } undefined_instruction; ///< DebugException_UndefinedInstruction + } undefined_instruction; + /// DebugException_DataAbort struct { void* address; - } data_abort; ///< DebugException_DataAbort + } data_abort; + /// DebugException_AlignmentFault struct { void* address; - } alignment_fault; ///< DebugException_AlignmentFault + } alignment_fault; + /// DebugException_BreakPoint struct { u32 type; ///< \ref BreakPointType void* address; - } break_point; ///< \ref DebugException_BreakPoint + } break_point; + /// DebugException_UserBreak struct { u32 break_reason; ///< \ref BreakReason void* address; size_t size; - } user_break; ///< \ref DebugException_UserBreak + } user_break; + /// DebugException_DebuggerBreak struct { u64 active_thread_ids[4]; - } debugger_break; ///< DebugException_DebuggerBreak + } debugger_break; + /// DebugException_UndefinedSystemCall struct { u32 id; - } undefined_system_call; ///< DebugException_UndefinedSystemCall + } undefined_system_call; u64 raw; } specific; From 38c5d3ddd1ac626c0cb9ec27891557a7b6f3cab5 Mon Sep 17 00:00:00 2001 From: MasaGratoR Date: Sun, 28 Dec 2025 19:00:05 +0100 Subject: [PATCH 12/16] Fix --- nx/include/switch/kernel/svc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx/include/switch/kernel/svc.h b/nx/include/switch/kernel/svc.h index 265953eb6..31b666461 100644 --- a/nx/include/switch/kernel/svc.h +++ b/nx/include/switch/kernel/svc.h @@ -401,7 +401,7 @@ typedef struct { struct { u32 type; ///< \ref DebugException void* address; - union + union { /// DebugException_UndefinedInstruction struct { u32 insn; From 383b883a6130426ad8dd76f178cd07b05eabaaa6 Mon Sep 17 00:00:00 2001 From: MasaGratoR Date: Sun, 28 Dec 2025 19:11:01 +0100 Subject: [PATCH 13/16] Name changes --- nx/include/switch/kernel/svc.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/nx/include/switch/kernel/svc.h b/nx/include/switch/kernel/svc.h index 31b666461..0da7ba340 100644 --- a/nx/include/switch/kernel/svc.h +++ b/nx/include/switch/kernel/svc.h @@ -292,12 +292,12 @@ typedef enum { /// DebugEvent types typedef enum { - DebugEvent_CreateProcess = 0, - DebugEvent_CreateThread = 1, - DebugEvent_ExitProcess = 2, - DebugEvent_ExitThread = 3, - DebugEvent_Exception = 4, -} DebugEvent; + DebugEventType_CreateProcess = 0, + DebugEventType_CreateThread = 1, + DebugEventType_ExitProcess = 2, + DebugEventType_ExitThread = 3, + DebugEventType_Exception = 4, +} DebugEventType; /// Process exit reasons typedef enum { @@ -364,9 +364,9 @@ typedef union { u32 raw; } CreateProcessFlags; -/// DebugEventInfo structure +/// DebugEvent structure typedef struct { - u32 type; ///< \ref DebugEvent + u32 type; ///< \ref DebugEventType u32 flags; ///< \ref DebugEventFlag u64 thread_id; @@ -444,7 +444,7 @@ typedef struct { } specific; } exception; } info; -} DebugEventInfo; +} DebugEvent; ///@name Memory management ///@{ @@ -1421,7 +1421,7 @@ Result svcTerminateDebugProcess(Handle debug); * @note Syscall number 0x63. * @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available. */ -Result svcGetDebugEvent(DebugEventInfo* event_out, Handle debug); +Result svcGetDebugEvent(DebugEvent* event_out, Handle debug); /** * @brief Continues a debugging session. From 26aed5d9fde8d93274994d954993083b224fec07 Mon Sep 17 00:00:00 2001 From: MasaGratoR Date: Sun, 28 Dec 2025 19:11:58 +0100 Subject: [PATCH 14/16] Update comments --- nx/include/switch/kernel/svc.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nx/include/switch/kernel/svc.h b/nx/include/switch/kernel/svc.h index 0da7ba340..7f61fbe01 100644 --- a/nx/include/switch/kernel/svc.h +++ b/nx/include/switch/kernel/svc.h @@ -371,7 +371,7 @@ typedef struct { u64 thread_id; union { - /// DebugEvent_CreateProcess + /// DebugEventType_CreateProcess struct { u64 program_id; u64 process_id; @@ -380,24 +380,24 @@ typedef struct { void* user_exception_context_address; ///< [5.0.0+] } create_process; - /// DebugEvent_CreateThread + /// DebugEventType_CreateThread struct { u64 thread_id; void* tls_address; void* entrypoint; ///< [1.0.0-10.2.0] } create_thread; - /// DebugEvent_ExitProcess + /// DebugEventType_ExitProcess struct { u32 reason; ///< \ref ProcessExitReason } exit_process; - /// DebugEvent_ExitThread + /// DebugEventType_ExitThread struct { u32 reason; ///< \ref ThreadExitReason } exit_thread; - /// DebugEvent_Exception + /// DebugEventType_Exception struct { u32 type; ///< \ref DebugException void* address; From 03f956f7bb29310a7ca071fed9a4b55d738fbab6 Mon Sep 17 00:00:00 2001 From: MasaGratoR Date: Mon, 29 Dec 2025 07:45:11 +0100 Subject: [PATCH 15/16] Fix --- nx/include/switch/kernel/svc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx/include/switch/kernel/svc.h b/nx/include/switch/kernel/svc.h index 7f61fbe01..6e3902214 100644 --- a/nx/include/switch/kernel/svc.h +++ b/nx/include/switch/kernel/svc.h @@ -336,7 +336,7 @@ typedef enum { /// DebugEvent flags typedef enum { - DebugEventFlag_Stopped = BIT(1), + DebugEventFlag_Stopped = BIT(0), } DebugEventFlag; /// Address space types for CreateProcessFlags From ad0fb76e4121572768d316a352ed053e01789da4 Mon Sep 17 00:00:00 2001 From: MasaGratoR Date: Mon, 29 Dec 2025 11:17:51 +0100 Subject: [PATCH 16/16] Fixes --- nx/include/switch/kernel/svc.h | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/nx/include/switch/kernel/svc.h b/nx/include/switch/kernel/svc.h index 6e3902214..85847cbe1 100644 --- a/nx/include/switch/kernel/svc.h +++ b/nx/include/switch/kernel/svc.h @@ -348,20 +348,17 @@ typedef enum { } CreateProcessFlagAddressSpace; /// Flags for svcCreateProcess and CreateProcess event -typedef union { - struct { - u32 is_64bit: 1; - u32 address_space: 3; ///< \ref CreateProcessFlagAddressSpace - u32 enable_debug: 1; ///< [2.0.0+] - u32 enable_aslr: 1; - u32 is_application: 1; - u32 pool_partition: 4; ///< [4.0.0-4.1.0] 1 = UseSecureMemory, [5.0.0+] \ref PhysicalMemorySystemInfo - u32 optimize_memory_allocation: 1; ///< [7.0.0+] Only allowed in combination with is_application - u32 disable_device_address_space_merge: 1; ///< [11.0.0+] - u32 enable_alias_region_extra_size: 1; ///< [18.0.0+] - u32 reserved: 18; - } flags; - u32 raw; +typedef struct { + u32 is_64bit: 1; + u32 address_space: 3; ///< \ref CreateProcessFlagAddressSpace + u32 enable_debug: 1; ///< [2.0.0+] + u32 enable_aslr: 1; + u32 is_application: 1; + u32 pool_partition: 4; ///< [4.0.0-4.1.0] 1 = UseSecureMemory, [5.0.0+] \ref PhysicalMemorySystemInfo + u32 optimize_memory_allocation: 1; ///< [7.0.0+] Only allowed in combination with is_application + u32 disable_device_address_space_merge: 1; ///< [11.0.0+] + u32 enable_alias_region_extra_size: 1; ///< [18.0.0+] + u32 reserved: 18; } CreateProcessFlags; /// DebugEvent structure