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
This commit is contained in:
Solomon Peachy 2020-10-13 21:48:23 -04:00
parent 105a0eb0b7
commit 19d45c9257

View file

@ -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;
}