summaryrefslogtreecommitdiff
path: root/lib_ppc/extable.c
diff options
context:
space:
mode:
authorKim Phillips <kim.phillips@freescale.com>2007-07-06 19:39:48 -0500
committerKim Phillips <kim.phillips@freescale.com>2007-07-06 19:39:48 -0500
commit0459e7d3a0a273064b738aa2e06fd7dcd35eec58 (patch)
tree83b8a3044400cb1463e91410cf0f3732dedd7fb4 /lib_ppc/extable.c
parent30d5c04c93084fe0b144646b77eb873957872a8d (diff)
parente80955f07de03fef0196353e77534b2300193c1c (diff)
downloadu-boot-imx-0459e7d3a0a273064b738aa2e06fd7dcd35eec58.zip
u-boot-imx-0459e7d3a0a273064b738aa2e06fd7dcd35eec58.tar.gz
u-boot-imx-0459e7d3a0a273064b738aa2e06fd7dcd35eec58.tar.bz2
Merge git://www.denx.de/git/u-boot
Diffstat (limited to 'lib_ppc/extable.c')
-rw-r--r--lib_ppc/extable.c39
1 files changed, 18 insertions, 21 deletions
diff --git a/lib_ppc/extable.c b/lib_ppc/extable.c
index b14d661..8354411 100644
--- a/lib_ppc/extable.c
+++ b/lib_ppc/extable.c
@@ -52,30 +52,27 @@ search_one_table(const struct exception_table_entry *first,
const struct exception_table_entry *last,
unsigned long value)
{
- while (first <= last) {
- const struct exception_table_entry *mid;
- long diff;
-
- mid = (last - first) / 2 + first;
- if ((ulong) mid > CFG_MONITOR_BASE) {
- /* exception occurs in FLASH, before u-boot relocation.
- * No relocation offset is needed.
- */
- diff = mid->insn - value;
+ long diff;
+ if ((ulong) first > CFG_MONITOR_BASE) {
+ /* exception occurs in FLASH, before u-boot relocation.
+ * No relocation offset is needed.
+ */
+ while (first <= last) {
+ diff = first->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;
+ return first->fixup;
+ first++;
+ }
+ } else {
+ /* exception occurs in RAM, after u-boot relocation.
+ * A relocation offset should be added.
+ */
+ while (first <= last) {
+ diff = (first->insn + gd->reloc_off) - value;
if (diff == 0)
- return (mid->fixup + gd->reloc_off);
+ return (first->fixup + gd->reloc_off);
+ first++;
}
- if (diff < 0)
- first = mid + 1;
- else
- last = mid - 1;
}
return 0;
}