kmod-kvdo/01-add-riscv64-support.patch
laokz b585583b89 add riscv64 support
Modify get_cache_size to get_cache_size_alias because it
conflicts with KERNEL/arch/riscv/include/asm/cacheinfo.h
namespace.
2023-04-11 21:17:30 +08:00

28 lines
811 B
Diff

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