linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: andrew may <acmay@acmay.homeip.net>
To: Tom Rini <trini@kernel.crashing.org>
Cc: acmay@acmay.homeip.net, Dan Malek <dan@mvista.com>,
	John Tyner <jtyner@cs.ucr.edu>,
	linuxppc-commit@source.mvista.com,
	linuxppc-embedded@lists.linuxppc.org
Subject: Re: patch for mktree.c on cross compiles
Date: Thu, 6 Sep 2001 13:01:06 -0700	[thread overview]
Message-ID: <20010906130106.L14548@ecam.san.rr.com> (raw)
In-Reply-To: <20010906075542.A21172@cpe-24-221-152-185.az.sprintbbd.net>


On Thu, Sep 06, 2001 at 07:55:42AM -0700, Tom Rini wrote:
> On Wed, Sep 05, 2001 at 10:39:03PM -0700, acmay@acmay.homeip.net wrote:
> > On Wed, Sep 05, 2001 at 09:20:50PM -0700, Tom Rini wrote:
> > > On Wed, Sep 05, 2001 at 04:43:33PM -0400, Dan Malek wrote:
> > > > andrew may wrote:
> > > > > I would think everything in arch/ppc/boot/utils should be checked
> > > > > for endian problems on cross compiles.
> > > >
> > > > Are the network-host macros the right things to use?  That's what
> > > > always comes to mind for me, but I suspect there is a more standard
> > > > set of macros from 'endian.h' or something........If it's OK with
> > > > everyone I'll check it in, but it does look kind of weird.
> > >
> > > Well, after some quick digging, here's what I found.  If we include
> > > <asm/byteoder.h>, and deal with some __'s, which are exported outside
> >
> > One problem with trying this is that <asm/byteoder.h> will only be for
> > the target, not the compiling host. I think mktree should stick with
> > standard userspace include headers and stay away from kernel headers.
>
> Er.  No, <asm/byteorder.h> _should_ be a userspace header.  At least on
> Linux..  For BSD (and Linux with _USE_BSD) we can use sys/types.h and get
> back a __BYTE_ORDER, I _think_...

It seems that <asm/byteorder.h> is one of the "shared" headers between glibc
and the kernel. Hasn't Linus wanted the glibc people to do there own headers
for ages.

Either way it seems that htonl gets mapped down __cpu_to_be32() in
linux/byteorder/generic.h. So that even thought it seems strange to
use the "network" functions it does seem to be OK.

We can only hope people don't have bad /usr/include/[asm][linux] symlinks.


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

  reply	other threads:[~2001-09-06 20:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-05 19:06 patch for mktree.c on cross compiles andrew may
     [not found] ` <3B968E75.A63F26EA@mvista.com>
2001-09-06  4:20   ` Tom Rini
     [not found]     ` <20010905223903.D621@sink.san.rr.com>
2001-09-06 14:55       ` Tom Rini
2001-09-06 20:01         ` andrew may [this message]
2001-09-06 21:08           ` Tom Rini
     [not found]             ` <20010906135432.M14548@ecam.san.rr.com>
2001-09-06 22:02               ` Mark Hatle
2001-09-06 22:25               ` Tom Rini

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=20010906130106.L14548@ecam.san.rr.com \
    --to=acmay@acmay.homeip.net \
    --cc=dan@mvista.com \
    --cc=jtyner@cs.ucr.edu \
    --cc=linuxppc-commit@source.mvista.com \
    --cc=linuxppc-embedded@lists.linuxppc.org \
    --cc=trini@kernel.crashing.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).