linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@cs.anu.edu.au>
To: Christian.Bauer@uni-mainz.de
Cc: linuxppc-dev@lists.linuxppc.org
Subject: Re: Endianess problems in linuxppc kernel
Date: Wed, 28 Apr 1999 22:21:32 +1000	[thread overview]
Message-ID: <199904281221.WAA31584@tango.anu.edu.au> (raw)
In-Reply-To: <199904280958.LAA24884@student.physik.uni-mainz.de> (Christian.Bauer@uni-mainz.de)


Christian Bauer <Christian.Bauer@uni-mainz.de> wrote:

> The "le16_to_cpus(&hdr->count)" fixes a real bug in the driver (it wouldn't
> work on big-endian machines, no matter how outsl/insl works), but everything
> else looks like the outsl/insl functions work with the wrong byte order
> (little-endian vs. big-endian).

Well, the driver is using insl/outsl to transfer a buffer of bytes,
not a buffer of longwords, whereas in[s]l/out[s]l are defined to
transfer longwords (32 bits), and byte-swapping is the right thing to
do when you're transferring longwords.  The driver is using insl/outsl
in order to transfer the bytes in 4 byte chunks; what it really should
use is an insl_ns/outsl_ns which doesn't do byteswapping.

> Playing a module with "mikmod" results in rhythmic noise (16 bit) or silence
> (8 bit). When I change every instance of
> 
>   out_le32(&awacs->byteswap, sound.hard.format != AFMT_S16_BE);
> 
> to
> 
>   out_le32(&awacs->byteswap, sound.hard.format == AFMT_S16_BE);
> 
> in "drivers/sound/dmasound.c", both 8 and 16 bit output work fine.

Is the application perhaps using AFMT_S16_NE (native endianness) but
assuming that that means little-endian?

Paul.

[[ This message was sent via the linuxppc-dev mailing list.  Replies are ]]
[[ not  forced  back  to the list, so be sure to Cc linuxppc-dev if your ]]
[[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting.   ]]

  parent reply	other threads:[~1999-04-28 12:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-04-28  9:56 Endianess problems in linuxppc kernel Christian Bauer
1999-04-28 11:11 ` Geert Uytterhoeven
1999-04-28 12:21 ` Paul Mackerras [this message]
  -- strict thread matches above, loose matches on Subject: below --
1999-04-28 18:13 Christian Bauer
1999-04-29 10:41 ` Benjamin Herrenschmidt
1999-04-29 17:24 ` Ryuichi Oikawa
1999-04-28 19:23 Christian Bauer

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=199904281221.WAA31584@tango.anu.edu.au \
    --to=paulus@cs.anu.edu.au \
    --cc=Christian.Bauer@uni-mainz.de \
    --cc=Paul.Mackerras@cs.anu.edu.au \
    --cc=linuxppc-dev@lists.linuxppc.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).