5 #include <linux/module.h>
7 #include <asm/uaccess.h>
11 return (
unsigned long)&x->
insn + x->
insn;
14 static void swap_ex(
void *
a,
void *
b,
int size)
17 unsigned long addr_a = ex_to_addr(ex_a), addr_b = ex_to_addr(ex_b);
22 ex_a->
insn = (
int)(addr_b - (
unsigned long)&ex_a->
insn);
23 ex_b->insn = (
int)(addr_a - (
unsigned long)&ex_b->insn);
32 static int cmp_ex(
const void *a,
const void *b)
37 if (ex_to_addr(x) > ex_to_addr(y))
39 if (ex_to_addr(x) < ex_to_addr(y))
59 while (m->num_exentries &&
60 within_module_init(ex_to_addr(&m->extable[0]), m)) {
65 while (m->num_exentries &&
66 within_module_init(ex_to_addr(&m->extable[m->num_exentries-1]),
77 while (first <= last) {
79 unsigned long mid_value;
81 mid = (last -
first) / 2 + first;
82 mid_value = ex_to_addr(mid);
83 if (mid_value == value)
85 else if (mid_value < value)