source: GPL/trunk/include/linux/module.h@ 679

Last change on this file since 679 was 679, checked in by David Azarewicz, 4 years ago

Merge changes from Paul's uniaud32next branch.

File size: 3.1 KB
Line 
1/*
2 * Dynamic loading of modules into the kernel.
3 *
4 * Rewritten by Richard Henderson <rth@tamu.edu> Dec 1996
5 */
6
7#ifndef _LINUX_MODULE_H
8#define _LINUX_MODULE_H
9
10#include <linux/list.h>
11#include <linux/compiler.h>
12#include <linux/kmod.h>
13#include <linux/init.h>
14#include <linux/string.h>
15#include <linux/kobject.h>
16#include <linux/moduleparam.h>
17#include <linux/export.h>
18
19/* Poke the use count of a module. */
20
21#define __MOD_DEC_USE_COUNT(mod) \
22 do {} while(0);
23
24#define MOD_INC_USE_COUNT
25#define MOD_DEC_USE_COUNT
26#define MOD_IN_USE
27
28#define EXPORT_NO_SYMBOLS
29
30#define __MODULE_STRING_1(x) #x
31#define __MODULE_STRING(x) __MODULE_STRING_1(x)
32
33/* For documentation purposes only. */
34
35#define MODULE_AUTHOR(name)
36
37#define MODULE_DESCRIPTION(desc)
38
39/* Could potentially be used by kmod... */
40
41#define MODULE_SUPPORTED_DEVICE(dev)
42
43/* Used to verify parameters given to the module. The TYPE arg should
44 be a string in the following format:
45 [min[-max]]{b,h,i,l,s}
46 The MIN and MAX specifiers delimit the length of the array. If MAX
47 is omitted, it defaults to MIN; if both are omitted, the default is 1.
48 The final character is a type specifier:
49 b byte
50 h short
51 i int
52 l long
53 s string
54*/
55
56#ifdef TARGET_OS2
57#define MODULE_LICENSE(a)
58#else
59#define MODULE_PARM(var,type) \
60const char __module_parm_##var[]= \
61"parm_" __MODULE_STRING(var) "=" type
62
63#define MODULE_PARM_DESC(var,desc) \
64const char __module_parm_desc_##var[]= \
65"parm_desc_" __MODULE_STRING(var) "=" desc
66#endif
67
68#define try_inc_mod_count(x) ++(*(unsigned long *)x)
69#define try_module_get(x) try_inc_mod_count(x)
70static inline void module_put(struct module *module)
71{
72 if (module)
73 do {} while(0);
74}
75
76#define MODULE_FIRMWARE(x)
77#define MODULE_ALIAS(x)
78
79#define MODULE_GENERIC_TABLE(gtype,name)
80#define MODULE_DEVICE_TABLE(type,name)
81#define MODULE_ALIAS_CHARDEV(x)
82#define module_param(name, type, perm)
83
84/**
85 * module_driver() - Helper macro for drivers that don't do anything
86 * special in module init/exit. This eliminates a lot of boilerplate.
87 * Each module may only use this macro once, and calling it replaces
88 * module_init() and module_exit().
89 *
90 * @__driver: driver name
91 * @__register: register function for this driver type
92 * @__unregister: unregister function for this driver type
93 * @...: Additional arguments to be passed to __register and __unregister.
94 *
95 * Use this macro to construct bus specific macros for registering
96 * drivers, and do not use it on its own.
97 */
98#define module_driver(__driver, __register, __unregister, ...) \
99static int __init __driver##_init(void) \
100{ \
101 return __register(&__driver, ##__VA_ARGS__); \
102} \
103module_init(__driver##_init); \
104static void __exit __driver##_exit(void) \
105{ \
106 __unregister(&__driver, ##__VA_ARGS__); \
107} \
108module_exit(__driver##_exit);
109#define symbol_put_addr(p) do { } while (0)
110#define postcore_initcall(fn) module_init(fn)
111
112#define MODULE_NAME_LEN 255
113
114struct module {
115 /* Unique handle for this module */
116 char name[MODULE_NAME_LEN];
117};
118#endif /* _LINUX_MODULE_H */
Note: See TracBrowser for help on using the repository browser.