tree 47d9a6ab54c4b068e3300d026c4402c14f53d384
parent bef5686229810709091fb6e505071f4aa41e3760
author Olaf Hering <[EMAIL PROTECTED]> Thu, 04 Aug 2005 19:26:42 +0200
committer Paul Mackerras <[EMAIL PROTECTED]> Mon, 29 Aug 2005 10:53:37 +1000

[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 <[EMAIL PROTECTED]>
Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>

 arch/ppc64/kernel/setup.c  |    8 +++++---
 arch/ppc64/xmon/start.c    |    2 +-
 arch/ppc64/xmon/xmon.c     |   26 ++++++++++++++++++--------
 include/asm-ppc64/system.h |    2 +-
 4 files changed, 25 insertions(+), 13 deletions(-)

diff --git a/arch/ppc64/kernel/setup.c b/arch/ppc64/kernel/setup.c
--- a/arch/ppc64/kernel/setup.c
+++ b/arch/ppc64/kernel/setup.c
@@ -627,7 +627,7 @@ void __init setup_system(void)
         * Initialize xmon
         */
 #ifdef CONFIG_XMON_DEFAULT
-       xmon_init();
+       xmon_init(1);
 #endif
        /*
         * Register early console
@@ -1343,11 +1343,13 @@ static int __init early_xmon(char *p)
        /* ensure xmon is enabled */
        if (p) {
                if (strncmp(p, "on", 2) == 0)
-                       xmon_init();
+                       xmon_init(1);
+               if (strncmp(p, "off", 3) == 0)
+                       xmon_init(0);
                if (strncmp(p, "early", 5) != 0)
                        return 0;
        }
-       xmon_init();
+       xmon_init(1);
        debugger(NULL);
 
        return 0;
diff --git a/arch/ppc64/xmon/start.c b/arch/ppc64/xmon/start.c
--- a/arch/ppc64/xmon/start.c
+++ b/arch/ppc64/xmon/start.c
@@ -27,7 +27,7 @@ static void sysrq_handle_xmon(int key, s
                              struct tty_struct *tty) 
 {
        /* ensure xmon is enabled */
-       xmon_init();
+       xmon_init(1);
        debugger(pt_regs);
 }
 
diff --git a/arch/ppc64/xmon/xmon.c b/arch/ppc64/xmon/xmon.c
--- a/arch/ppc64/xmon/xmon.c
+++ b/arch/ppc64/xmon/xmon.c
@@ -2496,15 +2496,25 @@ static void dump_stab(void)
        }
 }
 
-void xmon_init(void)
+void xmon_init(int enable)
 {
-       __debugger = xmon;
-       __debugger_ipi = xmon_ipi;
-       __debugger_bpt = xmon_bpt;
-       __debugger_sstep = xmon_sstep;
-       __debugger_iabr_match = xmon_iabr_match;
-       __debugger_dabr_match = xmon_dabr_match;
-       __debugger_fault_handler = xmon_fault_handler;
+       if (enable) {
+               __debugger = xmon;
+               __debugger_ipi = xmon_ipi;
+               __debugger_bpt = xmon_bpt;
+               __debugger_sstep = xmon_sstep;
+               __debugger_iabr_match = xmon_iabr_match;
+               __debugger_dabr_match = xmon_dabr_match;
+               __debugger_fault_handler = xmon_fault_handler;
+       } else {
+               __debugger = NULL;
+               __debugger_ipi = NULL;
+               __debugger_bpt = NULL;
+               __debugger_sstep = NULL;
+               __debugger_iabr_match = NULL;
+               __debugger_dabr_match = NULL;
+               __debugger_fault_handler = NULL;
+       }
 }
 
 void dump_segments(void)
diff --git a/include/asm-ppc64/system.h b/include/asm-ppc64/system.h
--- a/include/asm-ppc64/system.h
+++ b/include/asm-ppc64/system.h
@@ -88,7 +88,7 @@ DEBUGGER_BOILERPLATE(debugger_dabr_match
 DEBUGGER_BOILERPLATE(debugger_fault_handler)
 
 #ifdef CONFIG_XMON
-extern void xmon_init(void);
+extern void xmon_init(int enable);
 #endif
 
 #else
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to