diff --git a/simulator/core/isa/arm-thumb/mov.c b/simulator/core/isa/arm-thumb/mov.c index fde20c41..5491e895 100644 --- a/simulator/core/isa/arm-thumb/mov.c +++ b/simulator/core/isa/arm-thumb/mov.c @@ -81,6 +81,10 @@ static void register_opcodes_arm_thumb_mov(void) { // mov_reg_t1: 0100 0110 xx <-- arm-v6-m, arm-v7-m // mov_reg_t1: 0100 0110 00 <-- arm-thumb register_opcode_mask_16(0x4600, 0xb9c0, mov_reg_t1); + + // This is a wierd-er corner case + // GCC uses 'mov r8,r8' (0x46c0) as 'nop' + register_opcode_mask_16(0x46c0, ~0x46c0, mov_reg_t1); // mov_reg_t2: 0000 0000 00xx xxxx register_opcode_mask_16(0x0, 0xffc0, mov_reg_t2); diff --git a/simulator/cpu/core.h b/simulator/cpu/core.h index b50661a9..e3855058 100644 --- a/simulator/cpu/core.h +++ b/simulator/cpu/core.h @@ -22,11 +22,19 @@ #include "core/common.h" +#include + #ifndef PP_STRING #define PP_STRING "COR" #include "core/pretty_print.h" #endif +/* in case some compilers don't recognize this keyword */ +#ifndef _Atomic +#warning "Skipping _Atomic" +#define _Atomic +#endif + void register_reset(void(*fn)(void)); union memmap_fn { @@ -45,6 +53,7 @@ void register_memmap( uint32_t top ); + extern _Atomic _Bool _CORE_in_reset; void reset(void);