From: Andrew Morton <akpm@linux-foundation.org>
To: Robin Getz <rgetz@blackfin.uclinux.org>
Cc: "Bryan Wu" <cooloney@kernel.org>,
pmarques@grupopie.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] kallsyms: Allow kernel symbols in L1 to be found in Blackfin architecture
Date: Wed, 30 Apr 2008 08:43:41 -0700 [thread overview]
Message-ID: <20080430084341.fbadff6c.akpm@linux-foundation.org> (raw)
In-Reply-To: <200804300951.43995.rgetz@blackfin.uclinux.org>
On Wed, 30 Apr 2008 09:51:43 -0400 Robin Getz <rgetz@blackfin.uclinux.org> wrote:
> On Tue 29 Apr 2008 18:00, Andrew Morton pondered:
> > That's a bit grubby. I suppose we could pretend not to have noticed,
> > but this really isn't the preferred way of putting arch-specific hooks into
> > arch-neutral code.
> >
> > Nicer might be to add
> >
> > void __weak arch_is_kernel_text(unsigned long addr)
> > {
> > return 0;
> > }
> >
> > with a declaration in linux/kallsyms.h and then override
> > arch_is_kernel_text() in arch/blackfin/ code.
>
> I will refactor, and send again.
>
Thanks.
There are of course lots of other ways of doing it, apart from __weak.
Many involve unpleasing ARCH_HAVE_FOO things.
Possibly cleaner would be, in kallsyms.c:
#ifndef arch_is_kernel_text
static inline int arch_is_kernel_text(unsigned long addr)
{
return 0;
}
#define arch_is_kernel_text(addr) arch_is_kernel_text(addr) // not really needed
#endif
and then, in a blackfin header file do
extern int arch_is_kernel_text(unsigned long addr);
#define arch_is_kernel_text(addr) arch_is_kernel_text(addr)
But personally I find all these party tricks a bit unpleasant. The
definitive approach to implementing a per-arch kernel->arch interface is to
just implement it, dammit. That means adding
static inline int arch_is_kernel_text(unsigned long addr)
{
return 0;
}
to every architecture's include/asm/kallsyms.h, then doing blackfin's one
differently.
Verbose, but complete.
next prev parent reply other threads:[~2008-04-30 15:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-25 10:28 [PATCH 0/2] kallsyms updates for Blackfin Bryan Wu
2008-04-25 10:28 ` [PATCH 1/2] kallsyms: Allow kernel symbols in L1 to be found in Blackfin architecture Bryan Wu
2008-04-28 19:01 ` Paulo Marques
2008-04-29 22:00 ` Andrew Morton
2008-04-30 13:51 ` Robin Getz
2008-04-30 15:43 ` Andrew Morton [this message]
2008-04-25 10:28 ` [PATCH 2/2] kallsyms: Nuke all ChangeLog, this should be logged by git Bryan Wu
2008-04-28 19:02 ` Paulo Marques
2008-04-28 18:59 ` [PATCH 0/2] kallsyms updates for Blackfin Paulo Marques
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=20080430084341.fbadff6c.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=cooloney@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmarques@grupopie.com \
--cc=rgetz@blackfin.uclinux.org \
/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.