forked from luck/tmp_suning_uos_patched
[S390] zcore: fix inline assembly in memcpy_real()
memcpy_real uses the mvcle instruction. This instruction alters all used registers (source, destination and 2 x count). Therefore we have to flag those registers as input/output registers (+d). In addition to that, we have to specify, that we read from memory designated by "src" and write to memory designated by "dest". Signed-off-by: Michael Holzheu <holzheu@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
parent
cebe0fe70f
commit
53a0868cb4
@ -141,15 +141,16 @@ static int memcpy_real(void *dest, unsigned long src, size_t count)
|
|||||||
|
|
||||||
if (count == 0)
|
if (count == 0)
|
||||||
return 0;
|
return 0;
|
||||||
flags = __raw_local_irq_stnsm(0xf8); /* switch to real mode */
|
flags = __raw_local_irq_stnsm(0xf8UL); /* switch to real mode */
|
||||||
asm volatile (
|
asm volatile (
|
||||||
"0: mvcle %1,%2,0x0\n"
|
"0: mvcle %1,%2,0x0\n"
|
||||||
"1: jo 0b\n"
|
"1: jo 0b\n"
|
||||||
" lhi %0,0x0\n"
|
" lhi %0,0x0\n"
|
||||||
"2:\n"
|
"2:\n"
|
||||||
EX_TABLE(1b,2b)
|
EX_TABLE(1b,2b)
|
||||||
: "+d" (rc)
|
: "+d" (rc), "+d" (_dest), "+d" (_src), "+d" (_len1),
|
||||||
: "d" (_dest), "d" (_src), "d" (_len1), "d" (_len2)
|
"+d" (_len2), "=m" (*((long*)dest))
|
||||||
|
: "m" (*((long*)src))
|
||||||
: "cc", "memory");
|
: "cc", "memory");
|
||||||
__raw_local_irq_ssm(flags);
|
__raw_local_irq_ssm(flags);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user