aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/arch/arm/odp/api/abi/cpu_inlines.h
diff options
context:
space:
mode:
Diffstat (limited to 'platform/linux-generic/arch/arm/odp/api/abi/cpu_inlines.h')
-rw-r--r--platform/linux-generic/arch/arm/odp/api/abi/cpu_inlines.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/platform/linux-generic/arch/arm/odp/api/abi/cpu_inlines.h b/platform/linux-generic/arch/arm/odp/api/abi/cpu_inlines.h
new file mode 100644
index 000000000..bf44806a0
--- /dev/null
+++ b/platform/linux-generic/arch/arm/odp/api/abi/cpu_inlines.h
@@ -0,0 +1,32 @@
+/* Copyright (c) 2016-2018, Linaro Limited
+ * Copyright (c) 2021, Nokia
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef ODP_ARCH_CPU_INLINES_H_
+#define ODP_ARCH_CPU_INLINES_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+static inline void _odp_cpu_pause(void)
+{
+ /* YIELD hints the CPU to switch to another thread if possible
+ * and executes as a NOP otherwise.
+ * ISB flushes the pipeline, then restarts. This is guaranteed to
+ * stall the CPU a number of cycles.
+ */
+ __asm volatile("isb" ::: "memory");
+}
+
+/* Use generic implementations for the rest of the functions */
+#include <odp/api/abi/cpu_generic.h>
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif