Merge branch 'master' of git://www.denx.de/git/u-boot-ppc4xx
[platform/kernel/u-boot.git] / cpu / mpc512x / traps.c
index 40281a2..8000fab 100644 (file)
@@ -34,7 +34,13 @@ DECLARE_GLOBAL_DATA_PTR;
 
 extern unsigned long search_exception_table(unsigned long);
 
-#define END_OF_MEM     (gd->bd->bi_memstart + gd->bd->bi_memsize)
+/*
+ * End of addressable memory.  This may be less than the actual
+ * amount of memory on the system if we're unable to keep all
+ * the memory mapped in.
+ */
+extern ulong get_effective_memsize(void);
+#define END_OF_MEM (gd->bd->bi_memstart + get_effective_memsize())
 
 /*
  * Trap & Exception support
@@ -106,7 +112,7 @@ MachineCheckException (struct pt_regs *regs)
                return;
        }
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#ifdef CONFIG_CMD_KGDB
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -144,7 +150,7 @@ MachineCheckException (struct pt_regs *regs)
 void
 AlignmentException (struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#ifdef CONFIG_CMD_KGDB
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -156,7 +162,7 @@ AlignmentException (struct pt_regs *regs)
 void
 ProgramCheckException (struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#ifdef CONFIG_CMD_KGDB
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -168,7 +174,7 @@ ProgramCheckException (struct pt_regs *regs)
 void
 SoftEmuException (struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#ifdef CONFIG_CMD_KGDB
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -181,7 +187,7 @@ SoftEmuException (struct pt_regs *regs)
 void
 UnknownException (struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#ifdef CONFIG_CMD_KGDB
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -190,7 +196,7 @@ UnknownException (struct pt_regs *regs)
        _exception (0, regs);
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG)
+#ifdef CONFIG_CMD_BEDBUG
 extern void do_bedbug_breakpoint (struct pt_regs *);
 #endif
 
@@ -199,7 +205,7 @@ DebugException (struct pt_regs *regs)
 {
        printf ("Debugger trap at @ %lx\n", regs->nip );
        show_regs (regs);
-#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG)
+#ifdef CONFIG_CMD_BEDBUG
        do_bedbug_breakpoint (regs);
 #endif
 }