diff --git a/headers/private/kernel/arch/debug.h b/headers/private/kernel/arch/debug.h index 381de33627..18f62fafed 100644 --- a/headers/private/kernel/arch/debug.h +++ b/headers/private/kernel/arch/debug.h @@ -53,6 +53,8 @@ status_t arch_get_debug_variable(const char* variableName, uint64* value); ssize_t arch_debug_gdb_get_registers(char* buffer, size_t bufferSize); +void arch_debug_snooze(bigtime_t duration); + #ifdef __cplusplus } #endif diff --git a/src/system/kernel/arch/arm/arch_debug.cpp b/src/system/kernel/arch/arm/arch_debug.cpp index 3147d232c7..9da07a5740 100644 --- a/src/system/kernel/arch/arm/arch_debug.cpp +++ b/src/system/kernel/arch/arm/arch_debug.cpp @@ -502,6 +502,13 @@ arch_get_debug_variable(const char* variableName, uint64* value) } +void +arch_debug_snooze(bigtime_t duration) +{ + spin(duration); +} + + status_t arch_debug_init(kernel_args *args) { diff --git a/src/system/kernel/arch/arm64/arch_debug.cpp b/src/system/kernel/arch/arm64/arch_debug.cpp index 3423646162..cdf0bdb840 100644 --- a/src/system/kernel/arch/arm64/arch_debug.cpp +++ b/src/system/kernel/arch/arm64/arch_debug.cpp @@ -479,6 +479,13 @@ arch_get_debug_variable(const char* variableName, uint64* value) } +void +arch_debug_snooze(bigtime_t duration) +{ + spin(duration); +} + + status_t arch_debug_init(kernel_args *args) { diff --git a/src/system/kernel/arch/m68k/arch_debug.cpp b/src/system/kernel/arch/m68k/arch_debug.cpp index 5619a6745a..d18c5d3007 100644 --- a/src/system/kernel/arch/m68k/arch_debug.cpp +++ b/src/system/kernel/arch/m68k/arch_debug.cpp @@ -393,6 +393,13 @@ arch_debug_gdb_get_registers(char* buffer, size_t bufferSize) } +void +arch_debug_snooze(bigtime_t duration) +{ + spin(duration); +} + + status_t arch_debug_init(kernel_args *args) { diff --git a/src/system/kernel/arch/ppc/arch_debug.cpp b/src/system/kernel/arch/ppc/arch_debug.cpp index 297382cd69..b83a2930b9 100644 --- a/src/system/kernel/arch/ppc/arch_debug.cpp +++ b/src/system/kernel/arch/ppc/arch_debug.cpp @@ -336,6 +336,13 @@ arch_debug_gdb_get_registers(char* buffer, size_t bufferSize) } +void +arch_debug_snooze(bigtime_t duration) +{ + spin(duration); +} + + status_t arch_debug_init(kernel_args *args) { diff --git a/src/system/kernel/arch/riscv64/arch_debug.cpp b/src/system/kernel/arch/riscv64/arch_debug.cpp index 2667b68b42..0018d9382c 100644 --- a/src/system/kernel/arch/riscv64/arch_debug.cpp +++ b/src/system/kernel/arch/riscv64/arch_debug.cpp @@ -1136,11 +1136,16 @@ arch_debug_gdb_get_registers(char* buffer, size_t bufferSize) } +void +arch_debug_snooze(bigtime_t duration) +{ + spin(duration); +} + + status_t arch_debug_init(kernel_args* args) { - // at this stage, the debugger command system is alive - add_debugger_command("where", &stack_trace, "Same as \"sc\""); add_debugger_command("bt", &stack_trace, "Same as \"sc\" (as in gdb)"); add_debugger_command("sc", &stack_trace, diff --git a/src/system/kernel/arch/sparc/arch_debug.cpp b/src/system/kernel/arch/sparc/arch_debug.cpp index 90d4fcc5ea..facc7ec6d7 100644 --- a/src/system/kernel/arch/sparc/arch_debug.cpp +++ b/src/system/kernel/arch/sparc/arch_debug.cpp @@ -92,6 +92,13 @@ arch_debug_get_interrupt_pc(bool* _isSyscall) } +void +arch_debug_snooze(bigtime_t duration) +{ + spin(duration); +} + + status_t arch_debug_init(kernel_args *args) { diff --git a/src/system/kernel/arch/x86/arch_debug.cpp b/src/system/kernel/arch/x86/arch_debug.cpp index d01b72d3e0..6a1edfb6dd 100644 --- a/src/system/kernel/arch/x86/arch_debug.cpp +++ b/src/system/kernel/arch/x86/arch_debug.cpp @@ -1357,6 +1357,13 @@ arch_debug_gdb_get_registers(char* buffer, size_t bufferSize) } +void +arch_debug_snooze(bigtime_t duration) +{ + spin(duration); +} + + status_t arch_debug_init(kernel_args* args) { diff --git a/src/system/kernel/debug/debug.cpp b/src/system/kernel/debug/debug.cpp index fdc2e3bfb9..1e801f5f5d 100644 --- a/src/system/kernel/debug/debug.cpp +++ b/src/system/kernel/debug/debug.cpp @@ -715,7 +715,7 @@ kgetc(void) } } - cpu_pause(); + arch_debug_snooze(5000); } } @@ -1824,7 +1824,7 @@ debug_trap_cpu_in_kdl(int32 cpu, bool returnIfHandedOver) sCPUTrapped[cpu] = true; while (sInDebugger != 0) { - cpu_pause(); + arch_debug_snooze(10000); if (sHandOverKDL && sHandOverKDLToCPU == cpu) { if (returnIfHandedOver)