ChibiOS compilation dies here due to "invalid instruction mnemonic pushm.w" on line asm volatile ("pushm.w #7, R10");
/**
* @brief Performs a context switch between two threads.
* @details This is the most critical code in any port, this function
* is responsible for the context switch between 2 threads.
* @note The implementation of this code affects <b>directly</b> the context
* switch performance so optimize here as much as you can.
*
* @param[in] ntp the thread to be switched in
* @param[in] otp the thread to be switched out
*/
#if !(__GNUC__ < 6 && __GNUC_MINOR__ < 4) || defined(__OPTIMIZE__)
__attribute__((naked))
#endif
void _port_switch(thread_t *ntp, thread_t *otp) {
#if (__GNUC__ < 6 && __GNUC_MINOR__ < 4) && !defined(__OPTIMIZE__)
asm volatile ("add #4, r1");
#endif
(void)(ntp);
(void)(otp);
#if defined(__MSP430X_LARGE__)
asm volatile ("pushm.a #7, R10");
asm volatile ("mova r1, @R13");
asm volatile ("mova @R12, r1");
asm volatile ("popm.a #7, R10");
asm volatile ("reta");
#else
asm volatile ("pushm.w #7, R10");
asm volatile ("mov r1, @R13");
asm volatile ("mov @R12, r1");
asm volatile ("popm.w #7, R10");
asm volatile ("ret");
#endif
}
ChibiOS compilation dies here due to "invalid instruction mnemonic pushm.w" on line
asm volatile ("pushm.w #7, R10");