Magellan Linux

Contents of /trunk/kernel26-alx/patches-2.6.33-r4/0301-2.6.33-create-module-export-inport-functions-for-macropairs.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1286 - (show annotations) (download)
Thu Feb 17 15:05:15 2011 UTC (13 years, 2 months ago) by niro
File size: 1463 byte(s)
2.6.33-alx-r4: enabled usbserial generic module for accu-chek II devices
1 From 027d03bb1245698cf5f7f0bba7239c742504c070 Mon Sep 17 00:00:00 2001
2 From: Tim Gardner <tim.gardner@canonical.com>
3 Date: Tue, 6 Oct 2009 17:28:34 -0600
4 Subject: [PATCH 1/1] UBUNTU: SAUCE: Created MODULE_EXPORT/MODULE_IMPORT macros
5
6 BugLink: http://bugs.launchpad.net/bugs/430694
7
8 Create a macro pair that can be used to symbolicly link two modules
9 if they are not already directly linked.
10 This relationship uses the facilities of depmod and modprobe to
11 get soft dependencies loaded in the correct order.
12
13 Examples of soft dependencies are:
14 1) i915 and intel_agp (agp _must_ be loaded before i915)
15 2) any net driver that uses phylib modules.
16
17 Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
18 ---
19 include/linux/module.h | 8 ++++++++
20 1 files changed, 8 insertions(+), 0 deletions(-)
21
22 diff --git a/include/linux/module.h b/include/linux/module.h
23 index 098bdb7..49f53f2 100644
24 --- a/include/linux/module.h
25 +++ b/include/linux/module.h
26 @@ -720,4 +720,12 @@ static inline int module_bug_finalize(const Elf_Ehdr *hdr,
27 static inline void module_bug_cleanup(struct module *mod) {}
28 #endif /* CONFIG_GENERIC_BUG */
29
30 +/*
31 + * Establish a symbolic link between 2 modules so that depmod
32 + * and modprobe do the heavy lifting of loading the modules in the
33 + * correct dependency order.
34 + */
35 +#define MODULE_EXPORT(mod_name) int mod_name; EXPORT_SYMBOL(mod_name);
36 +#define MODULE_IMPORT(mod_name) extern int mod_name;
37 +
38 #endif /* _LINUX_MODULE_H */
39 --
40 1.7.0.4
41