stalld/riscv_support.patch
Jer6y a1793935dc riscv: add riscv support and update to v1.19.1
*add riscv support
*update to v1.19.1

Signed-off-by: luojun <luojun.oerv@isrc.iscas.ac.cn>
2024-03-24 20:51:35 +08:00

31 lines
797 B
Diff

diff --git a/Makefile b/Makefile
index f866a74..76aefe2 100644
--- a/Makefile
+++ b/Makefile
@@ -34,6 +34,12 @@ USE_BPF := 0
FCF_PROTECTION := $(CF_PROTECTION_OPTS)
TMOPTS := -mtune=powerpc
endif
+ifeq ($(ARCH),riscv64)
+USE_BPF :=0
+FCF_PROTECTION := $(CF_PROTECTION_OPTS)
+TMOPTS := -march=rv64gc -mabi=lp64d
+endif
+
$(info USE_BPF=$(USE_BPF))
$(info FCF_PROTECTION=$(FCF_PROTECTION))
diff --git a/src/stalld.h b/src/stalld.h
index a5b9dbc..7362d4e 100644
--- a/src/stalld.h
+++ b/src/stalld.h
@@ -119,7 +119,7 @@ struct stalld_backend {
#elif __arm__
# define __NR_sched_setattr 380
# define __NR_sched_getattr 381
-#elif __aarch64__ || __loongarch64
+#elif __aarch64__ || __loongarch64 || __riscv
# define __NR_sched_setattr 274
# define __NR_sched_getattr 275
#elif __powerpc__