From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: Matt Mackall <mpm@selenic.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
Linux-tiny@selenic.com, Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
Thomas Gleixner <tglx@linutronix.de>,
michael@free-electrons.com
Subject: Re: [RFC] [PATCH] x86: Use ELF section to list CPU vendor specific code (Linux Tiny)
Date: Mon, 25 Feb 2008 18:53:58 +0100 [thread overview]
Message-ID: <20080225185358.19fff688@crazy> (raw)
In-Reply-To: <1203958992.7461.46.camel@cinder.waste.org>
[-- Attachment #1: Type: text/plain, Size: 1542 bytes --]
Le Mon, 25 Feb 2008 09:03:12 -0800,
Matt Mackall <mpm@selenic.com> a écrit :
> > > This is not quite what Peter and I were thinking of, I think.
> > > It's not at all generic. How about a section that simply contains
> > > a set of function pointers, a macro to add things to that
> > > section, and a function that calls all the pointers in that
> > > section. Eg:
> > >
> > > CALLBACK_SECTION(init_cpu_amd, "cpuvendor.init");
> > > invoke_callback_section("cpuvendor.init");
> > >
> > > ..which would give us a generic facility we could use in various
> > > places.
> >
> > I see. Probably doable. How would it work in the LD script file ?
> > Your mechanism allows to specify any section name, but AFAIK, the
> > sections must be explicitly listed in the kernel LD script in order
> > to be included in the final kernel image. Am I missing something ?
>
> I can't see any way to avoid it, but we can leave it to future
> generations to come up with something more clever.
After a quick look at the LD documentation, it seems that wildcards are
supported in the input section names of the linker script. So that the
CALLBACK_SECTION() macro could add the function pointer to a section
named:
gcm. ## name
(gcm standing for "generic callback mechanism") and then, in the linker
script, do:
*(gcm.*)
I'm going to try that.
Sincerly,
Thomas
--
Thomas Petazzoni, Free Electrons
Free Embedded Linux Training Materials
on http://free-electrons.com/training
(More than 1500 pages!)
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2008-02-25 17:54 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-08 22:47 [PATCH] x86 (Linux Tiny): configure out support for some processors Michael Opdenacker
2008-02-08 23:04 ` H. Peter Anvin
2008-02-08 23:11 ` Ingo Molnar
2008-02-09 9:31 ` Michael Opdenacker
2008-02-11 22:42 ` Michael Opdenacker
2008-02-11 22:56 ` Matt Mackall
2008-02-11 23:01 ` H. Peter Anvin
2008-02-11 23:28 ` Matt Mackall
2008-02-12 0:54 ` H. Peter Anvin
2008-02-12 1:15 ` Matt Mackall
2008-02-15 11:00 ` [RFC] [PATCH] x86: Use ELF section to list CPU vendor specific code (Linux Tiny) Thomas Petazzoni
2008-02-17 18:14 ` Ingo Molnar
2008-02-17 19:46 ` H. Peter Anvin
2008-02-23 2:43 ` Matt Mackall
2008-02-23 3:19 ` H. Peter Anvin
2008-02-25 8:29 ` Thomas Petazzoni
2008-02-25 17:03 ` Matt Mackall
2008-02-25 17:53 ` Thomas Petazzoni [this message]
2008-02-25 17:58 ` Matt Mackall
2008-02-11 22:59 ` [PATCH] x86 (Linux Tiny): configure out support for some processors H. Peter Anvin
2008-02-08 23:20 ` Matt Mackall
2008-02-09 8:30 ` Simon Holm Thøgersen
2008-02-09 9:29 ` Michael Opdenacker
2008-02-09 10:05 ` Simon Holm Thøgersen
2008-02-09 21:35 ` H. Peter Anvin
2008-02-09 9:26 ` Michael Opdenacker
2008-02-09 3:48 ` Taral
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080225185358.19fff688@crazy \
--to=thomas.petazzoni@free-electrons.com \
--cc=Linux-tiny@selenic.com \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=michael@free-electrons.com \
--cc=mingo@elte.hu \
--cc=mpm@selenic.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.