/arch/alpha/mm/extable.c

https://bitbucket.org/evzijst/gittest · C · 34 lines · 26 code · 5 blank · 3 comment · 5 complexity · 072fb1621e84acd46dd16b70a0bda981 MD5 · raw file

  1. /*
  2. * linux/arch/alpha/mm/extable.c
  3. */
  4. #include <linux/config.h>
  5. #include <linux/module.h>
  6. #include <asm/uaccess.h>
  7. void sort_extable(struct exception_table_entry *start,
  8. struct exception_table_entry *finish)
  9. {
  10. }
  11. const struct exception_table_entry *
  12. search_extable(const struct exception_table_entry *first,
  13. const struct exception_table_entry *last,
  14. unsigned long value)
  15. {
  16. while (first <= last) {
  17. const struct exception_table_entry *mid;
  18. unsigned long mid_value;
  19. mid = (last - first) / 2 + first;
  20. mid_value = (unsigned long)&mid->insn + mid->insn;
  21. if (mid_value == value)
  22. return mid;
  23. else if (mid_value < value)
  24. first = mid+1;
  25. else
  26. last = mid-1;
  27. }
  28. return NULL;
  29. }