diff options
| author | Ameer J <52414509+ameerj@users.noreply.github.com> | 2023-11-26 21:08:53 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-26 21:08:53 -0500 |
| commit | a9e011c9c2c3efd777fabbac709f2af3bc7627d4 (patch) | |
| tree | c219aacab776c0a1e3956614b60a01fa2f6164cb /src/common/arm64/native_clock.cpp | |
| parent | b49639e786bc9a9ec324b30574d296df1f743733 (diff) | |
| parent | 896ae72dbf9dbcfb1d804ab70d871f0d3a4bb513 (diff) | |
Merge branch 'master' into ssbo-align
Diffstat (limited to 'src/common/arm64/native_clock.cpp')
| -rw-r--r-- | src/common/arm64/native_clock.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/common/arm64/native_clock.cpp b/src/common/arm64/native_clock.cpp index 88fdba5277..f437d71870 100644 --- a/src/common/arm64/native_clock.cpp +++ b/src/common/arm64/native_clock.cpp @@ -1,6 +1,9 @@ // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +#ifdef ANDROID +#include <sys/system_properties.h> +#endif #include "common/arm64/native_clock.h" namespace Common::Arm64 { @@ -65,7 +68,23 @@ bool NativeClock::IsNative() const { u64 NativeClock::GetHostCNTFRQ() { u64 cntfrq_el0 = 0; - asm("mrs %[cntfrq_el0], cntfrq_el0" : [cntfrq_el0] "=r"(cntfrq_el0)); + std::string_view board{""}; +#ifdef ANDROID + char buffer[PROP_VALUE_MAX]; + int len{__system_property_get("ro.product.board", buffer)}; + board = std::string_view(buffer, static_cast<size_t>(len)); +#endif + if (board == "s5e9925") { // Exynos 2200 + cntfrq_el0 = 25600000; + } else if (board == "exynos2100") { // Exynos 2100 + cntfrq_el0 = 26000000; + } else if (board == "exynos9810") { // Exynos 9810 + cntfrq_el0 = 26000000; + } else if (board == "s5e8825") { // Exynos 1280 + cntfrq_el0 = 26000000; + } else { + asm("mrs %[cntfrq_el0], cntfrq_el0" : [cntfrq_el0] "=r"(cntfrq_el0)); + } return cntfrq_el0; } |
