diff options
| author | 2022-12-03 12:09:21 -0500 | |
|---|---|---|
| committer | 2022-12-03 12:09:21 -0500 | |
| commit | 22aff09b33941cdf907e474cb86117fef838abba (patch) | |
| tree | 73a747be44fd2ba994c3d40c8f6ea18633c0f880 /src/core/hle/kernel | |
| parent | Merge pull request #9353 from vonchenplus/draw_indexed (diff) | |
| parent | general: fix compile for Apple Clang (diff) | |
| download | yuzu-22aff09b33941cdf907e474cb86117fef838abba.tar.gz yuzu-22aff09b33941cdf907e474cb86117fef838abba.tar.xz yuzu-22aff09b33941cdf907e474cb86117fef838abba.zip | |
Merge pull request #9289 from liamwhite/fruit-company
general: fix compile for Apple Clang
Diffstat (limited to 'src/core/hle/kernel')
| -rw-r--r-- | src/core/hle/kernel/k_memory_manager.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/kernel/k_slab_heap.h | 6 | ||||
| -rw-r--r-- | src/core/hle/kernel/k_thread_local_page.h | 1 | ||||
| -rw-r--r-- | src/core/hle/kernel/service_thread.cpp | 1 | ||||
| -rw-r--r-- | src/core/hle/kernel/svc_wrap.h | 4 |
5 files changed, 8 insertions, 8 deletions
diff --git a/src/core/hle/kernel/k_memory_manager.cpp b/src/core/hle/kernel/k_memory_manager.cpp index c4bf306e8..bd33571da 100644 --- a/src/core/hle/kernel/k_memory_manager.cpp +++ b/src/core/hle/kernel/k_memory_manager.cpp | |||
| @@ -225,8 +225,8 @@ Result KMemoryManager::AllocatePageGroupImpl(KPageGroup* out, size_t num_pages, | |||
| 225 | ON_RESULT_FAILURE { | 225 | ON_RESULT_FAILURE { |
| 226 | for (const auto& it : out->Nodes()) { | 226 | for (const auto& it : out->Nodes()) { |
| 227 | auto& manager = this->GetManager(it.GetAddress()); | 227 | auto& manager = this->GetManager(it.GetAddress()); |
| 228 | const size_t node_num_pages = | 228 | const size_t node_num_pages = std::min<u64>( |
| 229 | std::min(it.GetNumPages(), (manager.GetEndAddress() - it.GetAddress()) / PageSize); | 229 | it.GetNumPages(), (manager.GetEndAddress() - it.GetAddress()) / PageSize); |
| 230 | manager.Free(it.GetAddress(), node_num_pages); | 230 | manager.Free(it.GetAddress(), node_num_pages); |
| 231 | } | 231 | } |
| 232 | out->Finalize(); | 232 | out->Finalize(); |
diff --git a/src/core/hle/kernel/k_slab_heap.h b/src/core/hle/kernel/k_slab_heap.h index a8c77a7d4..68469b041 100644 --- a/src/core/hle/kernel/k_slab_heap.h +++ b/src/core/hle/kernel/k_slab_heap.h | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | #include <atomic> | 6 | #include <atomic> |
| 7 | 7 | ||
| 8 | #include "common/assert.h" | 8 | #include "common/assert.h" |
| 9 | #include "common/atomic_ops.h" | ||
| 9 | #include "common/common_funcs.h" | 10 | #include "common/common_funcs.h" |
| 10 | #include "common/common_types.h" | 11 | #include "common/common_types.h" |
| 11 | #include "common/spin_lock.h" | 12 | #include "common/spin_lock.h" |
| @@ -82,16 +83,13 @@ private: | |||
| 82 | 83 | ||
| 83 | private: | 84 | private: |
| 84 | void UpdatePeakImpl(uintptr_t obj) { | 85 | void UpdatePeakImpl(uintptr_t obj) { |
| 85 | static_assert(std::atomic_ref<uintptr_t>::is_always_lock_free); | ||
| 86 | std::atomic_ref<uintptr_t> peak_ref(m_peak); | ||
| 87 | |||
| 88 | const uintptr_t alloc_peak = obj + this->GetObjectSize(); | 86 | const uintptr_t alloc_peak = obj + this->GetObjectSize(); |
| 89 | uintptr_t cur_peak = m_peak; | 87 | uintptr_t cur_peak = m_peak; |
| 90 | do { | 88 | do { |
| 91 | if (alloc_peak <= cur_peak) { | 89 | if (alloc_peak <= cur_peak) { |
| 92 | break; | 90 | break; |
| 93 | } | 91 | } |
| 94 | } while (!peak_ref.compare_exchange_strong(cur_peak, alloc_peak)); | 92 | } while (!Common::AtomicCompareAndSwap(&m_peak, alloc_peak, cur_peak, cur_peak)); |
| 95 | } | 93 | } |
| 96 | 94 | ||
| 97 | public: | 95 | public: |
diff --git a/src/core/hle/kernel/k_thread_local_page.h b/src/core/hle/kernel/k_thread_local_page.h index 5d466ace7..fe0cff084 100644 --- a/src/core/hle/kernel/k_thread_local_page.h +++ b/src/core/hle/kernel/k_thread_local_page.h | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include "common/assert.h" | 10 | #include "common/assert.h" |
| 11 | #include "common/common_types.h" | 11 | #include "common/common_types.h" |
| 12 | #include "common/intrusive_red_black_tree.h" | 12 | #include "common/intrusive_red_black_tree.h" |
| 13 | #include "common/polyfill_ranges.h" | ||
| 13 | #include "core/hle/kernel/memory_types.h" | 14 | #include "core/hle/kernel/memory_types.h" |
| 14 | #include "core/hle/kernel/slab_helpers.h" | 15 | #include "core/hle/kernel/slab_helpers.h" |
| 15 | #include "core/hle/result.h" | 16 | #include "core/hle/result.h" |
diff --git a/src/core/hle/kernel/service_thread.cpp b/src/core/hle/kernel/service_thread.cpp index e6e41ac34..0690f9a1c 100644 --- a/src/core/hle/kernel/service_thread.cpp +++ b/src/core/hle/kernel/service_thread.cpp | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include <thread> | 7 | #include <thread> |
| 8 | #include <vector> | 8 | #include <vector> |
| 9 | 9 | ||
| 10 | #include "common/polyfill_thread.h" | ||
| 10 | #include "common/scope_exit.h" | 11 | #include "common/scope_exit.h" |
| 11 | #include "common/thread.h" | 12 | #include "common/thread.h" |
| 12 | #include "core/hle/ipc_helpers.h" | 13 | #include "core/hle/ipc_helpers.h" |
diff --git a/src/core/hle/kernel/svc_wrap.h b/src/core/hle/kernel/svc_wrap.h index 3730937fe..1ea8c7fbc 100644 --- a/src/core/hle/kernel/svc_wrap.h +++ b/src/core/hle/kernel/svc_wrap.h | |||
| @@ -82,7 +82,7 @@ void SvcWrap64(Core::System& system) { | |||
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | // Used by ControlCodeMemory | 84 | // Used by ControlCodeMemory |
| 85 | template <Result func(Core::System&, Handle, u32, u64, u64, Svc::MemoryPermission)> | 85 | template <Result func(Core::System&, Handle, u32, VAddr, size_t, Svc::MemoryPermission)> |
| 86 | void SvcWrap64(Core::System& system) { | 86 | void SvcWrap64(Core::System& system) { |
| 87 | FuncReturn(system, func(system, static_cast<Handle>(Param(system, 0)), | 87 | FuncReturn(system, func(system, static_cast<Handle>(Param(system, 0)), |
| 88 | static_cast<u32>(Param(system, 1)), Param(system, 2), Param(system, 3), | 88 | static_cast<u32>(Param(system, 1)), Param(system, 2), Param(system, 3), |
| @@ -327,7 +327,7 @@ void SvcWrap64(Core::System& system) { | |||
| 327 | } | 327 | } |
| 328 | 328 | ||
| 329 | // Used by CreateCodeMemory | 329 | // Used by CreateCodeMemory |
| 330 | template <Result func(Core::System&, Handle*, u64, u64)> | 330 | template <Result func(Core::System&, Handle*, VAddr, size_t)> |
| 331 | void SvcWrap64(Core::System& system) { | 331 | void SvcWrap64(Core::System& system) { |
| 332 | u32 param_1 = 0; | 332 | u32 param_1 = 0; |
| 333 | const u32 retval = func(system, ¶m_1, Param(system, 1), Param(system, 2)).raw; | 333 | const u32 retval = func(system, ¶m_1, Param(system, 1), Param(system, 2)).raw; |