All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wojciech Kromer <krom@dgt-lab.com.pl>
To: "Linuxppc-Embedded (E-mail)" <linuxppc-embedded@lists.linuxppc.org>
Subject: Re: need a fast byteorder changing routine
Date: Fri, 18 Jul 2003 08:26:34 +0200	[thread overview]
Message-ID: <3F17931A.4000405@dgt-lab.com.pl> (raw)
In-Reply-To: <Xx969281867387.18796@webmail1.inner-21cn.com>


Użytkownik li napisał:

>Hi all,
>i need do a lot of byteorder changing operation from big-endian to little-endian. cpu_to_le32 is not fast enough for me, does anyone have such a routine written in asm.?
>PS: here is an ugly asm function do such thing:
>void swapbyte(unsigned long *val, unsigned long offset,
>              unsigned long value)
>{
>
>        asm ("lis 3 %0@ha" : "=r" (val));
>        asm ("lwz 3,%0@l(3)" : "=r" (val));
>        asm ("stw %1, 0(4)" : "=r" (offset));
>        asm ("stw %2, 0(5)" : "=r" (value));
>        asm ("stwbrx 5, 3, 4");
>}val is the address of value. i used to set this function as inline, but kernel said:
>Oops: kernel access of bad area, sig: 11
>Any comments
>Best Regards!
>Li
>
>
>
>
>
try DIRECT using out_le16/32 in_le16/32 from <asm/io.h>,
this takes same time as one  big endian write/read



--
* * * * * * * * * * * *
* per pedes ad astra! *
* * * * * * * * * * * *    mailto:krom@dgt-lab.com.pl


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

       reply	other threads:[~2003-07-18  6:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Xx969281867387.18796@webmail1.inner-21cn.com>
2003-07-18  6:26 ` Wojciech Kromer [this message]
2003-07-18 13:03 need a fast byteorder changing routine Wells, Charles
  -- strict thread matches above, loose matches on Subject: below --
2003-07-18 13:24 Wells, Charles
2003-07-18 14:35 ` Peter Barada

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=3F17931A.4000405@dgt-lab.com.pl \
    --to=krom@dgt-lab.com.pl \
    --cc=linuxppc-embedded@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.