[PATCH 5/8] ppc: use correct asm ops

Roman Zippel zippel at linux-m68k.org
Tue Sep 27 10:36:11 EST 2005


Hi,

On Mon, 26 Sep 2005, Hollis Blanchard wrote:

> > --- linux.orig/include/asm-ppc/io.h	2005-09-23 16:20:24.000000000 +0200
> > +++ linux/include/asm-ppc/io.h	2005-09-23 16:20:26.000000000 +0200
> > @@ -294,10 +294,10 @@ extern __inline__ void name(unsigned int
> >  __do_out_asm(outb, "stbx")
> >  #ifdef CONFIG_APUS
> >  __do_in_asm(inb, "lbzx")
> > -__do_in_asm(inw, "lhz%U1%X1")
> > -__do_in_asm(inl, "lwz%U1%X1")
> > -__do_out_asm(outl,"stw%U0%X0")
> > -__do_out_asm(outw, "sth%U0%X0")
> > +__do_in_asm(inw, "lhzx")
> > +__do_in_asm(inl, "lwzx")
> > +__do_out_asm(outl,"stwx")
> > +__do_out_asm(outw, "sthx")
> >  #elif defined (CONFIG_8260_PCI9)
> >  /* in asm cannot be defined if PCI9 workaround is used */
> >  #define inb(port)		in_8((port)+___IO_BASE)
> 
> I don't see where this is explained in the GCC docs, but as I understand it
> those %U %X things are allowing somebody to use the "update" and "index"
> variants of the instruction. Why doesn't this work for you?

Because it requires the matching arguments, which are defined by 
__do_{in,out}_asm, otherwise an invalid instruction is generated.

bye, Roman



More information about the Linuxppc-dev mailing list