1/**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 **************************************************************************** 11 ****************************************************************************/ 12#ifndef _LINUX_MODULE_H 13#define _LINUX_MODULE_H 14 15#include <linux/sched.h> 16#include <linux/spinlock.h> 17#include <linux/list.h> 18#include <linux/stat.h> 19#include <linux/compiler.h> 20#include <linux/cache.h> 21#include <linux/kmod.h> 22#include <linux/elf.h> 23#include <linux/stringify.h> 24#include <linux/kobject.h> 25#include <linux/moduleparam.h> 26#include <asm/local.h> 27 28#include <asm/module.h> 29 30#define MODULE_SUPPORTED_DEVICE(name) 31 32#ifndef MODULE_SYMBOL_PREFIX 33#define MODULE_SYMBOL_PREFIX "" 34#endif 35 36#define MODULE_NAME_LEN (64 - sizeof(unsigned long)) 37 38struct kernel_symbol 39{ 40 unsigned long value; 41 const char *name; 42}; 43 44struct modversion_info 45{ 46 unsigned long crc; 47 char name[MODULE_NAME_LEN]; 48}; 49 50struct module; 51 52struct module_attribute { 53 struct attribute attr; 54 ssize_t (*show)(struct module_attribute *, struct module *, char *); 55 ssize_t (*store)(struct module_attribute *, struct module *, 56 const char *, size_t count); 57 void (*setup)(struct module *, const char *); 58 int (*test)(struct module *); 59 void (*free)(struct module *); 60}; 61 62struct module_kobject 63{ 64 struct kobject kobj; 65 struct module *mod; 66}; 67 68struct exception_table_entry; 69 70#ifdef MODULE 71#define MODULE_GENERIC_TABLE(gtype,name) extern const struct gtype##_id __mod_##gtype##_table __attribute__ ((unused, alias(__stringify(name)))) 72 73#define THIS_MODULE (&__this_module) 74#else 75#define MODULE_GENERIC_TABLE(gtype,name) 76#define THIS_MODULE ((struct module *)0) 77#endif 78 79#define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info) 80 81#define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias) 82 83#define MODULE_LICENSE(_license) MODULE_INFO(license, _license) 84 85#define MODULE_AUTHOR(_author) MODULE_INFO(author, _author) 86 87#define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description) 88 89#define MODULE_PARM_DESC(_parm, desc) __MODULE_INFO(parm, _parm, #_parm ":" desc) 90 91#define MODULE_DEVICE_TABLE(type,name) MODULE_GENERIC_TABLE(type##_device,name) 92 93#define MODULE_VERSION(_version) MODULE_INFO(version, _version) 94 95struct notifier_block; 96 97#define EXPORT_SYMBOL(sym) 98#define EXPORT_SYMBOL_GPL(sym) 99#define EXPORT_SYMBOL_GPL_FUTURE(sym) 100#define EXPORT_UNUSED_SYMBOL(sym) 101#define EXPORT_UNUSED_SYMBOL_GPL(sym) 102 103#define symbol_get(x) ({ extern typeof(x) x __attribute__((weak)); &(x); }) 104#define symbol_put(x) do { } while(0) 105#define symbol_put_addr(x) do { } while(0) 106#define module_name(mod) "kernel" 107#define __unsafe(mod) 108#define module_put_and_exit(code) do_exit(code) 109 110struct module; 111 112#define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:" #x) 113#define __MODULE_STRING(x) __stringify(x) 114#endif 115