Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] endian issue
Date: Sat, 15 May 2010 18:33:21 +0200	[thread overview]
Message-ID: <20100515183321.34ffff64@surf> (raw)
In-Reply-To: <201005151726.58323.korgull@home.nl>

On Sat, 15 May 2010 17:26:57 +0200
Marcel <korgull@home.nl> wrote:

> If I wish to do that, how do I detect the endianness of a sytem and
> do I need to reformat my data in my drivers for this ? If so, isn't
> that a pure waste of cpu cycles for the sake of reusable code ?
> If I can do this without any speed sacrifice than I will do it, if
> not....than it's simply not an option for this system.

If your driver is in the kernel, tust use the kernel functions
be16_to_cpu(), be32_to_cpu(), etc. They will automatically do the
appropriate conversion depending on the CPU endianess.

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

  reply	other threads:[~2010-05-15 16:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-15 13:47 [Buildroot] endian issue Marcel
2010-05-15 14:09 ` Grant Edwards
2010-05-15 14:19 ` Lionel Landwerlin
2010-05-15 14:43   ` Grant Edwards
2010-05-15 15:26     ` Marcel
2010-05-15 16:33       ` Thomas Petazzoni [this message]
2010-05-15 16:37       ` Lionel Landwerlin
2010-05-15 16:45       ` Grant Edwards
2010-05-15 17:53         ` Marcel
2010-05-15 15:18   ` Marcel

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=20100515183321.34ffff64@surf \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=buildroot@busybox.net \
    /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