Re: [BUG] - include/asm-s390/ebcdic.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 14 Oct 2010 23:20:57 +0200
Przemyslaw Kupisz <p.kupisz@xxxxxxxxx> wrote:

> It seems there is a bug in code beneath. "EX" instruction puts 1 byte 
> overly to TR instruction.
> So you should decrease "nr" by 1 before executing the "EX" instruction.
> 
> static inline void
> codepage_convert(const __u8 *codepage, volatile __u8 * addr, unsigned 
> long nr)
> {
> 	if (nr-- <= 0)
> 		return;
>          __asm__ __volatile__(
> 		"   bras 1,1f\n"
> 		"   tr   0(1,%0),0(%2)\n"
>                  "0: tr   0(256,%0),0(%2)\n"
> 		"   la   %0,256(%0)\n"
> 		"1: ahi  %1,-256\n"
> 		"   jnm  0b\n"
> 		"   ex   %1,0(1)"
>                  : "+&a" (addr), "+&a" (nr)
>                  : "a" (codepage) : "cc", "memory", "1" );
> }
 
Imho the code is fine. nr is decremented in the first if statement.
Not pretty but it should work.

-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.

--
To unsubscribe from this list: send the line "unsubscribe linux-s390" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux