diff options
| author | 2023-01-28 19:38:00 -0500 | |
|---|---|---|
| committer | 2023-01-29 22:08:28 -0500 | |
| commit | 67a8740af6c13d42f3c361c0f242cfa52f94b754 (patch) | |
| tree | 5fd77b9b9cb1abe73bd54522f33d83c0198782da /src/core/hardware_properties.h | |
| parent | Merge pull request #9682 from ameerj/shader-s32 (diff) | |
| download | yuzu-67a8740af6c13d42f3c361c0f242cfa52f94b754.tar.gz yuzu-67a8740af6c13d42f3c361c0f242cfa52f94b754.tar.xz yuzu-67a8740af6c13d42f3c361c0f242cfa52f94b754.zip | |
kernel: add KCapabilities
Diffstat (limited to 'src/core/hardware_properties.h')
| -rw-r--r-- | src/core/hardware_properties.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/core/hardware_properties.h b/src/core/hardware_properties.h index 13cbdb734..45567b840 100644 --- a/src/core/hardware_properties.h +++ b/src/core/hardware_properties.h | |||
| @@ -25,6 +25,26 @@ constexpr std::array<s32, Common::BitSize<u64>()> VirtualToPhysicalCoreMap{ | |||
| 25 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, | 25 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, |
| 26 | }; | 26 | }; |
| 27 | 27 | ||
| 28 | static constexpr inline size_t NumVirtualCores = Common::BitSize<u64>(); | ||
| 29 | |||
| 30 | static constexpr inline u64 VirtualCoreMask = [] { | ||
| 31 | u64 mask = 0; | ||
| 32 | for (size_t i = 0; i < NumVirtualCores; ++i) { | ||
| 33 | mask |= (UINT64_C(1) << i); | ||
| 34 | } | ||
| 35 | return mask; | ||
| 36 | }(); | ||
| 37 | |||
| 38 | static constexpr inline u64 ConvertVirtualCoreMaskToPhysical(u64 v_core_mask) { | ||
| 39 | u64 p_core_mask = 0; | ||
| 40 | while (v_core_mask != 0) { | ||
| 41 | const u64 next = std::countr_zero(v_core_mask); | ||
| 42 | v_core_mask &= ~(static_cast<u64>(1) << next); | ||
| 43 | p_core_mask |= (static_cast<u64>(1) << VirtualToPhysicalCoreMap[next]); | ||
| 44 | } | ||
| 45 | return p_core_mask; | ||
| 46 | } | ||
| 47 | |||
| 28 | // Cortex-A57 supports 4 memory watchpoints | 48 | // Cortex-A57 supports 4 memory watchpoints |
| 29 | constexpr u64 NUM_WATCHPOINTS = 4; | 49 | constexpr u64 NUM_WATCHPOINTS = 4; |
| 30 | 50 | ||