aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjohannst <johannes.stoelp@gmail.com>2021-02-28 20:39:34 +0100
committerjohannst <johannes.stoelp@gmail.com>2021-02-28 20:39:34 +0100
commite58a957f32e0becfe49f313a819087789211a6c2 (patch)
tree8396c5abf31f5cc800defb4c53068ad56a6d15db
parent6e182c588ec06f0db626a5ee7247b9b1688b10b6 (diff)
downloadmatcha-threads-e58a957f32e0becfe49f313a819087789211a6c2.tar.gz
matcha-threads-e58a957f32e0becfe49f313a819087789211a6c2.zip
arm/arm64 add check for arm proc call std
-rw-r--r--lib/arch/arm/init_stack.cc4
-rw-r--r--lib/arch/arm64/init_stack.cc4
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/arch/arm/init_stack.cc b/lib/arch/arm/init_stack.cc
index 422be64..32d00b5 100644
--- a/lib/arch/arm/init_stack.cc
+++ b/lib/arch/arm/init_stack.cc
@@ -1,6 +1,10 @@
#include <cassert>
#include <cstdint> // uintN_t
+#if !defined(__APCS_32__)
+static_assert(false, "Must be compiled with the Arm Procedure Call Standard (aapcs32)!");
+#endif
+
extern "C" void thread_create();
void* init_stack(void* stack_ptr, void (*entry)(void*), const void* ctx) {
diff --git a/lib/arch/arm64/init_stack.cc b/lib/arch/arm64/init_stack.cc
index f00320b..1153737 100644
--- a/lib/arch/arm64/init_stack.cc
+++ b/lib/arch/arm64/init_stack.cc
@@ -1,6 +1,10 @@
#include <cassert>
#include <cstdint> // uintN_t
+#if !defined(__ARM_PCS_AAPCS64)
+static_assert(false, "Must be compiled with the Arm64 Procedure Call Standard (aapcs64)!");
+#endif
+
extern "C" void thread_create();
void* init_stack(void* stack_ptr, void (*entry)(void*), const void* ctx) {