Commit cd8963f8 authored by David S. Miller's avatar David S. Miller

[SPARC]: More new modules work.

parent 33e0ed9c
...@@ -62,7 +62,7 @@ extern spinlock_t modlist_lock; ...@@ -62,7 +62,7 @@ extern spinlock_t modlist_lock;
unsigned long unsigned long
search_exception_table(unsigned long addr, unsigned long *g2) search_exception_table(unsigned long addr, unsigned long *g2)
{ {
unsigned long ret = 0, flags; unsigned long ret = 0;
#ifndef CONFIG_MODULES #ifndef CONFIG_MODULES
/* There is only the kernel to search. */ /* There is only the kernel to search. */
...@@ -70,15 +70,19 @@ search_exception_table(unsigned long addr, unsigned long *g2) ...@@ -70,15 +70,19 @@ search_exception_table(unsigned long addr, unsigned long *g2)
__stop___ex_table-1, addr, g2); __stop___ex_table-1, addr, g2);
return ret; return ret;
#else #else
/* The kernel is the last "module" -- no need to treat it special. */ unsigned long flags;
struct module *mp; struct list_head *i;
/* The kernel is the last "module" -- no need to treat it special. */
spin_lock_irqsave(&modlist_lock, flags); spin_lock_irqsave(&modlist_lock, flags);
for (mp = module_list; mp != NULL; mp = mp->next) { list_for_each(i, &extables) {
if (mp->ex_table_start == NULL || !(mp->flags & (MOD_RUNNING | MOD_INITIALIZING))) struct exception_table *ex =
list_entry(i, struct exception_table, list);
if (ex->num_entries == 0)
continue; continue;
ret = search_one_table(mp->ex_table_start, ret = search_one_table(ex->entry,
mp->ex_table_end-1, addr, g2); ex->entry + ex->num_entries - 1,
addr, g2);
if (ret) if (ret)
break; break;
} }
......
...@@ -5265,7 +5265,7 @@ int register_ioctl32_conversion(unsigned int cmd, int (*handler)(unsigned int, u ...@@ -5265,7 +5265,7 @@ int register_ioctl32_conversion(unsigned int cmd, int (*handler)(unsigned int, u
{ {
int i; int i;
if (!additional_ioctls) { if (!additional_ioctls) {
additional_ioctls = module_map(PAGE_SIZE); additional_ioctls = vmalloc(PAGE_SIZE);
if (!additional_ioctls) if (!additional_ioctls)
return -ENOMEM; return -ENOMEM;
memset(additional_ioctls, 0, PAGE_SIZE); memset(additional_ioctls, 0, PAGE_SIZE);
......
...@@ -62,7 +62,7 @@ extern spinlock_t modlist_lock; ...@@ -62,7 +62,7 @@ extern spinlock_t modlist_lock;
unsigned long unsigned long
search_exception_table(unsigned long addr, unsigned long *g2) search_exception_table(unsigned long addr, unsigned long *g2)
{ {
unsigned long ret = 0, flags; unsigned long ret = 0;
#ifndef CONFIG_MODULES #ifndef CONFIG_MODULES
/* There is only the kernel to search. */ /* There is only the kernel to search. */
...@@ -70,15 +70,19 @@ search_exception_table(unsigned long addr, unsigned long *g2) ...@@ -70,15 +70,19 @@ search_exception_table(unsigned long addr, unsigned long *g2)
__stop___ex_table-1, addr, g2); __stop___ex_table-1, addr, g2);
return ret; return ret;
#else #else
/* The kernel is the last "module" -- no need to treat it special. */ unsigned long flags;
struct module *mp; struct list_head *i;
/* The kernel is the last "module" -- no need to treat it special. */
spin_lock_irqsave(&modlist_lock, flags); spin_lock_irqsave(&modlist_lock, flags);
for (mp = module_list; mp != NULL; mp = mp->next) { list_for_each(i, &extables) {
if (mp->ex_table_start == NULL || !(mp->flags & (MOD_RUNNING | MOD_INITIALIZING))) struct exception_table *ex =
list_entry(i, struct exception_table, list);
if (ex->num_entries == 0)
continue; continue;
ret = search_one_table(mp->ex_table_start, ret = search_one_table(ex->entry,
mp->ex_table_end-1, addr, g2); ex->entry + ex->num_entries - 1,
addr, g2);
if (ret) if (ret)
break; break;
} }
......
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