linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Michal Simek <monstr@monstr.eu>
Cc: linux-arch@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: Using IO functions across ARM, PPC and Microblaze architectures
Date: Fri, 7 Dec 2012 21:16:06 +0000	[thread overview]
Message-ID: <20121207211606.6c5d5bc8@pyramind.ukuu.org.uk> (raw)
In-Reply-To: <CAHTX3d+VNDVQjnTnAB=Ywxo7odvNmCPu=wGZ03-xWLecSMsS9A@mail.gmail.com>

> Because I need to use IO functions which will behave
> on arm as little endian and on powerpc as big endian
> and on microblaze depends on endian setting.
> I haven't found any IO function which I could use by 3 architectures
> without using preprocessor macros or runtime detection

Its a rather weird mix. We can do "always big" and "always little"

> 1. Using helper function + preprocessor macros
> (using static inline function also possible)

Then someone comes along and sticks a daughterboard into the system with
the same device the other way around and there are years

> 2. Using function pointers

Probably smarter. 8250.c works this way and it has to handle some
extremely bizarre mappings.
 
> b) Runtime initialization - here is the question if there is
> any standard function which I could use.

Set the pointers up and pass them as data with your platform device, that
way the function definitions are buried in your platform code where they
depend.

Alan

  reply	other threads:[~2012-12-07 21:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-07 19:28 Using IO functions across ARM, PPC and Microblaze architectures Michal Simek
2012-12-07 21:16 ` Alan Cox [this message]
2012-12-08 10:57   ` Geert Uytterhoeven
2013-01-30 12:33     ` Michal Simek

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=20121207211606.6c5d5bc8@pyramind.ukuu.org.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=monstr@monstr.eu \
    /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).