summaryrefslogtreecommitdiff
path: root/firmware/target/arm
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-10-13 21:48:23 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-10-13 21:48:23 -0400
commit19d45c9257d1d8d1f59746455cddaeef910b1577 (patch)
treeb60cc1f09fab50f4e2ceaacc4c13cc3ee6551f99 /firmware/target/arm
parent105a0eb0b70638500f7d35730fc39751f1f26f8d (diff)
Work around wonky inline asm issue with creativezenvm build.
The right thing here probably to just not bother at all, as this bootloader can't launch rockbox yet anyway. Change-Id: I62bd22353b6adc9dbe35b94f3b60a6a67348356a
Diffstat (limited to 'firmware/target/arm')
-rw-r--r--firmware/target/arm/system-arm.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/firmware/target/arm/system-arm.h b/firmware/target/arm/system-arm.h
index 2d8c6f2c9f..e5d3f35001 100644
--- a/firmware/target/arm/system-arm.h
+++ b/firmware/target/arm/system-arm.h
@@ -110,6 +110,18 @@ static inline int set_interrupt_status(int status, int mask)
unsigned long cpsr;
int oldstatus;
/* Read the old levels and set the new ones */
+#if defined(CREATIVE_ZVM) && defined(BOOTLOADER)
+// FIXME: This workaround is for a problem with inlining;
+// for some reason 'mask' gets treated as a variable/non-immediate constant
+// but only on this build. All others (including the nearly-identical mrobe500boot) are fine
+ asm volatile (
+ "mrs %1, cpsr \n"
+ "bic %0, %1, %[mask] \n"
+ "orr %0, %0, %2 \n"
+ "msr cpsr_c, %0 \n"
+ : "=&r,r"(cpsr), "=&r,r"(oldstatus)
+ : "r,i"(status & mask), [mask]"r,i"(mask));
+#else
asm volatile (
"mrs %1, cpsr \n"
"bic %0, %1, %[mask] \n"
@@ -117,7 +129,7 @@ static inline int set_interrupt_status(int status, int mask)
"msr cpsr_c, %0 \n"
: "=&r,r"(cpsr), "=&r,r"(oldstatus)
: "r,i"(status & mask), [mask]"i,i"(mask));
-
+#endif
return oldstatus;
}