Skip to content

Commit f80ed5e

Browse files
committed
Fix define MBED_EXCLUSIVE_ACCESS for Apple M1 (ARM64) computers
The new Apple M1 Mac computers are ARM based. When compiling and running unit tests on an M1 Mac, the architecture is defined as __arm__ An extra check for __aarch64__ is needed to set MBED_EXCLUSIVE_ACCESS to 0U for the M1 Mac If not, compilation fails with "Unknown ARM architecture for exclusive access" error
1 parent 96e19af commit f80ed5e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

platform/include/platform/mbed_atomic.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ typedef enum mbed_memory_order {
8888
#endif
8989
#elif (__ARM_ARCH_6M__ == 1U)
9090
#define MBED_EXCLUSIVE_ACCESS 0U
91+
#elif defined __aarch64__ // Apple M1 Mac
92+
#define MBED_EXCLUSIVE_ACCESS 0U
9193
#else
9294
#error "Unknown ARM architecture for exclusive access"
9395
#endif // __ARM_ARCH_xxx

0 commit comments

Comments
 (0)