diff options
author | Michael Holzheu <holzheu@de.ibm.com> | 2007-10-12 10:11:44 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2007-10-12 10:13:09 -0400 |
commit | 53a0868cb4d77dcba8e95e1033361ffdb6e510e2 (patch) | |
tree | ba104b7f4dd00a2713dc9acff360cb7013060cfd /drivers/s390 | |
parent | cebe0fe70fbf033a1a6b7c5c8b79eb13060a4ab7 (diff) |
[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>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/char/zcore.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/s390/char/zcore.c b/drivers/s390/char/zcore.c index 3712ede16723..7073daf77981 100644 --- a/drivers/s390/char/zcore.c +++ b/drivers/s390/char/zcore.c | |||
@@ -141,15 +141,16 @@ static int memcpy_real(void *dest, unsigned long src, size_t count) | |||
141 | 141 | ||
142 | if (count == 0) | 142 | if (count == 0) |
143 | return 0; | 143 | return 0; |
144 | flags = __raw_local_irq_stnsm(0xf8); /* switch to real mode */ | 144 | flags = __raw_local_irq_stnsm(0xf8UL); /* switch to real mode */ |
145 | asm volatile ( | 145 | asm volatile ( |
146 | "0: mvcle %1,%2,0x0\n" | 146 | "0: mvcle %1,%2,0x0\n" |
147 | "1: jo 0b\n" | 147 | "1: jo 0b\n" |
148 | " lhi %0,0x0\n" | 148 | " lhi %0,0x0\n" |
149 | "2:\n" | 149 | "2:\n" |
150 | EX_TABLE(1b,2b) | 150 | EX_TABLE(1b,2b) |
151 | : "+d" (rc) | 151 | : "+d" (rc), "+d" (_dest), "+d" (_src), "+d" (_len1), |
152 | : "d" (_dest), "d" (_src), "d" (_len1), "d" (_len2) | 152 | "+d" (_len2), "=m" (*((long*)dest)) |
153 | : "m" (*((long*)src)) | ||
153 | : "cc", "memory"); | 154 | : "cc", "memory"); |
154 | __raw_local_irq_ssm(flags); | 155 | __raw_local_irq_ssm(flags); |
155 | 156 | ||