linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
[parent not found: <d3pv0p72yr.fsf@lxp03.cern.ch>]
[parent not found: <m3672hkxri.fsf@soma.andreas.org>]
* readl() and friends and eieio on PPC
@ 1999-08-09  8:17 Geert Uytterhoeven
  1999-08-10  1:00 ` Paul Mackerras
  0 siblings, 1 reply; 38+ messages in thread
From: Geert Uytterhoeven @ 1999-08-09  8:17 UTC (permalink / raw)
  To: Linux/PPC Development; +Cc: Linux Frame Buffer Device Development



Jes Sørensen pointed out to me that readl() and friends should not use eieio on
PPC. On other architectures (e.g. AXP) this isn't done neither.

Currently we have[*]:

#define readl(addr) in_le32((volatile unsigned *)(addr))
#define inl(port)               in_le32((unsigned *)((port)+_IO_BASE))
#define inl_p(port)             in_le32((unsigned *)((port)+_IO_BASE))

extern inline unsigned in_le32(volatile unsigned *addr){
        unsigned ret;

        __asm__ __volatile__("lwbrx %0,0,%1; eieio" : "=r" (ret) :
                             "r" (addr), "m" (*addr));
        return ret;
}

[*] Except on APUS, where readl() uses native endianness.

Hence both inl() and readl() protect against reordering. This is not necessary
for readl(). Drivers that need to protect against reordering should use
wmb()/rmb()/mb() theirselves.

If readl() and friends don't do eieio, the fbcon-* routines won't be slowed
down by using readl() and friends (but we're still having the byte swapping
then).

And atyfb should use readl()/writel() instead of aty_{ld,st}_le32(), so we can
get rid of the inline assembler. Note that this will probably break on Atari,
since on m68k readl() doesn't do byte swapping. But that can be circumvented
with one #ifdef.

Greetings,

						Geert

--
Geert Uytterhoeven                     Geert.Uytterhoeven@cs.kuleuven.ac.be
Wavelets, Linux/{m68k~Amiga,PPC~CHRP}  http://www.cs.kuleuven.ac.be/~geert/
Department of Computer Science -- Katholieke Universiteit Leuven -- Belgium


[[ 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.   ]]

^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~1999-08-18 11:02 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <Pine.LNX.3.96.990813143741.27557B-100000@mvista.com>
     [not found] ` <d3so5mdyta.fsf@lxp03.cern.ch>
1999-08-14 18:34   ` [linux-fbdev] Re: readl() and friends and eieio on PPC Geert Uytterhoeven
1999-08-14 18:36   ` David A. Gatwood
1999-08-14 19:48     ` Jes Sorensen
1999-08-15  1:28       ` David A. Gatwood
1999-08-14 21:39   ` Richard Henderson
1999-08-15 23:16   ` Paul Mackerras
1999-08-16  0:29     ` Richard Henderson
1999-08-16  7:11     ` Jes Sorensen
     [not found] <d3pv0p72yr.fsf@lxp03.cern.ch>
1999-08-15 19:43 ` David A. Gatwood
     [not found] <m3672hkxri.fsf@soma.andreas.org>
1999-08-15 13:39 ` James Simmons
1999-08-09  8:17 Geert Uytterhoeven
1999-08-10  1:00 ` Paul Mackerras
1999-08-10  7:18   ` [linux-fbdev] " Jes Sorensen
1999-08-11  0:23     ` Paul Mackerras
1999-08-11  7:23       ` Jes Sorensen
1999-08-11  7:38         ` Richard Henderson
1999-08-12  0:13           ` Paul Mackerras
1999-08-12  1:39             ` Peter Chang
1999-08-12  4:52               ` Paul Mackerras
1999-08-12  6:17                 ` Peter Chang
1999-08-12  0:17           ` Paul Mackerras
1999-08-12  4:40             ` Richard Henderson
1999-08-12  5:00               ` Paul Mackerras
1999-08-12  5:43                 ` Richard Henderson
1999-08-12  7:07                   ` Paul Mackerras
1999-08-12  7:33                     ` Richard Henderson
1999-08-12  9:58                       ` Paul Mackerras
1999-08-12 12:31                     ` Geert Uytterhoeven
1999-08-13 12:18                       ` Paul Mackerras
1999-08-18 11:02                       ` Gabriel Paubert
1999-08-13 18:33                     ` Richard Henderson
1999-08-12  5:16               ` David Edelsohn
1999-08-12  5:27                 ` Paul Mackerras
1999-08-12  5:52                 ` Richard Henderson
1999-08-12  7:11                   ` Paul Mackerras
1999-08-12  7:32                 ` Jes Sorensen
1999-08-11 23:52         ` Paul Mackerras
1999-08-12  7:38           ` Jes Sorensen
1999-08-12 19:00           ` David A. Gatwood
1999-08-13  1:51             ` Paul Mackerras

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).