summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/svc
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2023-03-07 18:01:07 +0100
committerLiam <byteslice@airmail.cc>2023-03-13 03:09:09 +0100
commitac6cbb7134d71134e4beae91361a78fa68202c22 (patch)
tree19ac300007ee99c87138203809005fb708257b21 /src/core/hle/kernel/svc
parentkernel: convert KResourceLimit (diff)
downloadyuzu-ac6cbb7134d71134e4beae91361a78fa68202c22.tar
yuzu-ac6cbb7134d71134e4beae91361a78fa68202c22.tar.gz
yuzu-ac6cbb7134d71134e4beae91361a78fa68202c22.tar.bz2
yuzu-ac6cbb7134d71134e4beae91361a78fa68202c22.tar.lz
yuzu-ac6cbb7134d71134e4beae91361a78fa68202c22.tar.xz
yuzu-ac6cbb7134d71134e4beae91361a78fa68202c22.tar.zst
yuzu-ac6cbb7134d71134e4beae91361a78fa68202c22.zip
Diffstat (limited to 'src/core/hle/kernel/svc')
-rw-r--r--src/core/hle/kernel/svc/svc_info.cpp4
-rw-r--r--src/core/hle/kernel/svc/svc_ipc.cpp2
-rw-r--r--src/core/hle/kernel/svc/svc_query_memory.cpp2
-rw-r--r--src/core/hle/kernel/svc/svc_resource_limit.cpp2
-rw-r--r--src/core/hle/kernel/svc/svc_secure_monitor_call.cpp4
-rw-r--r--src/core/hle/kernel/svc/svc_session.cpp9
-rw-r--r--src/core/hle/kernel/svc/svc_thread.cpp8
-rw-r--r--src/core/hle/kernel/svc/svc_transfer_memory.cpp2
8 files changed, 17 insertions, 16 deletions
diff --git a/src/core/hle/kernel/svc/svc_info.cpp b/src/core/hle/kernel/svc/svc_info.cpp
index 806acb539..7d94347c5 100644
--- a/src/core/hle/kernel/svc/svc_info.cpp
+++ b/src/core/hle/kernel/svc/svc_info.cpp
@@ -153,7 +153,7 @@ Result GetInfo(Core::System& system, u64* result, InfoType info_id_type, Handle
}
Handle resource_handle{};
- R_TRY(handle_table.Add(&resource_handle, resource_limit));
+ R_TRY(handle_table.Add(std::addressof(resource_handle), resource_limit));
*result = resource_handle;
R_SUCCEED();
@@ -234,7 +234,7 @@ Result GetInfo(Core::System& system, u64* result, InfoType info_id_type, Handle
// Get a new handle for the current process.
Handle tmp;
- R_TRY(handle_table.Add(&tmp, current_process));
+ R_TRY(handle_table.Add(std::addressof(tmp), current_process));
// Set the output.
*result = tmp;
diff --git a/src/core/hle/kernel/svc/svc_ipc.cpp b/src/core/hle/kernel/svc/svc_ipc.cpp
index bca303650..46fd0f2ea 100644
--- a/src/core/hle/kernel/svc/svc_ipc.cpp
+++ b/src/core/hle/kernel/svc/svc_ipc.cpp
@@ -79,7 +79,7 @@ Result ReplyAndReceive(Core::System& system, s32* out_index, uint64_t handles_ad
while (true) {
// Wait for an object.
s32 index;
- Result result = KSynchronizationObject::Wait(kernel, &index, objs.data(),
+ Result result = KSynchronizationObject::Wait(kernel, std::addressof(index), objs.data(),
static_cast<s32>(objs.size()), timeout_ns);
if (result == ResultTimedOut) {
R_RETURN(result);
diff --git a/src/core/hle/kernel/svc/svc_query_memory.cpp b/src/core/hle/kernel/svc/svc_query_memory.cpp
index b2290164c..457ebf950 100644
--- a/src/core/hle/kernel/svc/svc_query_memory.cpp
+++ b/src/core/hle/kernel/svc/svc_query_memory.cpp
@@ -33,7 +33,7 @@ Result QueryProcessMemory(Core::System& system, uint64_t out_memory_info, PageIn
auto& memory{system.Memory()};
const auto memory_info{process->PageTable().QueryInfo(address).GetSvcMemoryInfo()};
- memory.WriteBlock(out_memory_info, &memory_info, sizeof(memory_info));
+ memory.WriteBlock(out_memory_info, std::addressof(memory_info), sizeof(memory_info));
//! This is supposed to be part of the QueryInfo call.
*out_page_info = {};
diff --git a/src/core/hle/kernel/svc/svc_resource_limit.cpp b/src/core/hle/kernel/svc/svc_resource_limit.cpp
index d96a7e879..732bc017e 100644
--- a/src/core/hle/kernel/svc/svc_resource_limit.cpp
+++ b/src/core/hle/kernel/svc/svc_resource_limit.cpp
@@ -21,7 +21,7 @@ Result CreateResourceLimit(Core::System& system, Handle* out_handle) {
SCOPE_EXIT({ resource_limit->Close(); });
// Initialize the resource limit.
- resource_limit->Initialize(&system.CoreTiming());
+ resource_limit->Initialize(std::addressof(system.CoreTiming()));
// Register the limit.
KResourceLimit::Register(kernel, resource_limit);
diff --git a/src/core/hle/kernel/svc/svc_secure_monitor_call.cpp b/src/core/hle/kernel/svc/svc_secure_monitor_call.cpp
index 20f6ec643..62c781551 100644
--- a/src/core/hle/kernel/svc/svc_secure_monitor_call.cpp
+++ b/src/core/hle/kernel/svc/svc_secure_monitor_call.cpp
@@ -29,7 +29,7 @@ void SvcWrap_CallSecureMonitor64(Core::System& system) {
args.r[i] = core.GetReg(i);
}
- CallSecureMonitor64(system, &args);
+ CallSecureMonitor64(system, std::addressof(args));
for (int i = 0; i < 8; i++) {
core.SetReg(i, args.r[i]);
@@ -43,7 +43,7 @@ void SvcWrap_CallSecureMonitor64From32(Core::System& system) {
args.r[i] = static_cast<u32>(core.GetReg(i));
}
- CallSecureMonitor64From32(system, &args);
+ CallSecureMonitor64From32(system, std::addressof(args));
for (int i = 0; i < 8; i++) {
core.SetReg(i, args.r[i]);
diff --git a/src/core/hle/kernel/svc/svc_session.cpp b/src/core/hle/kernel/svc/svc_session.cpp
index d5a3d0120..01b8a52ad 100644
--- a/src/core/hle/kernel/svc/svc_session.cpp
+++ b/src/core/hle/kernel/svc/svc_session.cpp
@@ -21,7 +21,8 @@ Result CreateSession(Core::System& system, Handle* out_server, Handle* out_clien
// Reserve a new session from the process resource limit.
// FIXME: LimitableResource_SessionCountMax
- KScopedResourceReservation session_reservation(&process, LimitableResource::SessionCountMax);
+ KScopedResourceReservation session_reservation(std::addressof(process),
+ LimitableResource::SessionCountMax);
if (session_reservation.Succeeded()) {
session = T::Create(system.Kernel());
} else {
@@ -30,7 +31,7 @@ Result CreateSession(Core::System& system, Handle* out_server, Handle* out_clien
// // We couldn't reserve a session. Check that we support dynamically expanding the
// // resource limit.
// R_UNLESS(process.GetResourceLimit() ==
- // &system.Kernel().GetSystemResourceLimit(), ResultLimitReached);
+ // std::addressof(system.Kernel().GetSystemResourceLimit()), ResultLimitReached);
// R_UNLESS(KTargetSystem::IsDynamicResourceLimitsEnabled(), ResultLimitReached());
// // Try to allocate a session from unused slab memory.
@@ -75,7 +76,7 @@ Result CreateSession(Core::System& system, Handle* out_server, Handle* out_clien
T::Register(system.Kernel(), session);
// Add the server session to the handle table.
- R_TRY(handle_table.Add(out_server, &session->GetServerSession()));
+ R_TRY(handle_table.Add(out_server, std::addressof(session->GetServerSession())));
// Ensure that we maintain a clean handle state on exit.
ON_RESULT_FAILURE {
@@ -83,7 +84,7 @@ Result CreateSession(Core::System& system, Handle* out_server, Handle* out_clien
};
// Add the client session to the handle table.
- R_RETURN(handle_table.Add(out_client, &session->GetClientSession()));
+ R_RETURN(handle_table.Add(out_client, std::addressof(session->GetClientSession())));
}
} // namespace
diff --git a/src/core/hle/kernel/svc/svc_thread.cpp b/src/core/hle/kernel/svc/svc_thread.cpp
index 5e888153b..a16fc7ae3 100644
--- a/src/core/hle/kernel/svc/svc_thread.cpp
+++ b/src/core/hle/kernel/svc/svc_thread.cpp
@@ -42,9 +42,9 @@ Result CreateThread(Core::System& system, Handle* out_handle, VAddr entry_point,
R_UNLESS(process.CheckThreadPriority(priority), ResultInvalidPriority);
// Reserve a new thread from the process resource limit (waiting up to 100ms).
- KScopedResourceReservation thread_reservation(&process, LimitableResource::ThreadCountMax, 1,
- system.CoreTiming().GetGlobalTimeNs().count() +
- 100000000);
+ KScopedResourceReservation thread_reservation(
+ std::addressof(process), LimitableResource::ThreadCountMax, 1,
+ system.CoreTiming().GetGlobalTimeNs().count() + 100000000);
R_UNLESS(thread_reservation.Succeeded(), ResultLimitReached);
// Create the thread.
@@ -56,7 +56,7 @@ Result CreateThread(Core::System& system, Handle* out_handle, VAddr entry_point,
{
KScopedLightLock lk{process.GetStateLock()};
R_TRY(KThread::InitializeUserThread(system, thread, entry_point, arg, stack_bottom,
- priority, core_id, &process));
+ priority, core_id, std::addressof(process)));
}
// Set the thread name for debugging purposes.
diff --git a/src/core/hle/kernel/svc/svc_transfer_memory.cpp b/src/core/hle/kernel/svc/svc_transfer_memory.cpp
index ff4a87916..394f06728 100644
--- a/src/core/hle/kernel/svc/svc_transfer_memory.cpp
+++ b/src/core/hle/kernel/svc/svc_transfer_memory.cpp
@@ -43,7 +43,7 @@ Result CreateTransferMemory(Core::System& system, Handle* out, VAddr address, u6
auto& handle_table = process.GetHandleTable();
// Reserve a new transfer memory from the process resource limit.
- KScopedResourceReservation trmem_reservation(&process,
+ KScopedResourceReservation trmem_reservation(std::addressof(process),
LimitableResource::TransferMemoryCountMax);
R_UNLESS(trmem_reservation.Succeeded(), ResultLimitReached);