summaryrefslogtreecommitdiff
path: root/arch/powerpc/xmon
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2006-10-03 08:12:08 +0400
committerPaul Mackerras <paulus@samba.org>2006-10-04 08:52:22 +0400
commit476792839467c08ddeedd8b44a7423d415b68259 (patch)
tree43f273e48667c611bb3e28e9c6a359dec0d2c068 /arch/powerpc/xmon
parent23b8acb1cf49fea74a9d431de258787384951eac (diff)
downloadlinux-476792839467c08ddeedd8b44a7423d415b68259.tar.xz
[POWERPC] Fix xmon=off and cleanup xmon initialisation
My patch to make the early xmon logic work with earlier early param parsing (480f6f35a149802a94ad5c1a2673ed6ec8d2c158) breaks xmon=off. No one does this obviously as xmon rocks, but it should really work as documented. While fixing that it struck me that we could move the xmon param handling into xmon.c, and also consolidate the xmon_init()/do_early_xmon logic into xmon_setup(). This means xmon=early drops into xmon a little earlier on 32-bit, but it seems to work just fine. Tested on PSERIES and CLASSIC32. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/xmon')
-rw-r--r--arch/powerpc/xmon/xmon.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 8adad1444a51..b54ff980ecd4 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -2,6 +2,8 @@
* Routines providing a simple monitor for use on the PowerMac.
*
* Copyright (C) 1996-2005 Paul Mackerras.
+ * Copyright (C) 2001 PPC64 Team, IBM Corp
+ * Copyrignt (C) 2006 Michael Ellerman, IBM Corp
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -2597,3 +2599,34 @@ static int __init setup_xmon_sysrq(void)
}
__initcall(setup_xmon_sysrq);
#endif /* CONFIG_MAGIC_SYSRQ */
+
+int __initdata xmon_early, xmon_off;
+
+static int __init early_parse_xmon(char *p)
+{
+ if (!p || strncmp(p, "early", 5) == 0) {
+ /* just "xmon" is equivalent to "xmon=early" */
+ xmon_init(1);
+ xmon_early = 1;
+ } else if (strncmp(p, "on", 2) == 0)
+ xmon_init(1);
+ else if (strncmp(p, "off", 3) == 0)
+ xmon_off = 1;
+ else if (strncmp(p, "nobt", 4) == 0)
+ xmon_no_auto_backtrace = 1;
+ else
+ return 1;
+
+ return 0;
+}
+early_param("xmon", early_parse_xmon);
+
+void __init xmon_setup(void)
+{
+#ifdef CONFIG_XMON_DEFAULT
+ if (!xmon_off)
+ xmon_init(1);
+#endif
+ if (xmon_early)
+ debugger(NULL);
+}