From e252dfa97779d7ada905b4aabe2e08690640a429 Mon Sep 17 00:00:00 2001 From: Wang Chen Date: Tue, 7 Mar 2023 10:51:05 +0800 Subject: [PATCH] add initial riscv support for cpu features FIXME: I believe there should be more features to be added for riscv. But now let's only add riscv entry for cpu family. Signed-off-by: Wang Chen --- sources/android/cpufeatures/cpu-features.c | 2 ++ sources/android/cpufeatures/cpu-features.h | 1 + 2 files changed, 3 insertions(+) diff --git a/sources/android/cpufeatures/cpu-features.c b/sources/android/cpufeatures/cpu-features.c index 861d14b..e1aa905 100644 --- a/sources/android/cpufeatures/cpu-features.c +++ b/sources/android/cpufeatures/cpu-features.c @@ -619,6 +619,8 @@ android_cpuInitFamily(void) g_cpuFamily = ANDROID_CPU_FAMILY_ARM64; #elif defined(__x86_64__) g_cpuFamily = ANDROID_CPU_FAMILY_X86_64; +#elif defined(__riscv) + g_cpuFamily = ANDROID_CPU_FAMILY_RISCV64; #else g_cpuFamily = ANDROID_CPU_FAMILY_UNKNOWN; #endif diff --git a/sources/android/cpufeatures/cpu-features.h b/sources/android/cpufeatures/cpu-features.h index 33972e9..695e913 100644 --- a/sources/android/cpufeatures/cpu-features.h +++ b/sources/android/cpufeatures/cpu-features.h @@ -49,6 +49,7 @@ typedef enum { ANDROID_CPU_FAMILY_ARM64, ANDROID_CPU_FAMILY_X86_64, ANDROID_CPU_FAMILY_MIPS64, + ANDROID_CPU_FAMILY_RISCV64, ANDROID_CPU_FAMILY_MAX /* do not remove */