Commit 743d380c authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

[PATCH] M68k module list updates

M68k module list updates, inspired by ia32 traps.c in 2.5.48
parent d4dd6eb9
......@@ -820,32 +820,43 @@ asmlinkage void buserr_c(struct frame *fp)
static int kstack_depth_to_print = 48;
extern struct module kernel_module;
extern char _stext, _etext;
#ifdef CONFIG_MODULES
/* FIXME: Accessed without a lock --RR */
extern struct list_head modules;
static inline int kernel_text_address(unsigned long addr)
{
#ifdef CONFIG_MODULES
struct module *mod;
#endif
extern char _stext, _etext;
if (addr >= (unsigned long) &_stext &&
addr <= (unsigned long) &_etext)
return 1;
#ifdef CONFIG_MODULES
for (mod = module_list; mod != &kernel_module; mod = mod->next) {
list_for_each_entry(mod, &modules, list) {
/* mod_bound tests for addr being inside the vmalloc'ed
* module area. Of course it'd be better to test only
* for the .text subset... */
if (mod_bound(addr, 0, mod))
if (mod_bound((void *)addr, 0, mod))
return 1;
}
#endif
return 0;
}
#else // !CONFIG_MODULES
static inline int kernel_text_address(unsigned long addr)
{
return (addr >= (unsigned long) &_stext &&
addr <= (unsigned long) &_etext);
}
#endif // !CONFIG_MODULES
void show_trace(unsigned long *stack)
{
unsigned long *endstack;
......
......@@ -33,23 +33,29 @@ search_one_table(const struct exception_table_entry *first,
unsigned long
search_exception_table(unsigned long addr)
{
unsigned long ret;
unsigned long ret = 0;
#ifndef CONFIG_MODULES
/* There is only the kernel to search. */
ret = search_one_table(__start___ex_table, __stop___ex_table-1, addr);
if (ret) return ret;
return ret;
#else
unsigned long flags;
struct list_head *i;
/* The kernel is the last "module" -- no need to treat it special. */
struct module *mp;
for (mp = module_list; mp != NULL; mp = mp->next) {
if (mp->ex_table_start == NULL)
spin_lock_irqsave(&modlist_lock, flags);
list_for_each(i, &extables) {
struct exception_table *ex
= list_entry(i, struct exception_table, list);
if (ex->num_entries == 0)
continue;
ret = search_one_table(mp->ex_table_start,
mp->ex_table_end-1, addr);
if (ret) return ret;
ret = search_one_table(ex->entry,
ex->entry + ex->num_entries - 1, addr);
if (ret)
break;
}
spin_unlock_irqrestore(&modlist_lock, flags);
return ret;
#endif
return 0;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment