Define NR_getrandom for riscv64

This syscall is required by generatekey in keystore.

Signed-off-by: Liu Cunyuan <liucunyuan.lcy@linux.alibaba.com>
Signed-off-by: Mao Han <han_mao@linux.alibaba.com>
Change-Id: I4dd0534daa6cfa52429e5bf398679fccb7d67e7f
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/53765
Reviewed-by: Adam Langley <agl@google.com>
Commit-Queue: Adam Langley <agl@google.com>
diff --git a/crypto/fipsmodule/rand/getrandom_fillin.h b/crypto/fipsmodule/rand/getrandom_fillin.h
index 9871854..c0dea35 100644
--- a/crypto/fipsmodule/rand/getrandom_fillin.h
+++ b/crypto/fipsmodule/rand/getrandom_fillin.h
@@ -32,6 +32,8 @@
 #define EXPECTED_NR_getrandom 384
 #elif defined(OPENSSL_PPC64LE)
 #define EXPECTED_NR_getrandom 359
+#elif defined(OPENSSL_RISCV64)
+#define EXPECTED_NR_getrandom 278
 #endif
 
 #if defined(EXPECTED_NR_getrandom)
diff --git a/include/openssl/base.h b/include/openssl/base.h
index 76955c7..1e7da87 100644
--- a/include/openssl/base.h
+++ b/include/openssl/base.h
@@ -120,6 +120,7 @@
 #define OPENSSL_32_BIT
 #elif defined(__riscv) && __riscv_xlen == 64
 #define OPENSSL_64_BIT
+#define OPENSSL_RISCV64
 #else
 // Note BoringSSL only supports standard 32-bit and 64-bit two's-complement,
 // little-endian architectures. Functions will not produce the correct answer