From: "Brad Midgley" <bmidgley@gmail.com>
To: "Siarhei Siamashka" <siarhei.siamashka@nokia.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: SBC big endian issues?
Date: Mon, 5 Jan 2009 12:26:17 -0700 [thread overview]
Message-ID: <d89ddf300901051126g3f8c8dadq8effa23e0a7bf73f@mail.gmail.com> (raw)
In-Reply-To: <200901052019.15656.siarhei.siamashka@nokia.com>
Siarhei
The copy is inefficient but it would be even better if we didn't have
to do it at all. I was investigating zero copy here and came up with a
patch but it was too complicated to be accepted.
The messy part here is we let the caller specify the byte order of the
array. It would simplify a lot to standardize on host endian. I don't
remember what the reasoning was against this.
> Let's suppose that we have the following two bytes in memory:
>
> 0x12 0x34
>
> This equals to 0x1234 for big endian systems or 0x3412 for little endian
> systems if you read data via int16_t * pointer.
if sbc->endian is set to the same as the host endian, then this could
be done with a memcopy or skipped (zero copy).
I believe sbc->endian is always set to little endian the way it works
now, meaning the array is storing data little endian regardless of the
architecture. The patch I wrote made a copy of the memory, swapping
bytes, if sbc->endian didn't match host endian. The way we use the
code, this swapping only happens on big endian machines.
--
Brad Midgley
next prev parent reply other threads:[~2009-01-05 19:26 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-05 8:15 SBC big endian issues? Siarhei Siamashka
2009-01-05 15:36 ` Brad Midgley
2009-01-05 15:55 ` Siarhei Siamashka
2009-01-05 16:25 ` Brad Midgley
2009-01-05 16:29 ` Brad Midgley
2009-01-05 18:19 ` Siarhei Siamashka
2009-01-05 19:26 ` Brad Midgley [this message]
2009-01-07 12:40 ` Siarhei Siamashka
2009-01-07 13:43 ` Marcel Holtmann
2009-01-16 17:23 ` Siarhei Siamashka
2009-01-16 22:02 ` Luiz Augusto von Dentz
2009-01-17 18:10 ` Siarhei Siamashka
2009-01-19 11:26 ` Siarhei Siamashka
2009-01-19 12:05 ` Marcel Holtmann
2009-01-20 6:22 ` [Patch] SAP client plugin framework Liu, Raymond
2009-01-22 5:05 ` Liu, Raymond
2009-01-19 15:02 ` SBC big endian issues? Brad Midgley
2009-01-20 10:20 ` Siarhei Siamashka
2009-01-20 11:13 ` Siarhei Siamashka
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=d89ddf300901051126g3f8c8dadq8effa23e0a7bf73f@mail.gmail.com \
--to=bmidgley@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=siarhei.siamashka@nokia.com \
/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