aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2017-11-20 11:07:21 +0000
committerWill Deacon <will.deacon@arm.com>2017-11-20 11:07:21 +0000
commit9cd23dd1811d0ed20e6cfd416494f6348cc76ee7 (patch)
tree79f5171603550605d8ab470b1511a9e717c118a6
parent1764a4f65c72645bcdfbab14a30b782efc6ea8ae (diff)
downloadqrwlock-rmem-9cd23dd1811d0ed20e6cfd416494f6348cc76ee7.tar.gz
Fix asm constraints in __rmem_thread_startHEADmaster
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.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/rmem.h b/rmem.h
index ab66735..226ed28 100644
--- a/rmem.h
+++ b/rmem.h
@@ -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 */