summaryrefslogtreecommitdiff
path: root/kernel/extable.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2003-01-05 16:53:06 -0800
committerLinus Torvalds <torvalds@home.transmeta.com>2003-01-05 16:53:06 -0800
commit8e4f2cd334e33240605c353c7fa10e3826a920b3 (patch)
treea8280dac1a38ab7fe5eeb7783cdb5f91d5aa2168 /kernel/extable.c
parent18f50759ad60959193f5e06201e0f96cf7d94da2 (diff)
[PATCH] Remove mod_bound macro and unify kernel_text_address().
Various archs (i386, m68k, s390, s390x, m68k, parisc, um, x86_64) implement kernel_text_address. Put this in kernel/extable.c, and the module iteration inside module.c. Other than cleanliness, this finally allows the module list and lock to be static to kernel/module.c (you didn't think I actually cared about those archs did you?) It also drops the module->init_size to zero when it's discarded, so bounds checking is simplified (and the /proc/modules size statistic will be more accurate, too).
Diffstat (limited to 'kernel/extable.c')
-rw-r--r--kernel/extable.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/kernel/extable.c b/kernel/extable.c
index b980aa1d52d7..388995324d1c 100644
--- a/kernel/extable.c
+++ b/kernel/extable.c
@@ -19,6 +19,7 @@
extern const struct exception_table_entry __start___ex_table[];
extern const struct exception_table_entry __stop___ex_table[];
+extern char _stext[], _etext[];
/* Given an address, look for it in the exception tables. */
const struct exception_table_entry *search_exception_tables(unsigned long addr)
@@ -30,3 +31,12 @@ const struct exception_table_entry *search_exception_tables(unsigned long addr)
e = search_module_extables(addr);
return e;
}
+
+int kernel_text_address(unsigned long addr)
+{
+ if (addr >= (unsigned long)_stext &&
+ addr <= (unsigned long)_etext)
+ return 1;
+
+ return module_text_address(addr);
+}