]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - lib_ppc/extable.c
help: Correct syntax of nandecc help output.
[karo-tx-uboot.git] / lib_ppc / extable.c
index fe856ffbb527a4e5dd62d1925d39f0fe14fc8ada..7408d5c96946acff06b7f49098dac6c113d0bba3 100644 (file)
@@ -52,31 +52,14 @@ search_one_table(const struct exception_table_entry *first,
                 const struct exception_table_entry *last,
                 unsigned long value)
 {
+       long diff;
        while (first <= last) {
-               const struct exception_table_entry *mid;
-               long diff;
-
-               mid = (last - first) / 2 + first;
-               if (mid > CFG_MONITOR_BASE) {
-               /* exception occurs in FLASH, before u-boot relocation.
-                * No relocation offset is needed.
-                */
-                       diff = mid->insn - value;
-                       if (diff == 0)
-                               return mid->fixup;
-               } else {
-               /* exception occurs in RAM, after u-boot relocation.
-                * A relocation offset should be added.
-                */
-                       diff = (mid->insn + gd->reloc_off) - value;
-                       if (diff == 0)
-                               return (mid->fixup + gd->reloc_off);
-               }
-               if (diff < 0)
-                       first = mid+1;
-               else
-                       last = mid-1;
+               diff = first->insn - value;
+               if (diff == 0)
+                       return first->fixup;
+               first++;
        }
+
        return 0;
 }
 
@@ -90,9 +73,9 @@ search_exception_table(unsigned long addr)
        /* There is only the kernel to search.  */
        ret = search_one_table(__start___ex_table, __stop___ex_table-1, addr);
        /* if the serial port does not hang in exception, printf can be used */
-#if !defined(CFG_SERIAL_HANG_IN_EXCEPTION)
+#if !defined(CONFIG_SYS_SERIAL_HANG_IN_EXCEPTION)
        if (ex_tab_message)
-               printf("Bus Fault @ 0x%08lx, fixup 0x%08lx\n", addr, ret);
+               debug("Bus Fault @ 0x%08lx, fixup 0x%08lx\n", addr, ret);
 #endif
        if (ret) return ret;