From: "Kinney, Michael D" <michael.d.kinney@intel.com>
To: Leif Lindholm <leif.lindholm@linaro.org>,
"Gao, Liming" <liming.gao@intel.com>,
Laszlo Ersek <lersek@redhat.com>,
"Kinney, Michael D" <michael.d.kinney@intel.com>
Cc: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: [PATCH] MdePkg: add big-endian MMIO BaseBeIoLib
Date: Tue, 17 Apr 2018 15:20:32 +0000 [thread overview]
Message-ID: <E92EE9817A31E24EB0585FDF735412F5B89D3211@ORSMSX113.amr.corp.intel.com> (raw)
In-Reply-To: <20180417132649.wv7ql7xxfezzhxsl@bivouac.eciton.net>
Leif,
Yes. I think the single swap lib is sufficient for
the specific use case.
We can wait until there is a request to add support
for a BE CPU to look at a more complete solution to
reusing the same module sources for all combinations
of CPU and I/O endianness.
Thanks,
Mike
> -----Original Message-----
> From: Leif Lindholm [mailto:leif.lindholm@linaro.org]
> Sent: Tuesday, April 17, 2018 6:27 AM
> To: Kinney, Michael D <michael.d.kinney@intel.com>;
> Gao, Liming <liming.gao@intel.com>; Laszlo Ersek
> <lersek@redhat.com>
> Cc: edk2-devel@lists.01.org
> Subject: Re: [edk2] [PATCH] MdePkg: add big-endian MMIO
> BaseBeIoLib
>
> On Mon, Apr 16, 2018 at 10:42:26PM +0200, Laszlo Ersek
> wrote:
> > On 04/16/18 16:34, Michael Brown wrote:
> > > On 16/04/18 15:10, Kinney, Michael D wrote:
> > >> I agree that the opposite use case is a BE CPU
> > >> needing a LE operation.
> > >>
> > >> I think we only need a single lib class and lib
> > >> Instance that does the byte swap and we should
> > >> not use Le or Be in any of the names of the class,
> > >> instance, or APIs. Just "Swap".
> > >
> > > I may have misunderstood, but wouldn't using "Swap"
> within the API names
> > > effectively encode knowledge of the endianness of
> the _build_ platform
> > > into the source code? This would prevent the same
> source code being
> > > built for both little-endian and big-endian CPUs.
> >
> > Under this scenario, all drivers meant to be portable
> to both byte
> > orders would have to:
> > - link against both IoLib and IoSwapLib,
> > - determine at device binding time, from CPU
> endianness and device
> > endianness combined, whether swapping was needed
> for that device,
> > - call the IoLib or IoSwapLib APIs through wrapper
> functions, or
> > function pointers.
>
> Yes. I'm thinking that is a good enough solution for
> this type of
> situation and I overcomplicated things. Apologies for
> that.
>
> We are talking about the relatively unusual situation
> where an
> otherwise driver-compatible device can in some
> platforms be of a
> different endianness than in others.
>
> So, Mike, Liming - would you be OK with a solution
> similar to
> https://www.mail-archive.com/edk2-
> devel@lists.01.org/msg36520.html.
>
> /
> Leif
next prev parent reply other threads:[~2018-04-17 15:20 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-13 17:42 [PATCH] MdePkg: add big-endian MMIO BaseBeIoLib Leif Lindholm
2018-04-13 19:24 ` Kinney, Michael D
2018-04-13 19:31 ` Leif Lindholm
2018-04-13 23:32 ` Kinney, Michael D
2018-04-16 10:07 ` Leif Lindholm
2018-04-16 14:10 ` Kinney, Michael D
2018-04-16 14:34 ` Michael Brown
2018-04-16 20:42 ` Laszlo Ersek
2018-04-16 22:14 ` Michael Brown
2018-04-17 8:01 ` Laszlo Ersek
2018-04-17 8:24 ` Michael Brown
2018-04-17 9:57 ` Laszlo Ersek
2018-04-17 13:26 ` Leif Lindholm
2018-04-17 15:20 ` Kinney, Michael D [this message]
2018-04-17 6:57 ` Udit Kumar
2018-04-16 19:32 ` Laszlo Ersek
2018-04-17 8:15 ` Udit Kumar
2018-04-17 9:42 ` Laszlo Ersek
2018-04-17 10:32 ` Udit Kumar
2018-04-17 13:55 ` (spawning off more style discussion) Leif Lindholm
2018-04-18 8:51 ` Laszlo Ersek
2018-04-16 4:39 ` [PATCH] MdePkg: add big-endian MMIO BaseBeIoLib Udit Kumar
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-list 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=E92EE9817A31E24EB0585FDF735412F5B89D3211@ORSMSX113.amr.corp.intel.com \
--to=devel@edk2.groups.io \
/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