diff options
author | Will Deacon <will.deacon@arm.com> | 2017-11-20 11:07:21 +0000 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2017-11-20 11:07:21 +0000 |
commit | 9cd23dd1811d0ed20e6cfd416494f6348cc76ee7 (patch) | |
tree | 79f5171603550605d8ab470b1511a9e717c118a6 | |
parent | 1764a4f65c72645bcdfbab14a30b782efc6ea8ae (diff) | |
download | qrwlock-rmem-9cd23dd1811d0ed20e6cfd416494f6348cc76ee7.tar.gz |
The "fork" pseudo-instruction writes back to x0, so ensure that GCC
doesn't rely on it holding its previous value across the asm. This
fixes "illegal fetch address exception" reports.
Reported-by: Shaked Flur <shaked.flur@cl.cam.ac.uk>
Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r-- | rmem.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -16,7 +16,7 @@ static inline void __noreturn __rmem_stop(unsigned long pc) static inline void __rmem_thread_start(void *fn) { register void *x0 asm("x0") = fn; - asm volatile(".inst 0xd50bb003" :: "r" (x0) : "memory"); + asm volatile(".inst 0xd50bb003" : "+r" (x0) :: "memory"); } #endif /* __RMEM_H */ |