summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/sbi/riscv_asm.h12
-rw-r--r--include/sbi/sbi_scratch.h17
2 files changed, 17 insertions, 12 deletions
diff --git a/include/sbi/riscv_asm.h b/include/sbi/riscv_asm.h
index edf35ece..c169d93c 100644
--- a/include/sbi/riscv_asm.h
+++ b/include/sbi/riscv_asm.h
@@ -69,18 +69,6 @@
#error "Unexpected __SIZEOF_SHORT__"
#endif
-#define RISCV_SCRATCH_TMP0_OFFSET (0 * __SIZEOF_POINTER__)
-#define RISCV_SCRATCH_FW_START_OFFSET (1 * __SIZEOF_POINTER__)
-#define RISCV_SCRATCH_FW_SIZE_OFFSET (2 * __SIZEOF_POINTER__)
-#define RISCV_SCRATCH_NEXT_ARG1_OFFSET (3 * __SIZEOF_POINTER__)
-#define RISCV_SCRATCH_NEXT_ADDR_OFFSET (4 * __SIZEOF_POINTER__)
-#define RISCV_SCRATCH_NEXT_MODE_OFFSET (5 * __SIZEOF_POINTER__)
-#define RISCV_SCRATCH_WARMBOOT_ADDR_OFFSET (6 * __SIZEOF_POINTER__)
-#define RISCV_SCRATCH_PLATFORM_ADDR_OFFSET (7 * __SIZEOF_POINTER__)
-#define RISCV_SCRATCH_HARTID_TO_SCRATCH_OFFSET (8 * __SIZEOF_POINTER__)
-#define RISCV_SCRATCH_IPI_TYPE_OFFSET (9 * __SIZEOF_POINTER__)
-#define RISCV_SCRATCH_SIZE 256
-
#define RISCV_PLATFORM_NAME_OFFSET (0x0)
#define RISCV_PLATFORM_FEATURES_OFFSET (0x40)
#define RISCV_PLATFORM_HART_COUNT_OFFSET (0x48)
diff --git a/include/sbi/sbi_scratch.h b/include/sbi/sbi_scratch.h
index d5c6f353..14c72a85 100644
--- a/include/sbi/sbi_scratch.h
+++ b/include/sbi/sbi_scratch.h
@@ -11,6 +11,21 @@
#define __SBI_SCRATCH_H__
#include <sbi/riscv_asm.h>
+
+#define SBI_SCRATCH_TMP0_OFFSET (0 * __SIZEOF_POINTER__)
+#define SBI_SCRATCH_FW_START_OFFSET (1 * __SIZEOF_POINTER__)
+#define SBI_SCRATCH_FW_SIZE_OFFSET (2 * __SIZEOF_POINTER__)
+#define SBI_SCRATCH_NEXT_ARG1_OFFSET (3 * __SIZEOF_POINTER__)
+#define SBI_SCRATCH_NEXT_ADDR_OFFSET (4 * __SIZEOF_POINTER__)
+#define SBI_SCRATCH_NEXT_MODE_OFFSET (5 * __SIZEOF_POINTER__)
+#define SBI_SCRATCH_WARMBOOT_ADDR_OFFSET (6 * __SIZEOF_POINTER__)
+#define SBI_SCRATCH_PLATFORM_ADDR_OFFSET (7 * __SIZEOF_POINTER__)
+#define SBI_SCRATCH_HARTID_TO_SCRATCH_OFFSET (8 * __SIZEOF_POINTER__)
+#define SBI_SCRATCH_IPI_TYPE_OFFSET (9 * __SIZEOF_POINTER__)
+#define SBI_SCRATCH_SIZE 256
+
+#ifndef __ASSEMBLY__
+
#include <sbi/sbi_types.h>
struct sbi_scratch {
@@ -33,3 +48,5 @@ struct sbi_scratch {
((void *)(sbi_scratch_thishart_ptr()->next_arg1))
#endif
+
+#endif