public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel•crashing.org>
To: Marcelo Tosatti <marcelo.tosatti@cyclades•com>
Cc: Paul Mackerras <paulus@samba•org>,
	linux-ppc-embedded <linuxppc-embedded@ozlabs•org>
Subject: Re: [PATCH] add big endian version of ld_/st_ IO access macros and convert main 8xx code to use it
Date: Thu, 08 Sep 2005 11:14:57 +1000	[thread overview]
Message-ID: <1126142097.29803.4.camel@gaston> (raw)
In-Reply-To: <20050908005135.GA8882@dmt.cnet>

> e is shared by all architectures. Doing something like
> 
> /*
>  * 8, 16 and 32 bit, big and little endian I/O operations, with barrier.
>  */
> extern inline int in_8(volatile unsigned char __iomem *addr)
> {
>         int ret;
> 
>         __asm__ __volatile__(
>                 "lbz%U1%X1 %0,%1;\n"
> #ifndef CONFIG_8xx
>                 "twi 0,%0,0;\n"
>                 "isync" : "=r" (ret) : "m" (*addr));
> #else
>                 : "=r" (ret) : "m" (*addr));
> #endif
>         return ret;
> }
> 
> Seems somewhat ugly?

Yes. You can work around that by macro-generating the functions with
different rules for different CPUs, or having the twi/isync be a
separate asm block that is itself in a macro or inline that gets defined
differently on 8xx

Ben.

      reply	other threads:[~2005-09-08  1:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-07 23:03 [PATCH] add big endian version of ld_/st_ IO access macros and convert main 8xx code to use it Marcelo Tosatti
2005-09-08  0:28 ` Benjamin Herrenschmidt
2005-09-08  0:42   ` Dan Malek
2005-09-08  0:55     ` Benjamin Herrenschmidt
2005-09-08  0:58     ` Marcelo Tosatti
2005-09-08  4:27       ` Paul Mackerras
2005-09-08 13:56         ` Dan Malek
2005-09-08 19:34         ` Marcelo Tosatti
2005-09-08  0:51   ` Marcelo Tosatti
2005-09-08  1:14     ` Benjamin Herrenschmidt [this message]

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=1126142097.29803.4.camel@gaston \
    --to=benh@kernel$(echo .)crashing.org \
    --cc=linuxppc-embedded@ozlabs$(echo .)org \
    --cc=marcelo.tosatti@cyclades$(echo .)com \
    --cc=paulus@samba$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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