!25 增加riscv64基本支持

From: @laokz 
Reviewed-by: @wang--ge 
Signed-off-by: @wang--ge
This commit is contained in:
openeuler-ci-bot 2023-05-22 11:49:34 +00:00 committed by Gitee
commit 1d559a7c5a
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 33 additions and 2 deletions

View File

@ -0,0 +1,27 @@
diff --git a/vdo/cpu.h b/vdo/cpu.h
index e4b39c2b..ee449b7c 100644
--- a/vdo/cpu.h
+++ b/vdo/cpu.h
@@ -20,7 +20,7 @@
#define CACHE_LINE_BYTES 128
#elif defined(__s390x__)
#define CACHE_LINE_BYTES 256
-#elif defined(__x86_64__) || defined(__aarch64__)
+#elif defined(__x86_64__) || defined(__aarch64__) || defined(__riscv)
#define CACHE_LINE_BYTES 64
#else
#error "unknown cache line size"
diff --git a/vdo/volume.h b/vdo/volume.h
index 3a9a8d5e..93f13a42 100644
--- a/vdo/volume.h
+++ b/vdo/volume.h
@@ -356,6 +356,9 @@ int __must_check get_volume_page(struct volume *volume,
byte **data_ptr,
struct delta_index_page **index_page_ptr);
+#if defined(__riscv)
+#define get_cache_size get_cache_size_alias
+#endif
size_t __must_check get_cache_size(struct volume *volume);
int __must_check

View File

@ -1,5 +1,5 @@
#This spec is obtained from source code(kvdo-6.2.2.24.tar.gz)
%define spec_release 2
%define spec_release 3
%define kmod_name kmod-kvdo
%define kmod_driver_version 8.2.1.2
%define kmod_rpm_release %{spec_release}
@ -15,12 +15,13 @@ Summary: Kernel Modules for Virtual Data Optimizer
License: GPLv2+
URL: http://github.com/dm-vdo/kvdo
Source0: https://github.com/dm-vdo/kvdo/archive/refs/tags/%{kmod_driver_version}.tar.gz
Patch1: 01-add-riscv64-support.patch
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
Requires: dkms
Requires: kernel-devel >= %{kmod_kernel_version}
Requires: make
ExclusiveArch: x86_64 aarch64 loongarch64
ExclusiveArch: x86_64 aarch64 loongarch64 riscv64
ExcludeArch: s390 s390x ppc ppc64 ppc64le i686
%description
@ -77,6 +78,9 @@ rm -rf $RPM_BUILD_ROOT
%{_usr}/src/%{kmod_name}-%{version}-%{kmod_rpm_release}/*
%changelog
* Wed Apr 12 2023 laokz <zhangkai@iscas.ac.cn> - 8.2.1.2-3
- Add riscv64 support
* Thu Feb 16 2023 Wenlong Zhang<zhangwenlong@loongson.cn> - 8.2.1.2-2
- Add loongarch64 support