@@ -87,7 +87,7 @@ CFLAGS += -ffreestanding
CFLAGS += -O2
CFLAGS += -I $(SRCDIR)/lib -I $(SRCDIR)/lib/libfdt -I lib -I $(SRCDIR)/riscv
-asm-offsets = lib/riscv/asm-offsets.h
+asm-offsets = lib/riscv/asm-offsets.h riscv/sbi-asm-offsets.h
include $(SRCDIR)/scripts/asm-offsets.mak
.PRECIOUS: %.aux.o
@@ -6,6 +6,8 @@
*/
#include <asm/asm.h>
#include <asm/csr.h>
+#include <asm/asm-offsets.h>
+#include <generated/sbi-asm-offsets.h>
#include "sbi-tests.h"
@@ -57,8 +59,8 @@ sbi_hsm_check:
7: lb t0, 0(t1)
pause
beqz t0, 7b
- li a7, 0x48534d /* SBI_EXT_HSM */
- li a6, 1 /* SBI_EXT_HSM_HART_STOP */
+ li a7, ASM_SBI_EXT_HSM
+ li a6, ASM_SBI_EXT_HSM_HART_STOP
ecall
8: pause
j 8b
new file mode 100644
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: GPL-2.0-only
+#include <kbuild.h>
+#include <asm/sbi.h>
+
+int main(void)
+{
+ DEFINE(ASM_SBI_EXT_HSM, SBI_EXT_HSM);
+ DEFINE(ASM_SBI_EXT_HSM_HART_STOP, SBI_EXT_HSM_HART_STOP);
+
+ return 0;
+}
new file mode 100644
@@ -0,0 +1 @@
+/*-asm-offsets.[hs]