diff options
author | Olaf Hering <olh@suse.de> | 2005-08-04 13:26:42 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-08-28 20:53:37 -0400 |
commit | b13cfd173f73c3f6f9a307b7b6e64d45fbd756b2 (patch) | |
tree | 47d9a6ab54c4b068e3300d026c4402c14f53d384 | |
parent | bef5686229810709091fb6e505071f4aa41e3760 (diff) |
[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>
-rw-r--r-- | arch/ppc64/kernel/setup.c | 8 | ||||
-rw-r--r-- | arch/ppc64/xmon/start.c | 2 | ||||
-rw-r--r-- | arch/ppc64/xmon/xmon.c | 28 | ||||
-rw-r--r-- | include/asm-ppc64/system.h | 2 |
4 files changed, 26 insertions, 14 deletions
diff --git a/arch/ppc64/kernel/setup.c b/arch/ppc64/kernel/setup.c index e9c24d2dbd91..b3ef8df12982 100644 --- a/arch/ppc64/kernel/setup.c +++ b/arch/ppc64/kernel/setup.c | |||
@@ -627,7 +627,7 @@ void __init setup_system(void) | |||
627 | * Initialize xmon | 627 | * Initialize xmon |
628 | */ | 628 | */ |
629 | #ifdef CONFIG_XMON_DEFAULT | 629 | #ifdef CONFIG_XMON_DEFAULT |
630 | xmon_init(); | 630 | xmon_init(1); |
631 | #endif | 631 | #endif |
632 | /* | 632 | /* |
633 | * Register early console | 633 | * Register early console |
@@ -1343,11 +1343,13 @@ static int __init early_xmon(char *p) | |||
1343 | /* ensure xmon is enabled */ | 1343 | /* ensure xmon is enabled */ |
1344 | if (p) { | 1344 | if (p) { |
1345 | if (strncmp(p, "on", 2) == 0) | 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 | if (strncmp(p, "early", 5) != 0) | 1349 | if (strncmp(p, "early", 5) != 0) |
1348 | return 0; | 1350 | return 0; |
1349 | } | 1351 | } |
1350 | xmon_init(); | 1352 | xmon_init(1); |
1351 | debugger(NULL); | 1353 | debugger(NULL); |
1352 | 1354 | ||
1353 | return 0; | 1355 | return 0; |
diff --git a/arch/ppc64/xmon/start.c b/arch/ppc64/xmon/start.c index a9265bcc79b2..f86b584acd76 100644 --- a/arch/ppc64/xmon/start.c +++ b/arch/ppc64/xmon/start.c | |||
@@ -27,7 +27,7 @@ static void sysrq_handle_xmon(int key, struct pt_regs *pt_regs, | |||
27 | struct tty_struct *tty) | 27 | struct tty_struct *tty) |
28 | { | 28 | { |
29 | /* ensure xmon is enabled */ | 29 | /* ensure xmon is enabled */ |
30 | xmon_init(); | 30 | xmon_init(1); |
31 | debugger(pt_regs); | 31 | debugger(pt_regs); |
32 | } | 32 | } |
33 | 33 | ||
diff --git a/arch/ppc64/xmon/xmon.c b/arch/ppc64/xmon/xmon.c index 05539439e6bc..45908b10acd3 100644 --- a/arch/ppc64/xmon/xmon.c +++ b/arch/ppc64/xmon/xmon.c | |||
@@ -2496,15 +2496,25 @@ static void dump_stab(void) | |||
2496 | } | 2496 | } |
2497 | } | 2497 | } |
2498 | 2498 | ||
2499 | void xmon_init(void) | 2499 | void xmon_init(int enable) |
2500 | { | 2500 | { |
2501 | __debugger = xmon; | 2501 | if (enable) { |
2502 | __debugger_ipi = xmon_ipi; | 2502 | __debugger = xmon; |
2503 | __debugger_bpt = xmon_bpt; | 2503 | __debugger_ipi = xmon_ipi; |
2504 | __debugger_sstep = xmon_sstep; | 2504 | __debugger_bpt = xmon_bpt; |
2505 | __debugger_iabr_match = xmon_iabr_match; | 2505 | __debugger_sstep = xmon_sstep; |
2506 | __debugger_dabr_match = xmon_dabr_match; | 2506 | __debugger_iabr_match = xmon_iabr_match; |
2507 | __debugger_fault_handler = xmon_fault_handler; | 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 | void dump_segments(void) | 2520 | void dump_segments(void) |
diff --git a/include/asm-ppc64/system.h b/include/asm-ppc64/system.h index 4104a5dedbaa..b9e1835351e9 100644 --- a/include/asm-ppc64/system.h +++ b/include/asm-ppc64/system.h | |||
@@ -88,7 +88,7 @@ DEBUGGER_BOILERPLATE(debugger_dabr_match) | |||
88 | DEBUGGER_BOILERPLATE(debugger_fault_handler) | 88 | DEBUGGER_BOILERPLATE(debugger_fault_handler) |
89 | 89 | ||
90 | #ifdef CONFIG_XMON | 90 | #ifdef CONFIG_XMON |
91 | extern void xmon_init(void); | 91 | extern void xmon_init(int enable); |
92 | #endif | 92 | #endif |
93 | 93 | ||
94 | #else | 94 | #else |