[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <86802c440810010921v3681d5f2gf1726e4f5ed36cc4@mail.gmail.com>
Date: Wed, 1 Oct 2008 09:21:23 -0700
From: "Yinghai Lu" <yinghai@...nel.org>
To: "Linus Torvalds" <torvalds@...ux-foundation.org>
Cc: "Grant Grundler" <grundler@...isc-linux.org>,
"Ingo Molnar" <mingo@...e.hu>,
"Arjan van de Ven" <arjan@...radead.org>,
"Rene Herman" <rene.herman@...access.nl>,
"Bjorn Helgaas" <bjorn.helgaas@...com>,
"Jesse Barnes" <jbarnes@...tuousgeek.org>,
"Len Brown" <lenb@...nel.org>, "Frans Pop" <elendil@...net.nl>,
"Rafael J. Wysocki" <rjw@...k.pl>,
"Linux Kernel Mailing List" <linux-kernel@...r.kernel.org>,
linux-pci@...r.kernel.org, linux-acpi@...r.kernel.org,
"Adam Belay" <abelay@....edu>, "Avuton Olrich" <avuton@...il.com>,
"Karl Bellve" <karl.bellve@...ssmed.edu>,
"Willem Riede" <wriede@...de.org>,
"Matthew Hall" <mhall@...omputing.net>,
"Sam Ravnborg" <sam@...nborg.org>
Subject: Re: [patch 2/2] PNP: don't check disabled PCI BARs for conflicts in quirk_system_pci_resources()
On Wed, Oct 1, 2008 at 8:14 AM, Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
>
> and instead do
>
> initcall(pci_init, "pci");
> ..
> initcall(pnp_init, "pnp");
>
> and then just list the levels for the linker scripts in one place. So that
> we wouldn't really have to worry about link ordering: if the link ordering
> is wrong, we just add a new initcall level and insert it in the right
> place, and then we can look at the ordering and see it explicitly in one
> place instead of looking at the makefiles and checking the order we add
> object files to the list in!
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists