On Wed, Oct 1, 2008 at 8:14 AM, Linus Torvalds <torvalds@linux-foundation.org> wrote:don't need to think linking order. could reorder them in the run time. struct init_call_st { int level; char *name; initcall_t call; }; #define INIT_CALL(nameX, levelX, callX) \ static struct init_call_st __init_call_##nameX __initdata = \ { .name = nameX,\ .level = levelX,\ .call = callX,\ }; \ static struct init_call_st *__init_call_ptr_##nameX __used \ __attribute__((__section__(".init_call.init"))) = \ &__init_call_##nameX in vmlinux.lds.h #define INIT_CALL_INIT(align) \ . = ALIGN((align)); \ .init_call.init : AT(ADDR(.init_call.init) - LOAD_OFFSET) { \ VMLINUX_SYMBOL(__init_call_start) = .; \ *(.init_call.init) \ VMLINUX_SYMBOL(__init_call_end) = .; \ } let arch vmlinux.lds.S to have INIT_CALL_INIT(8) and init/main.c void __init do_init_calls(void) { struct init_call_st **daa; char *ptr; /* sort it?, prescan... */ for (daa = __init_call_start ; daa < __init_call_end; daa++) { struct init_call_st *da = *daa; ... } for (daa = __init_call_start ; daa < __init_call_end; daa++) { struct dyn_array *da = *daa; ... da->call(); } YH --
| Andrea Arcangeli | [PATCH 00 of 12] mmu notifier #v13 |
| Eric W. Biederman | Remaining straight forward kthread API conversions... |
| Eric Paris | Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interface for on access scan... |
| Trond Myklebust | Re: Announce: Linux-next (Or Andrew's dream :-)) |
git: | |
| Gerrit Renker | [PATCH 0/37] dccp: Feature negotiation - last call for comments |
| David Miller | [GIT]: Networking |
| Herbert Xu | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Alexey Dobriyan | [PATCH 04/33] Fix {ip,6}_route_me_harder() in netns |
