From: Matthew Wilcox <matthew@wil.cx>
To: James Bottomley <James.Bottomley@SteelEye.com>
Cc: SCSI Mailing List <linux-scsi@vger.kernel.org>,
linux-kernel@vger.kernel.org
Subject: iomapping a big endian area
Date: Sun, 3 Apr 2005 02:37:57 +0100 [thread overview]
Message-ID: <20050403013757.GB24234@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <1112475134.5786.29.camel@mulgrave>
On Sat, Apr 02, 2005 at 02:52:14PM -0600, James Bottomley wrote:
> This driver has had it's own different infrastructure for doing this for
> ages, but it's time it used the common one.
Thanks. I'd been looking at this for a while but hadn't got round tuit yet.
> #ifdef CONFIG_53C700_LE_ON_BE
> #define bE (hostdata->force_le_on_be ? 0 : 3)
> #define bSWAP (hostdata->force_le_on_be)
> +/* This is terrible, but there's no raw version of ioread32. That means
> + * that on a be board we swap twice (once in ioread32 and once again to
> + * get the value correct) */
> +#define bS_to_io(x) ((hostdata->force_le_on_be) ? (x) : cpu_to_le32(x))
I raised this with Linus back when he did the original iomap() stuff.
Unfortunately, I think he ignored the question ;-)
My thought on this is that we should encode the endianness of the
registers in the ioremap cookie. Some architectures (sparc, I think?) can
do this in their PTEs. The rest of us can do it in our ioread/writeN
methods. I've planned for this in the parisc iomap implementation but
not actually implemented it.
It doesn't look too hard so I'll commit something to the parisc tree
later that'll let you iomap a BE area. Do we have any cards that need to be
accessed in a BE way on a LE machine? (ie x86)
--
"Next the statesmen will invent cheap lies, putting the blame upon
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince
himself that the war is just, and will thank God for the better sleep
he enjoys after this process of grotesque self-deception." -- Mark Twain
next parent reply other threads:[~2005-04-03 1:38 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1112475134.5786.29.camel@mulgrave>
2005-04-03 1:37 ` Matthew Wilcox [this message]
2005-04-03 2:38 ` David S. Miller
2005-04-03 3:10 ` Matthew Wilcox
2005-04-03 3:40 ` James Bottomley
2005-04-03 4:08 ` David S. Miller
2005-04-03 4:27 ` James Bottomley
2005-04-04 7:50 ` Benjamin Herrenschmidt
2005-04-04 13:59 ` James Bottomley
2005-04-04 14:16 ` Christoph Hellwig
2005-04-04 14:25 ` James Bottomley
2005-04-07 23:57 ` Jesse Barnes
2005-04-04 14:22 ` Randy.Dunlap
2005-04-04 23:41 ` Benjamin Herrenschmidt
2005-04-04 15:41 ` David Vrabel
2005-04-04 16:00 ` Richard B. Johnson
2005-04-04 16:52 ` David Vrabel
2005-04-04 18:57 ` James Bottomley
2005-04-04 19:03 ` David S. Miller
2005-04-04 23:43 ` Benjamin Herrenschmidt
2005-04-04 7:49 ` Benjamin Herrenschmidt
2005-04-05 7:42 ` Russell King
2005-04-05 14:05 ` James Bottomley
2005-04-05 18:55 ` Russell King
2005-04-05 20:02 ` Maciej W. Rozycki
2005-04-04 21:17 ` James Bottomley
2005-04-05 7:21 ` Christoph Hellwig
2005-04-05 14:05 ` James Bottomley
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=20050403013757.GB24234@parcelfarce.linux.theplanet.co.uk \
--to=matthew@wil.cx \
--cc=James.Bottomley@SteelEye.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@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
all inboxes | Powered by JetHome®