From f80ed5ef3e392e13a7d56f3557457581c26ba333 Mon Sep 17 00:00:00 2001 From: Ladislas de Toldi Date: Tue, 23 Mar 2021 11:42:00 +0100 Subject: [PATCH] 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 --- platform/include/platform/mbed_atomic.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/include/platform/mbed_atomic.h b/platform/include/platform/mbed_atomic.h index 28e2cb2f81..94fa5aac3f 100644 --- a/platform/include/platform/mbed_atomic.h +++ b/platform/include/platform/mbed_atomic.h @@ -88,6 +88,8 @@ typedef enum mbed_memory_order { #endif #elif (__ARM_ARCH_6M__ == 1U) #define MBED_EXCLUSIVE_ACCESS 0U +#elif defined __aarch64__ // Apple M1 Mac +#define MBED_EXCLUSIVE_ACCESS 0U #else #error "Unknown ARM architecture for exclusive access" #endif // __ARM_ARCH_xxx