summaryrefslogtreecommitdiff
path: root/libcpu/aarch64/common/include/cpu_ops_common.h
diff options
context:
space:
mode:
authorShell <[email protected]>2024-06-28 00:23:09 +0800
committerGitHub <[email protected]>2024-06-28 00:23:09 +0800
commit90917cc75af9406834c14fd25140405ba6f72d6d (patch)
treee5ac39bbcb922d380a272c4d80ed439ad316604b /libcpu/aarch64/common/include/cpu_ops_common.h
parent3d8c27bcc998c0a43aedc069a4a826e349b85485 (diff)
[format] cleanup libcpu/aarch64 (#8950)
* [dfs] fixup compiler warning Signed-off-by: Shell <[email protected]> * [format] libcpu/arm64: separate context switching codes Signed-off-by: Shell <[email protected]> * [format] libcpu/arm64: separate vector Signed-off-by: Shell <[email protected]> * [format] libcpu/arm64: separate context_gcc.S Signed-off-by: Shell <[email protected]> * [format] libcpu/arm64: moving headers to include directory Signed-off-by: Shell <[email protected]> * style: replace tab with space --------- Signed-off-by: Shell <[email protected]>
Diffstat (limited to 'libcpu/aarch64/common/include/cpu_ops_common.h')
-rw-r--r--libcpu/aarch64/common/include/cpu_ops_common.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/libcpu/aarch64/common/include/cpu_ops_common.h b/libcpu/aarch64/common/include/cpu_ops_common.h
new file mode 100644
index 0000000000..5e47584c7b
--- /dev/null
+++ b/libcpu/aarch64/common/include/cpu_ops_common.h
@@ -0,0 +1,21 @@
+#ifndef __CPU_OPS_COMMON_H__
+#define __CPU_OPS_COMMON_H__
+
+#include <rthw.h>
+#include <rtthread.h>
+#include <mmu.h>
+#include "entry_point.h"
+
+static inline rt_uint64_t get_secondary_entry_pa(void)
+{
+ rt_uint64_t secondary_entry_pa = (rt_uint64_t)rt_kmem_v2p(_secondary_cpu_entry);
+
+ if (!secondary_entry_pa)
+ {
+ LOG_E("Failed to translate 'secondary_entry_pa' to physical address");
+ return 0;
+ }
+ return secondary_entry_pa;
+}
+
+#endif /* __CPU_OPS_COMMON_H__ */ \ No newline at end of file