[PATCH v2 3/3] sparc: Implement arch_do_panic
Mete Durlu <[email protected]> Mon, 27 Jul 2026 12:36:22 +0200
| Newsgroups | gmane.linux.ports.sparc,gmane.linux.kernel |
|---|---|
| Message-ID | <[email protected]> |
Implement sparc specific arch_do_panic() instead of using sparc specific ifdef sections in vpanic() code. Signed-off-by: Mete Durlu <[email protected]> --- arch/sparc/include/asm/bug.h | 3 +++ arch/sparc/include/asm/setup.h | 1 - arch/sparc/kernel/setup.c | 8 ++++++++ kernel/panic.c | 9 --------- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/arch/sparc/include/asm/bug.h b/arch/sparc/include/asm/bug.h index ea53e418f6c0..70dc3358430c 100644 --- a/arch/sparc/include/asm/bug.h +++ b/arch/sparc/include/asm/bug.h @@ -27,4 +27,7 @@ void do_BUG(const char *file, int line); struct pt_regs; void __noreturn die_if_kernel(char *str, struct pt_regs *regs); +void arch_do_panic(void); +#define arch_do_panic arch_do_panic + #endif diff --git a/arch/sparc/include/asm/setup.h b/arch/sparc/include/asm/setup.h index 21bed5514028..fed37c85ed00 100644 --- a/arch/sparc/include/asm/setup.h +++ b/arch/sparc/include/asm/setup.h @@ -43,7 +43,6 @@ void __init device_scan(void); /* unaligned_32.c */ unsigned long safe_compute_effective_address(struct pt_regs *, unsigned int); - #endif #ifdef CONFIG_SPARC64 diff --git a/arch/sparc/kernel/setup.c b/arch/sparc/kernel/setup.c index 4975867d9001..87d3569c520f 100644 --- a/arch/sparc/kernel/setup.c +++ b/arch/sparc/kernel/setup.c @@ -36,6 +36,14 @@ static const struct ctl_table sparc_sysctl_table[] = { #endif }; +void arch_do_panic(void) +{ + extern int stop_a_enabled; + /* Make sure the user can actually press Stop-A (L1-A) */ + stop_a_enabled = 1; + pr_emerg("Press Stop-A (L1-A) from sun keyboard or send break\n" + "twice on console to return to the boot prom\n"); +} static int __init init_sparc_sysctls(void) { diff --git a/kernel/panic.c b/kernel/panic.c index de0bda946cab..593aa2c24d93 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -747,15 +747,6 @@ void vpanic(const char *fmt, va_list args) reboot_mode = panic_reboot_mode; emergency_restart(); } -#ifdef __sparc__ - { - extern int stop_a_enabled; - /* Make sure the user can actually press Stop-A (L1-A) */ - stop_a_enabled = 1; - pr_emerg("Press Stop-A (L1-A) from sun keyboard or send break\n" - "twice on console to return to the boot prom\n"); - } -#endif pr_emerg("---[ end Kernel panic - not syncing: %s ]---\n", buf); arch_do_panic(); -- 2.55.0