aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/mm/extable.c
diff options
context:
space:
mode:
authorVegard Nossum <vegard.nossum@gmail.com>2009-06-15 09:50:49 -0400
committerVegard Nossum <vegard.nossum@gmail.com>2009-06-15 09:50:49 -0400
commit722f2a6c87f34ee0fd0130a8cf45f81e0705594a (patch)
tree50b054df34d2731eb0ba0cf1a6c27e43e7eed428 /arch/sparc/mm/extable.c
parent7a0aeb14e18ad59394bd9bbc6e57fb345819e748 (diff)
parent45e3e1935e2857c54783291107d33323b3ef33c8 (diff)
Merge commit 'linus/master' into HEAD
Conflicts: MAINTAINERS Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
Diffstat (limited to 'arch/sparc/mm/extable.c')
-rw-r--r--arch/sparc/mm/extable.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/sparc/mm/extable.c b/arch/sparc/mm/extable.c
index 16cc28935e39..a61c349448e1 100644
--- a/arch/sparc/mm/extable.c
+++ b/arch/sparc/mm/extable.c
@@ -28,6 +28,10 @@ search_extable(const struct exception_table_entry *start,
28 * word 3: last insn address + 4 bytes 28 * word 3: last insn address + 4 bytes
29 * word 4: fixup code address 29 * word 4: fixup code address
30 * 30 *
31 * Deleted entries are encoded as:
32 * word 1: unused
33 * word 2: -1
34 *
31 * See asm/uaccess.h for more details. 35 * See asm/uaccess.h for more details.
32 */ 36 */
33 37
@@ -39,6 +43,10 @@ search_extable(const struct exception_table_entry *start,
39 continue; 43 continue;
40 } 44 }
41 45
46 /* A deleted entry; see trim_init_extable */
47 if (walk->fixup == -1)
48 continue;
49
42 if (walk->insn == value) 50 if (walk->insn == value)
43 return walk; 51 return walk;
44 } 52 }
@@ -57,6 +65,27 @@ search_extable(const struct exception_table_entry *start,
57 return NULL; 65 return NULL;
58} 66}
59 67
68#ifdef CONFIG_MODULES
69/* We could memmove them around; easier to mark the trimmed ones. */
70void trim_init_extable(struct module *m)
71{
72 unsigned int i;
73 bool range;
74
75 for (i = 0; i < m->num_exentries; i += range ? 2 : 1) {
76 range = m->extable[i].fixup == 0;
77
78 if (within_module_init(m->extable[i].insn, m)) {
79 m->extable[i].fixup = -1;
80 if (range)
81 m->extable[i+1].fixup = -1;
82 }
83 if (range)
84 i++;
85 }
86}
87#endif /* CONFIG_MODULES */
88
60/* Special extable search, which handles ranges. Returns fixup */ 89/* Special extable search, which handles ranges. Returns fixup */
61unsigned long search_extables_range(unsigned long addr, unsigned long *g2) 90unsigned long search_extables_range(unsigned long addr, unsigned long *g2)
62{ 91{