From b0965d210676179fd64ec08e190cfda5b276363e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Fr=C3=B6schle?= Date: Thu, 21 Nov 2013 19:45:09 +0000 Subject: [PATCH] modified set_ipl() register constraints (code was overwriting input operand) --- BaS_gcc/include/exceptions.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/BaS_gcc/include/exceptions.h b/BaS_gcc/include/exceptions.h index aaaab75..4e3e704 100644 --- a/BaS_gcc/include/exceptions.h +++ b/BaS_gcc/include/exceptions.h @@ -8,7 +8,6 @@ inline uint32_t set_ipl(uint32_t ipl) uint32_t ret; __asm__ __volatile__( - " clr.l %[ret]\r\n" /* clear result (mvz.w sr is no valid statement) */ " move.w sr,%[ret]\r\n" /* retrieve status register */ " andi.l #0x07,%[ipl]\n\t" /* mask out ipl bits on new value */ " lsl.l #8,%[ipl]\n\t" /* shift them to position */ @@ -18,9 +17,9 @@ 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] "+g" (ret) /* output */ : [ipl] "r" (ipl) /* input */ - : "d0", "memory" /* clobber */ + : "d0" /* clobber */ ); return ret;