message(STATUS "System processor: i686 (${CMAKE_SYSTEM_PROCESSOR}, 32 bits)")
set(SIMGRID_PROCESSOR_i686 1)
set(SIMGRID_PROCESSOR_x86_64 0)
+ set(SIMGRID_PROCESSOR_arm64 0)
ELSE()
message(STATUS "System processor: x86_64 (${CMAKE_SYSTEM_PROCESSOR}, 64 bits)")
set(SIMGRID_PROCESSOR_i686 0)
set(SIMGRID_PROCESSOR_x86_64 1)
+ set(SIMGRID_PROCESSOR_arm64 0)
ENDIF()
if(CMAKE_SIZEOF_VOID_P EQUAL 4 AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
message(STATUS "Disable fast raw contexts on x32 ABI.")
else()
set(HAVE_RAW_CONTEXTS 1)
endif()
+ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
+ message(STATUS "System processor: arm64 (${CMAKE_SYSTEM_PROCESSOR}, 64 bits)")
+ set(SIMGRID_PROCESSOR_i686 0)
+ set(SIMGRID_PROCESSOR_x86_64 0)
+ set(SIMGRID_PROCESSOR_arm64 1)
ELSE()
+ message(STATUS "System processor (${CMAKE_SYSTEM_PROCESSOR}) not explicitly accounted for")
set(SIMGRID_PROCESSOR_i686 0)
set(SIMGRID_PROCESSOR_x86_64 0)
+ set(SIMGRID_PROCESSOR_arm64 0)
ENDIF()
include(CheckFunctionExists)
/* Variables for the raw contexts (to select the right assembly code) */
#cmakedefine01 SIMGRID_PROCESSOR_i686
#cmakedefine01 SIMGRID_PROCESSOR_x86_64
+#cmakedefine01 SIMGRID_PROCESSOR_arm64
/* Variables for the SysV contexts */
@sg_makecontext_stack_addr@
// Take a copy of the context for our own purpose:
this->unwind_context_ = *c;
-#if SIMGRID_PROCESSOR_x86_64 || SIMGRID_PROCESSOR_i686 || defined(__aarch64__)
+#if SIMGRID_PROCESSOR_x86_64 || SIMGRID_PROCESSOR_i686
#ifdef __linux__
// On x86_64, ucontext_t contains a pointer to itself for FP registers.
// We don't really need support for FR registers as they are caller saved
// Let's ignore this and see what happens:
this->unwind_context_.uc_mcontext.fpregs = nullptr;
#endif
+#elif SIMGRID_PROCESSOR_arm64
+#ifdef __linux__
+ // On ARM64, ucontext_t doesn't contain `fpregs` and the FP registers
+ // are instead held in the `__reserved` field of the struct. It doesn't
+ // appear anything needs to be done here, although this should be verified
+#endif
#else
// Do we need to do any fixup like this?
#error Target CPU type is not handled.