aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2022-10-27 18:58:46 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-10-27 18:58:46 +0000
commit6a1878d9f7ce32df26897bef0846cfbb7a51c904 (patch)
tree9ea5f03dfc92eb019cd30b57d59767ad8b9463f3
parenta0700e79f093ede34af1c135c331e24210efb638 (diff)
parentcb42ce4c0c2af858d8c07fd12bae756dca0b6be0 (diff)
downloadpdfium-6a1878d9f7ce32df26897bef0846cfbb7a51c904.tar.gz
Set ARCH_CPU_RISCV64 and provide an implementation of YIELD_PROCESSOR am: 00403d27cc am: cb42ce4c0candroid-u-beta-1-gpl
Original change: https://android-review.googlesource.com/c/platform/external/pdfium/+/2272373 Change-Id: I26d85cf50947dd12fc36de3eba4b8ffb8854d5cc Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--third_party/Android.bp6
-rw-r--r--third_party/base/allocator/partition_allocator/spin_lock.cc4
2 files changed, 10 insertions, 0 deletions
diff --git a/third_party/Android.bp b/third_party/Android.bp
index 3fcb08d80..1c8e251cf 100644
--- a/third_party/Android.bp
+++ b/third_party/Android.bp
@@ -39,6 +39,12 @@ cc_library_static {
"-DARCH_CPU_ARM64",
],
},
+ riscv64: {
+ cflags: [
+ "-DARCH_CPU_64_BITS",
+ "-DARCH_CPU_RISCV64",
+ ],
+ },
x86: {
cflags: [
"-DARCH_CPU_32_BITS",
diff --git a/third_party/base/allocator/partition_allocator/spin_lock.cc b/third_party/base/allocator/partition_allocator/spin_lock.cc
index 42055836b..99e56b256 100644
--- a/third_party/base/allocator/partition_allocator/spin_lock.cc
+++ b/third_party/base/allocator/partition_allocator/spin_lock.cc
@@ -45,6 +45,10 @@
#define YIELD_PROCESSOR __asm__ __volatile__("pause")
#elif defined(ARCH_CPU_PPC64_FAMILY)
#define YIELD_PROCESSOR __asm__ __volatile__("or 31,31,31")
+#elif defined(ARCH_CPU_RISCV64)
+// Encoding of the pause instruction from the Zihintpause extension. This
+// is a noop on cpus that don't have the Zihintpause extension.
+#define YIELD_PROCESSOR __asm__ __volatile__ (".4byte 0x100000F");
#elif defined(ARCH_CPU_S390_FAMILY)
// just do nothing
#define YIELD_PROCESSOR ((void)0)