[PATCH] ppc64: allow xmon=off

If both CONFIG_XMON and CONFIG_XMON_DEFAULT is enabled in the .config,
there is no way to disable xmon again. setup_system calls first xmon_init,
later parse_early_param. So a new 'xmon=off' cmdline option will do the right
thing.

Signed-off-by: Olaf Hering <olh@suse.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>

authored by

Olaf Hering and committed by
Paul Mackerras
b13cfd17 bef56862

+25 -13
+5 -3
arch/ppc64/kernel/setup.c
··· 627 627 * Initialize xmon 628 628 */ 629 629 #ifdef CONFIG_XMON_DEFAULT 630 - xmon_init(); 630 + xmon_init(1); 631 631 #endif 632 632 /* 633 633 * Register early console ··· 1343 1343 /* ensure xmon is enabled */ 1344 1344 if (p) { 1345 1345 if (strncmp(p, "on", 2) == 0) 1346 - xmon_init(); 1346 + xmon_init(1); 1347 + if (strncmp(p, "off", 3) == 0) 1348 + xmon_init(0); 1347 1349 if (strncmp(p, "early", 5) != 0) 1348 1350 return 0; 1349 1351 } 1350 - xmon_init(); 1352 + xmon_init(1); 1351 1353 debugger(NULL); 1352 1354 1353 1355 return 0;
+1 -1
arch/ppc64/xmon/start.c
··· 27 27 struct tty_struct *tty) 28 28 { 29 29 /* ensure xmon is enabled */ 30 - xmon_init(); 30 + xmon_init(1); 31 31 debugger(pt_regs); 32 32 } 33 33
+18 -8
arch/ppc64/xmon/xmon.c
··· 2496 2496 } 2497 2497 } 2498 2498 2499 - void xmon_init(void) 2499 + void xmon_init(int enable) 2500 2500 { 2501 - __debugger = xmon; 2502 - __debugger_ipi = xmon_ipi; 2503 - __debugger_bpt = xmon_bpt; 2504 - __debugger_sstep = xmon_sstep; 2505 - __debugger_iabr_match = xmon_iabr_match; 2506 - __debugger_dabr_match = xmon_dabr_match; 2507 - __debugger_fault_handler = xmon_fault_handler; 2501 + if (enable) { 2502 + __debugger = xmon; 2503 + __debugger_ipi = xmon_ipi; 2504 + __debugger_bpt = xmon_bpt; 2505 + __debugger_sstep = xmon_sstep; 2506 + __debugger_iabr_match = xmon_iabr_match; 2507 + __debugger_dabr_match = xmon_dabr_match; 2508 + __debugger_fault_handler = xmon_fault_handler; 2509 + } else { 2510 + __debugger = NULL; 2511 + __debugger_ipi = NULL; 2512 + __debugger_bpt = NULL; 2513 + __debugger_sstep = NULL; 2514 + __debugger_iabr_match = NULL; 2515 + __debugger_dabr_match = NULL; 2516 + __debugger_fault_handler = NULL; 2517 + } 2508 2518 } 2509 2519 2510 2520 void dump_segments(void)
+1 -1
include/asm-ppc64/system.h
··· 88 88 DEBUGGER_BOILERPLATE(debugger_fault_handler) 89 89 90 90 #ifdef CONFIG_XMON 91 - extern void xmon_init(void); 91 + extern void xmon_init(int enable); 92 92 #endif 93 93 94 94 #else