summaryrefslogtreecommitdiff
path: root/include/linux/module.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@nuts.ninka.net>2003-07-20 08:52:43 -0700
committerDavid S. Miller <davem@nuts.ninka.net>2003-07-20 08:52:43 -0700
commit764cf56e6ddb2a5ed92b73cf6e0b71f611302273 (patch)
treee2a7855e76914435e3f91a16304b0b48590e919b /include/linux/module.h
parentd7cd83673b6a522b47586cf8d09144caadcef396 (diff)
parent50692f8c6b6a27ffed9b5b7206ca6682a60ff354 (diff)
Merge nuts.ninka.net:/home/davem/src/BK/network-2.5
into nuts.ninka.net:/home/davem/src/BK/net-2.5
Diffstat (limited to 'include/linux/module.h')
-rw-r--r--include/linux/module.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/include/linux/module.h b/include/linux/module.h
index 1d48f23a8a6a..13ff244afdbf 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -16,6 +16,7 @@
#include <linux/kmod.h>
#include <linux/elf.h>
#include <linux/stringify.h>
+#include <asm/local.h>
#include <asm/module.h>
@@ -171,7 +172,7 @@ void *__symbol_get_gpl(const char *symbol);
struct module_ref
{
- atomic_t count;
+ local_t count;
} ____cacheline_aligned;
enum module_state
@@ -276,19 +277,17 @@ struct module *module_get_kallsym(unsigned int symnum,
char *type,
char namebuf[128]);
int is_exported(const char *name, const struct module *mod);
-#ifdef CONFIG_MODULE_UNLOAD
+extern void __module_put_and_exit(struct module *mod, long code)
+ __attribute__((noreturn));
+#define module_put_and_exit(code) __module_put_and_exit(THIS_MODULE, code);
+
+#ifdef CONFIG_MODULE_UNLOAD
unsigned int module_refcount(struct module *mod);
void __symbol_put(const char *symbol);
#define symbol_put(x) __symbol_put(MODULE_SYMBOL_PREFIX #x)
void symbol_put_addr(void *addr);
-/* We only need protection against local interrupts. */
-#ifndef __HAVE_ARCH_LOCAL_INC
-#define local_inc(x) atomic_inc(x)
-#define local_dec(x) atomic_dec(x)
-#endif
-
/* Sometimes we know we already have a refcount, and it's easier not
to handle the error case (which only happens with rmmod --wait). */
static inline void __module_get(struct module *module)
@@ -445,6 +444,8 @@ static inline int unregister_module_notifier(struct notifier_block * nb)
return 0;
}
+#define module_put_and_exit(code) do_exit(code)
+
#endif /* CONFIG_MODULES */
#ifdef MODULE