forked from Minki/linux
Autogenerated GPG tag for Rusty D1ADB8F1: 15EE 8D6C AB0E 7F0C F999 BFCB D920 0E6C D1AD B8F1
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAABAgAGBQJPSsdkAAoJENkgDmzRrbjxHQUP/RxiMxjwoX4Q/Fzrapg1fkag 0ZhZ2N9w/6AwIGF/IAqiX4BRYJueI3+LJp4W7kwKQTBTn9L1DEvw1i6htBhci25P uW6ki1fJZh9ewT4FbMAkA7uapqloijfQoFEt0dsWlSMgzh+RqfVNDIhILsKaYCey uFnRWrPPyB1vW0ofiB7j4LrEuRnEsitsg42Zqdpq4mX4t/cPfP4uZvvB0za6IxLV MhPSyJ2cuuEtdIs/6DhrftDImu0k7Tbd3Jvsf7DmkF0wZOV5mCWRuroRq8kJWvzP oJhv4DhHL8uLkqj3ljqkrKaSqQ+e1OVE0dq8bbA/3WRK8L1V94C53bTYcGuYnByN reIXx5l4GeqDTi+SBMug3bXtrakv3pq92cBVmc4ERwtBPVObGU6Tljgdke05MF8j i7Kg1bUYX3v3zyj5mVoCflpc5OXUcwA4CFn5mV6zHNNFvEbWQaQLnDTXDGihgjgd Xl8W58V4yOqbXWpjnT09g934Vt1GuFrhraulbeo128bPUyg+CpMCh5cMdJIfSFxg Rti7xLeXHm6D+7B5VpvA574k6Ah9HtCkbLSy/W0Wxa/3ckPHW2QYHWM3Sq1kBz2B TH6sXLgJor1P8M64tiZsoF/VMvdWmBth3ZwOU1ggVZvtMGkqDkxqkkQxw7Cql579 o1NSSN/cyWlrcymWY02h =Rmyt -----END PGP SIGNATURE----- Merge tag 'for-linus' of git://github.com/rustyrussell/linux * tag 'for-linus' of git://github.com/rustyrussell/linux: mod/file2alias: make modpost compile on darwin again
This commit is contained in:
commit
f6bd5798f3
@ -46,11 +46,37 @@ struct devtable {
|
||||
void *function;
|
||||
};
|
||||
|
||||
#define ___cat(a,b) a ## b
|
||||
#define __cat(a,b) ___cat(a,b)
|
||||
|
||||
/* we need some special handling for this host tool running eventually on
|
||||
* Darwin. The Mach-O section handling is a bit different than ELF section
|
||||
* handling. The differnces in detail are:
|
||||
* a) we have segments which have sections
|
||||
* b) we need a API call to get the respective section symbols */
|
||||
#if defined(__MACH__)
|
||||
#include <mach-o/getsect.h>
|
||||
|
||||
#define INIT_SECTION(name) do { \
|
||||
unsigned long name ## _len; \
|
||||
char *__cat(pstart_,name) = getsectdata("__TEXT", \
|
||||
#name, &__cat(name,_len)); \
|
||||
char *__cat(pstop_,name) = __cat(pstart_,name) + \
|
||||
__cat(name, _len); \
|
||||
__cat(__start_,name) = (void *)__cat(pstart_,name); \
|
||||
__cat(__stop_,name) = (void *)__cat(pstop_,name); \
|
||||
} while (0)
|
||||
#define SECTION(name) __attribute__((section("__TEXT, " #name)))
|
||||
|
||||
struct devtable **__start___devtable, **__stop___devtable;
|
||||
#else
|
||||
#define INIT_SECTION(name) /* no-op for ELF */
|
||||
#define SECTION(name) __attribute__((section(#name)))
|
||||
|
||||
/* We construct a table of pointers in an ELF section (pointers generally
|
||||
* go unpadded by gcc). ld creates boundary syms for us. */
|
||||
extern struct devtable *__start___devtable[], *__stop___devtable[];
|
||||
#define ___cat(a,b) a ## b
|
||||
#define __cat(a,b) ___cat(a,b)
|
||||
#endif /* __MACH__ */
|
||||
|
||||
#if __GNUC__ == 3 && __GNUC_MINOR__ < 3
|
||||
# define __used __attribute__((__unused__))
|
||||
@ -65,8 +91,8 @@ extern struct devtable *__start___devtable[], *__stop___devtable[];
|
||||
(type *)NULL, \
|
||||
(char *)NULL)), \
|
||||
sizeof(type), (function) }; \
|
||||
static struct devtable *__attribute__((section("__devtable"))) \
|
||||
__used __cat(devtable_ptr,__LINE__) = &__cat(devtable,__LINE__)
|
||||
static struct devtable *SECTION(__devtable) __used \
|
||||
__cat(devtable_ptr,__LINE__) = &__cat(devtable,__LINE__)
|
||||
|
||||
#define ADD(str, sep, cond, field) \
|
||||
do { \
|
||||
@ -1080,6 +1106,7 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
|
||||
do_pnp_card_entries(symval, sym->st_size, mod);
|
||||
else {
|
||||
struct devtable **p;
|
||||
INIT_SECTION(__devtable);
|
||||
|
||||
for (p = __start___devtable; p < __stop___devtable; p++) {
|
||||
if (sym_is(name, namelen, (*p)->device_id)) {
|
||||
|
Loading…
Reference in New Issue
Block a user