67 lines
2.3 KiB
Diff
67 lines
2.3 KiB
Diff
From 756f6595b562a3fff5de9ab8dd38865f20aa022c Mon Sep 17 00:00:00 2001
|
|
From: laokz <zhangkai@iscas.ac.cn>
|
|
Date: Thu, 25 Apr 2024 22:21:28 +0800
|
|
Subject: [PATCH] add riscv64 support
|
|
|
|
Signal info referenced:
|
|
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/riscv/kernel/signal.c#L373
|
|
|
|
Max CPUs referenced:
|
|
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/riscv/Kconfig#L411
|
|
|
|
Local disk suport PCI and VIRTIO both.
|
|
---
|
|
sysmonitor-1.3.2/module/signo_catch.c | 8 ++++++++
|
|
sysmonitor-1.3.2/script/get_local_disk.sh | 2 ++
|
|
sysmonitor-1.3.2/src/sys_resources.c | 2 ++
|
|
3 files changed, 12 insertions(+)
|
|
|
|
diff --git a/sysmonitor-1.3.2/module/signo_catch.c b/sysmonitor-1.3.2/module/signo_catch.c
|
|
index c038e161ff19..043a14838f98 100644
|
|
--- a/module/signo_catch.c
|
|
+++ b/module/signo_catch.c
|
|
@@ -272,6 +272,14 @@ static int pre_handler(struct kprobe *p, struct pt_regs *regs)
|
|
data.p = (struct task_struct *)((unsigned long *)regs->dx);
|
|
do_store_sig_info(&data);
|
|
#endif
|
|
+
|
|
+#if defined(CONFIG_RISCV) && defined(CONFIG_64BIT)
|
|
+ send_sig_info_data_t data;
|
|
+ data.sig = regs->a0;
|
|
+ data.info = (struct kernel_siginfo *)((unsigned long *)regs->a1);
|
|
+ data.p = (struct task_struct *)((unsigned long *)regs->a2);
|
|
+ do_store_sig_info(&data);
|
|
+#endif
|
|
return 0;
|
|
}
|
|
|
|
diff --git a/sysmonitor-1.3.2/script/get_local_disk.sh b/sysmonitor-1.3.2/script/get_local_disk.sh
|
|
index 318374cbffdd..063e540cebd4 100755
|
|
--- a/script/get_local_disk.sh
|
|
+++ b/script/get_local_disk.sh
|
|
@@ -9,6 +9,8 @@ fc_disk_file=""
|
|
local_disk_file=""
|
|
if uname -a | grep -q aarch64; then
|
|
fc_local_disk=`ls -l /sys/block/ | grep -E 'pci|HISI0162' 2> /dev/null`
|
|
+elif uname -a | grep -q riscv64; then
|
|
+ fc_local_disk=`ls -l /sys/block/ | grep -E 'pci|virtio' 2> /dev/null`
|
|
else
|
|
fc_local_disk=`ls -l /sys/block/ | grep pci 2> /dev/null`
|
|
fi
|
|
diff --git a/sysmonitor-1.3.2/src/sys_resources.c b/sysmonitor-1.3.2/src/sys_resources.c
|
|
index fdf52561e07d..87f2fdd73b10 100644
|
|
--- a/src/sys_resources.c
|
|
+++ b/src/sys_resources.c
|
|
@@ -64,6 +64,8 @@
|
|
#define MAX_DOMAIN_CPU_COUNT 256
|
|
#ifdef __x86_64__
|
|
#define DOMAIN_CPU_LEN 1024 /* x86 supports max 8192 CPUs */
|
|
+#elif defined(__riscv)
|
|
+#define DOMAIN_CPU_LEN 64 /* riscv supports max 512 CPUs */
|
|
#else
|
|
#define DOMAIN_CPU_LEN 128 /* arm64 supports max 1024 CPUs */
|
|
#endif
|
|
--
|
|
2.39.5
|
|
|