summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar liamwhite2022-12-03 12:09:21 -0500
committerGravatar GitHub2022-12-03 12:09:21 -0500
commit22aff09b33941cdf907e474cb86117fef838abba (patch)
tree73a747be44fd2ba994c3d40c8f6ea18633c0f880 /src/core
parentMerge pull request #9353 from vonchenplus/draw_indexed (diff)
parentgeneral: fix compile for Apple Clang (diff)
downloadyuzu-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')
-rw-r--r--src/core/cpu_manager.h1
-rw-r--r--src/core/debugger/debugger.cpp1
-rw-r--r--src/core/file_sys/content_archive.cpp1
-rw-r--r--src/core/frontend/applets/controller.h1
-rw-r--r--src/core/hid/emulated_controller.h1
-rw-r--r--src/core/hid/emulated_devices.h1
-rw-r--r--src/core/hle/kernel/k_memory_manager.cpp4
-rw-r--r--src/core/hle/kernel/k_slab_heap.h6
-rw-r--r--src/core/hle/kernel/k_thread_local_page.h1
-rw-r--r--src/core/hle/kernel/service_thread.cpp1
-rw-r--r--src/core/hle/kernel/svc_wrap.h4
-rw-r--r--src/core/hle/service/acc/acc.cpp1
-rw-r--r--src/core/hle/service/acc/profile_manager.cpp1
-rw-r--r--src/core/hle/service/am/am.cpp4
-rw-r--r--src/core/hle/service/audio/audren_u.cpp1
-rw-r--r--src/core/hle/service/nvflinger/nvflinger.h1
-rw-r--r--src/core/internal_network/network_interface.cpp1
17 files changed, 21 insertions, 10 deletions
diff --git a/src/core/cpu_manager.h b/src/core/cpu_manager.h
index 95ea3ef39..374367468 100644
--- a/src/core/cpu_manager.h
+++ b/src/core/cpu_manager.h
@@ -10,6 +10,7 @@
10#include <thread> 10#include <thread>
11 11
12#include "common/fiber.h" 12#include "common/fiber.h"
13#include "common/polyfill_thread.h"
13#include "common/thread.h" 14#include "common/thread.h"
14#include "core/hardware_properties.h" 15#include "core/hardware_properties.h"
15 16
diff --git a/src/core/debugger/debugger.cpp b/src/core/debugger/debugger.cpp
index 1a8e02e6a..a9675df76 100644
--- a/src/core/debugger/debugger.cpp
+++ b/src/core/debugger/debugger.cpp
@@ -9,6 +9,7 @@
9#include <boost/process/async_pipe.hpp> 9#include <boost/process/async_pipe.hpp>
10 10
11#include "common/logging/log.h" 11#include "common/logging/log.h"
12#include "common/polyfill_thread.h"
12#include "common/thread.h" 13#include "common/thread.h"
13#include "core/core.h" 14#include "core/core.h"
14#include "core/debugger/debugger.h" 15#include "core/debugger/debugger.h"
diff --git a/src/core/file_sys/content_archive.cpp b/src/core/file_sys/content_archive.cpp
index 78e56bbbd..50303fe42 100644
--- a/src/core/file_sys/content_archive.cpp
+++ b/src/core/file_sys/content_archive.cpp
@@ -7,6 +7,7 @@
7#include <utility> 7#include <utility>
8 8
9#include "common/logging/log.h" 9#include "common/logging/log.h"
10#include "common/polyfill_ranges.h"
10#include "core/crypto/aes_util.h" 11#include "core/crypto/aes_util.h"
11#include "core/crypto/ctr_encryption_layer.h" 12#include "core/crypto/ctr_encryption_layer.h"
12#include "core/crypto/key_manager.h" 13#include "core/crypto/key_manager.h"
diff --git a/src/core/frontend/applets/controller.h b/src/core/frontend/applets/controller.h
index 1d2850ad5..71698df74 100644
--- a/src/core/frontend/applets/controller.h
+++ b/src/core/frontend/applets/controller.h
@@ -4,6 +4,7 @@
4#pragma once 4#pragma once
5 5
6#include <functional> 6#include <functional>
7#include <vector>
7 8
8#include "common/common_types.h" 9#include "common/common_types.h"
9 10
diff --git a/src/core/hid/emulated_controller.h b/src/core/hid/emulated_controller.h
index d004ca56a..3f83108d3 100644
--- a/src/core/hid/emulated_controller.h
+++ b/src/core/hid/emulated_controller.h
@@ -8,6 +8,7 @@
8#include <memory> 8#include <memory>
9#include <mutex> 9#include <mutex>
10#include <unordered_map> 10#include <unordered_map>
11#include <vector>
11 12
12#include "common/common_types.h" 13#include "common/common_types.h"
13#include "common/input.h" 14#include "common/input.h"
diff --git a/src/core/hid/emulated_devices.h b/src/core/hid/emulated_devices.h
index 4149eeced..4cdbf9dc6 100644
--- a/src/core/hid/emulated_devices.h
+++ b/src/core/hid/emulated_devices.h
@@ -8,6 +8,7 @@
8#include <memory> 8#include <memory>
9#include <mutex> 9#include <mutex>
10#include <unordered_map> 10#include <unordered_map>
11#include <vector>
11 12
12#include "common/common_types.h" 13#include "common/common_types.h"
13#include "common/input.h" 14#include "common/input.h"
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
83private: 84private:
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
97public: 95public:
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
85template <Result func(Core::System&, Handle, u32, u64, u64, Svc::MemoryPermission)> 85template <Result func(Core::System&, Handle, u32, VAddr, size_t, Svc::MemoryPermission)>
86void SvcWrap64(Core::System& system) { 86void 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
330template <Result func(Core::System&, Handle*, u64, u64)> 330template <Result func(Core::System&, Handle*, VAddr, size_t)>
331void SvcWrap64(Core::System& system) { 331void SvcWrap64(Core::System& system) {
332 u32 param_1 = 0; 332 u32 param_1 = 0;
333 const u32 retval = func(system, &param_1, Param(system, 1), Param(system, 2)).raw; 333 const u32 retval = func(system, &param_1, Param(system, 1), Param(system, 2)).raw;
diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp
index 85a3f0802..6d1084fd1 100644
--- a/src/core/hle/service/acc/acc.cpp
+++ b/src/core/hle/service/acc/acc.cpp
@@ -7,6 +7,7 @@
7#include "common/fs/file.h" 7#include "common/fs/file.h"
8#include "common/fs/path_util.h" 8#include "common/fs/path_util.h"
9#include "common/logging/log.h" 9#include "common/logging/log.h"
10#include "common/polyfill_ranges.h"
10#include "common/string_util.h" 11#include "common/string_util.h"
11#include "common/swap.h" 12#include "common/swap.h"
12#include "core/constants.h" 13#include "core/constants.h"
diff --git a/src/core/hle/service/acc/profile_manager.cpp b/src/core/hle/service/acc/profile_manager.cpp
index 481e0d141..97f7c6688 100644
--- a/src/core/hle/service/acc/profile_manager.cpp
+++ b/src/core/hle/service/acc/profile_manager.cpp
@@ -9,6 +9,7 @@
9#include "common/fs/file.h" 9#include "common/fs/file.h"
10#include "common/fs/fs.h" 10#include "common/fs/fs.h"
11#include "common/fs/path_util.h" 11#include "common/fs/path_util.h"
12#include "common/polyfill_ranges.h"
12#include "common/settings.h" 13#include "common/settings.h"
13#include "core/hle/service/acc/profile_manager.h" 14#include "core/hle/service/acc/profile_manager.h"
14 15
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index 8ea7fd760..22999c942 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -1125,7 +1125,7 @@ void IStorageAccessor::Write(Kernel::HLERequestContext& ctx) {
1125 1125
1126 const u64 offset{rp.Pop<u64>()}; 1126 const u64 offset{rp.Pop<u64>()};
1127 const std::vector<u8> data{ctx.ReadBuffer()}; 1127 const std::vector<u8> data{ctx.ReadBuffer()};
1128 const std::size_t size{std::min(data.size(), backing.GetSize() - offset)}; 1128 const std::size_t size{std::min<u64>(data.size(), backing.GetSize() - offset)};
1129 1129
1130 LOG_DEBUG(Service_AM, "called, offset={}, size={}", offset, size); 1130 LOG_DEBUG(Service_AM, "called, offset={}, size={}", offset, size);
1131 1131
@@ -1149,7 +1149,7 @@ void IStorageAccessor::Read(Kernel::HLERequestContext& ctx) {
1149 IPC::RequestParser rp{ctx}; 1149 IPC::RequestParser rp{ctx};
1150 1150
1151 const u64 offset{rp.Pop<u64>()}; 1151 const u64 offset{rp.Pop<u64>()};
1152 const std::size_t size{std::min(ctx.GetWriteBufferSize(), backing.GetSize() - offset)}; 1152 const std::size_t size{std::min<u64>(ctx.GetWriteBufferSize(), backing.GetSize() - offset)};
1153 1153
1154 LOG_DEBUG(Service_AM, "called, offset={}, size={}", offset, size); 1154 LOG_DEBUG(Service_AM, "called, offset={}, size={}", offset, size);
1155 1155
diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp
index 034ee273f..3a1c231b6 100644
--- a/src/core/hle/service/audio/audren_u.cpp
+++ b/src/core/hle/service/audio/audren_u.cpp
@@ -14,6 +14,7 @@
14#include "common/bit_util.h" 14#include "common/bit_util.h"
15#include "common/common_funcs.h" 15#include "common/common_funcs.h"
16#include "common/logging/log.h" 16#include "common/logging/log.h"
17#include "common/polyfill_ranges.h"
17#include "common/string_util.h" 18#include "common/string_util.h"
18#include "core/core.h" 19#include "core/core.h"
19#include "core/hle/ipc_helpers.h" 20#include "core/hle/ipc_helpers.h"
diff --git a/src/core/hle/service/nvflinger/nvflinger.h b/src/core/hle/service/nvflinger/nvflinger.h
index 460bef976..9b22397db 100644
--- a/src/core/hle/service/nvflinger/nvflinger.h
+++ b/src/core/hle/service/nvflinger/nvflinger.h
@@ -11,6 +11,7 @@
11#include <vector> 11#include <vector>
12 12
13#include "common/common_types.h" 13#include "common/common_types.h"
14#include "common/polyfill_thread.h"
14#include "core/hle/result.h" 15#include "core/hle/result.h"
15#include "core/hle/service/kernel_helpers.h" 16#include "core/hle/service/kernel_helpers.h"
16 17
diff --git a/src/core/internal_network/network_interface.cpp b/src/core/internal_network/network_interface.cpp
index 057fd3661..7b8e510a2 100644
--- a/src/core/internal_network/network_interface.cpp
+++ b/src/core/internal_network/network_interface.cpp
@@ -9,6 +9,7 @@
9#include "common/bit_cast.h" 9#include "common/bit_cast.h"
10#include "common/common_types.h" 10#include "common/common_types.h"
11#include "common/logging/log.h" 11#include "common/logging/log.h"
12#include "common/polyfill_ranges.h"
12#include "common/settings.h" 13#include "common/settings.h"
13#include "common/string_util.h" 14#include "common/string_util.h"
14#include "core/internal_network/network_interface.h" 15#include "core/internal_network/network_interface.h"