#include <linux/kmod.h>
#include <linux/elf.h>
#include <linux/stringify.h>
+#include <linux/kobject.h>
+#include <linux/moduleparam.h>
#include <asm/local.h>
#include <asm/module.h>
/* Not Yet Implemented */
#define MODULE_SUPPORTED_DEVICE(name)
-#define print_modules()
/* v850 toolchain uses a `_' prefix for all user symbols */
#ifndef MODULE_SYMBOL_PREFIX
MODULE_STATE_GOING,
};
+/* sysfs stuff */
+struct module_attribute
+{
+ struct attribute attr;
+ struct kernel_param *param;
+};
+
+struct module_kobject
+{
+ /* Everyone should have one of these. */
+ struct kobject kobj;
+
+ /* We always have refcnt, we may have others from module_param(). */
+ unsigned int num_attributes;
+ struct module_attribute attr[0];
+};
+
struct module
{
enum module_state state;
/* Unique handle for this module */
char name[MODULE_NAME_LEN];
+ /* Sysfs stuff. */
+ struct module_kobject *mkobj;
+
/* Exported symbols */
const struct kernel_symbol *syms;
unsigned int num_syms;
/* Destruction function. */
void (*exit)(void);
+
+ /* Fake kernel param for refcnt. */
+ struct kernel_param refcnt_param;
#endif
#ifdef CONFIG_KALLSYMS
int register_module_notifier(struct notifier_block * nb);
int unregister_module_notifier(struct notifier_block * nb);
+extern void print_modules(void);
#else /* !CONFIG_MODULES... */
#define EXPORT_SYMBOL(sym)
#define EXPORT_SYMBOL_GPL(sym)
#define module_put_and_exit(code) do_exit(code)
+static inline void print_modules(void)
+{
+}
#endif /* CONFIG_MODULES */
#define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:" #x)