linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: James Hogan <james.hogan@imgtec.com>
Cc: linux-arch@vger.kernel.org, linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] [PATCH] asm-generic/unistd.h: handle symbol prefixes in cond_syscall
Date: Fri, 24 Feb 2012 14:23:19 +0000	[thread overview]
Message-ID: <201202241423.19775.arnd@arndb.de> (raw)
In-Reply-To: <4F47981F.4020305@imgtec.com>

On Friday 24 February 2012, James Hogan wrote:
> Some architectures have symbol prefixes and set CONFIG_SYMBOL_PREFIX,
> but this wasn't taken into account by the generic cond_syscall. It's
> easy enough to fix in a generic fashion, so add the symbol prefix to
> symbol names in cond_syscall when CONFIG_SYMBOL_PREFIX is set.
> 
> Signed-off-by: James Hogan <james.hogan@imgtec.com>
> ---
>  include/asm-generic/unistd.h |    9 ++++++++-
>  1 files changed, 8 insertions(+), 1 deletions(-)
> 
> diff --git a/include/asm-generic/unistd.h b/include/asm-generic/unistd.h
> index 2292d1a..c9a5ba4 100644
> --- a/include/asm-generic/unistd.h
> +++ b/include/asm-generic/unistd.h
> @@ -924,7 +924,14 @@ __SYSCALL(__NR_fork, sys_ni_syscall)
>   * but it doesn't work on all toolchains, so we just do it by hand
>   */
>  #ifndef cond_syscall
> -#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
> +#ifdef CONFIG_SYMBOL_PREFIX
> +#define __SYMBOL_PREFIX CONFIG_SYMBOL_PREFIX
> +#else
> +#define __SYMBOL_PREFIX
> +#endif
> +#define cond_syscall(x) asm(".weak\t" __SYMBOL_PREFIX #x "\n\t" \
> +                           ".set\t" __SYMBOL_PREFIX #x "," \
> +                           __SYMBOL_PREFIX "sys_ni_syscall")
>  #endif

Our trend is to move away from arch specific Kconfig symbols and __ARCH_HAS_*
macros towards just defining whatever you need in the architecture as an
override for the generic definition.

Just provide your own unistd.h that does

#define cond_syscall(x) asm(".weak\t." #x "\n\t.set\t." #x ",.sys_ni_syscall")
#include <asm-generic/unistd.h>

BTW, are you planning to submit arch/metag for inclusion? I've looked at
the code recently and it appears that you are on the right track overall,
and it shouldn't be too hard to get to the same quality level as
arch/openrisc.

	Arnd

  parent reply	other threads:[~2012-02-24 14:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-24 14:01 [RFC] [PATCH] asm-generic/unistd.h: handle symbol prefixes in cond_syscall James Hogan
2012-02-24 14:01 ` James Hogan
2012-02-24 14:23 ` Arnd Bergmann [this message]
2012-02-24 14:24 ` Arnd Bergmann
2012-02-24 14:24   ` Arnd Bergmann
2012-02-24 14:51   ` James Hogan
2012-02-24 15:09     ` Arnd Bergmann
2012-02-24 15:09       ` Arnd Bergmann
2012-02-24 15:40       ` James Hogan
2012-02-24 16:19   ` Mike Frysinger
2012-02-24 16:37     ` Arnd Bergmann
2012-02-24 16:38       ` Arnd Bergmann
2012-02-24 16:56         ` James Hogan
2012-02-24 16:41 ` Mike Frysinger

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=201202241423.19775.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=james.hogan@imgtec.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).