From 7197610c7625e333d8a8253298992d0313d86d5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Fr=C3=B6schle?= Date: Fri, 22 Nov 2013 10:03:10 +0000 Subject: [PATCH] gcc inline assembly tends to use output registers as input if not explicitely told to avoid is: "=&" as constraint to the output register avoids that. --- BaS_gcc/include/exceptions.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BaS_gcc/include/exceptions.h b/BaS_gcc/include/exceptions.h index 8fe3074..63e2e81 100644 --- a/BaS_gcc/include/exceptions.h +++ b/BaS_gcc/include/exceptions.h @@ -3,7 +3,7 @@ #include -inline uint32_t set_ipl(uint32_t ipl) +static inline uint32_t set_ipl(uint32_t ipl) { uint32_t ret; @@ -17,7 +17,7 @@ inline uint32_t set_ipl(uint32_t ipl) " move.w d0,sr\n\t" /* put it in place */ " andi.l #0x0700,%[ret]\r\n" /* mask out ipl bits */ " lsr.l #8,%[ret]\r\n" /* shift them to position */ - : [ret] "+d" (ret) /* output */ + : [ret] "=&d" (ret) /* output */ : [ipl] "d" (ipl) /* input */ : "d0" /* clobber */ );