summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/kernel/k_process.cpp20
-rw-r--r--src/core/hle/kernel/k_thread.cpp34
2 files changed, 27 insertions, 27 deletions
diff --git a/src/core/hle/kernel/k_process.cpp b/src/core/hle/kernel/k_process.cpp
index 46ac3833e..9d18f4049 100644
--- a/src/core/hle/kernel/k_process.cpp
+++ b/src/core/hle/kernel/k_process.cpp
@@ -137,16 +137,16 @@ u64 KProcess::GetTotalPhysicalMemoryAvailable() {
137} 137}
138 138
139u64 KProcess::GetTotalPhysicalMemoryAvailableWithoutSystemResource() { 139u64 KProcess::GetTotalPhysicalMemoryAvailableWithoutSystemResource() {
140 return GetTotalPhysicalMemoryAvailable() - GetSystemResourceSize(); 140 return this->GetTotalPhysicalMemoryAvailable() - this->GetSystemResourceSize();
141} 141}
142 142
143u64 KProcess::GetTotalPhysicalMemoryUsed() { 143u64 KProcess::GetTotalPhysicalMemoryUsed() {
144 return m_image_size + m_main_thread_stack_size + m_page_table.GetNormalMemorySize() + 144 return m_image_size + m_main_thread_stack_size + m_page_table.GetNormalMemorySize() +
145 GetSystemResourceSize(); 145 this->GetSystemResourceSize();
146} 146}
147 147
148u64 KProcess::GetTotalPhysicalMemoryUsedWithoutSystemResource() { 148u64 KProcess::GetTotalPhysicalMemoryUsedWithoutSystemResource() {
149 return GetTotalPhysicalMemoryUsed() - GetSystemResourceUsage(); 149 return this->GetTotalPhysicalMemoryUsed() - this->GetSystemResourceUsage();
150} 150}
151 151
152bool KProcess::ReleaseUserException(KThread* thread) { 152bool KProcess::ReleaseUserException(KThread* thread) {
@@ -182,7 +182,7 @@ void KProcess::PinCurrentThread(s32 core_id) {
182 // If the thread isn't terminated, pin it. 182 // If the thread isn't terminated, pin it.
183 if (!cur_thread->IsTerminationRequested()) { 183 if (!cur_thread->IsTerminationRequested()) {
184 // Pin it. 184 // Pin it.
185 PinThread(core_id, cur_thread); 185 this->PinThread(core_id, cur_thread);
186 cur_thread->Pin(core_id); 186 cur_thread->Pin(core_id);
187 187
188 // An update is needed. 188 // An update is needed.
@@ -199,7 +199,7 @@ void KProcess::UnpinCurrentThread(s32 core_id) {
199 199
200 // Unpin it. 200 // Unpin it.
201 cur_thread->Unpin(); 201 cur_thread->Unpin();
202 UnpinThread(core_id, cur_thread); 202 this->UnpinThread(core_id, cur_thread);
203 203
204 // An update is needed. 204 // An update is needed.
205 KScheduler::SetSchedulerUpdateNeeded(m_kernel); 205 KScheduler::SetSchedulerUpdateNeeded(m_kernel);
@@ -212,7 +212,7 @@ void KProcess::UnpinThread(KThread* thread) {
212 const auto core_id = thread->GetActiveCore(); 212 const auto core_id = thread->GetActiveCore();
213 213
214 // Unpin it. 214 // Unpin it.
215 UnpinThread(core_id, thread); 215 this->UnpinThread(core_id, thread);
216 thread->Unpin(); 216 thread->Unpin();
217 217
218 // An update is needed. 218 // An update is needed.
@@ -330,7 +330,7 @@ Result KProcess::SetActivity(ProcessActivity activity) {
330 } 330 }
331 331
332 // Set ourselves as suspended. 332 // Set ourselves as suspended.
333 SetSuspended(true); 333 this->SetSuspended(true);
334 } else { 334 } else {
335 ASSERT(activity == ProcessActivity::Runnable); 335 ASSERT(activity == ProcessActivity::Runnable);
336 336
@@ -343,7 +343,7 @@ Result KProcess::SetActivity(ProcessActivity activity) {
343 } 343 }
344 344
345 // Set ourselves as resumed. 345 // Set ourselves as resumed.
346 SetSuspended(false); 346 this->SetSuspended(false);
347 } 347 }
348 348
349 R_SUCCEED(); 349 R_SUCCEED();
@@ -457,7 +457,7 @@ void KProcess::PrepareForTermination() {
457 m_main_thread_stack_size + m_image_size); 457 m_main_thread_stack_size + m_image_size);
458 } 458 }
459 459
460 ChangeState(State::Terminated); 460 this->ChangeState(State::Terminated);
461} 461}
462 462
463void KProcess::Finalize() { 463void KProcess::Finalize() {
@@ -489,7 +489,7 @@ void KProcess::Finalize() {
489 m_page_table.Finalize(); 489 m_page_table.Finalize();
490 490
491 // Perform inherited finalization. 491 // Perform inherited finalization.
492 KAutoObjectWithSlabHeapAndContainer<KProcess, KWorkerTask>::Finalize(); 492 KSynchronizationObject::Finalize();
493} 493}
494 494
495Result KProcess::CreateThreadLocalRegion(VAddr* out) { 495Result KProcess::CreateThreadLocalRegion(VAddr* out) {
diff --git a/src/core/hle/kernel/k_thread.cpp b/src/core/hle/kernel/k_thread.cpp
index 2eee85258..c0e3ecb45 100644
--- a/src/core/hle/kernel/k_thread.cpp
+++ b/src/core/hle/kernel/k_thread.cpp
@@ -206,7 +206,7 @@ Result KThread::Initialize(KThreadFunction func, uintptr_t arg, VAddr user_stack
206 m_argument = arg; 206 m_argument = arg;
207 207
208 // Clear our stack parameters. 208 // Clear our stack parameters.
209 std::memset(static_cast<void*>(std::addressof(GetStackParameters())), 0, 209 std::memset(static_cast<void*>(std::addressof(this->GetStackParameters())), 0,
210 sizeof(StackParameters)); 210 sizeof(StackParameters));
211 211
212 // Set parent, if relevant. 212 // Set parent, if relevant.
@@ -774,13 +774,13 @@ void KThread::WaitCancel() {
774 774
775void KThread::TrySuspend() { 775void KThread::TrySuspend() {
776 ASSERT(KScheduler::IsSchedulerLockedByCurrentThread(m_kernel)); 776 ASSERT(KScheduler::IsSchedulerLockedByCurrentThread(m_kernel));
777 ASSERT(IsSuspendRequested()); 777 ASSERT(this->IsSuspendRequested());
778 778
779 // Ensure that we have no waiters. 779 // Ensure that we have no waiters.
780 if (GetNumKernelWaiters() > 0) { 780 if (this->GetNumKernelWaiters() > 0) {
781 return; 781 return;
782 } 782 }
783 ASSERT(GetNumKernelWaiters() == 0); 783 ASSERT(this->GetNumKernelWaiters() == 0);
784 784
785 // Perform the suspend. 785 // Perform the suspend.
786 this->UpdateState(); 786 this->UpdateState();
@@ -916,7 +916,7 @@ Result KThread::GetThreadContext3(std::vector<u8>& out) {
916 KScopedSchedulerLock sl{m_kernel}; 916 KScopedSchedulerLock sl{m_kernel};
917 917
918 // Verify that we're suspended. 918 // Verify that we're suspended.
919 R_UNLESS(IsSuspendRequested(SuspendType::Thread), ResultInvalidState); 919 R_UNLESS(this->IsSuspendRequested(SuspendType::Thread), ResultInvalidState);
920 920
921 // If we're not terminating, get the thread's user context. 921 // If we're not terminating, get the thread's user context.
922 if (!this->IsTerminationRequested()) { 922 if (!this->IsTerminationRequested()) {
@@ -951,14 +951,14 @@ void KThread::AddHeldLock(LockWithPriorityInheritanceInfo* lock_info) {
951 m_held_lock_info_list.push_front(*lock_info); 951 m_held_lock_info_list.push_front(*lock_info);
952} 952}
953 953
954KThread::LockWithPriorityInheritanceInfo* KThread::FindHeldLock(VAddr address_key_, 954KThread::LockWithPriorityInheritanceInfo* KThread::FindHeldLock(VAddr address_key,
955 bool is_kernel_address_key_) { 955 bool is_kernel_address_key) {
956 ASSERT(KScheduler::IsSchedulerLockedByCurrentThread(m_kernel)); 956 ASSERT(KScheduler::IsSchedulerLockedByCurrentThread(m_kernel));
957 957
958 // Try to find an existing held lock. 958 // Try to find an existing held lock.
959 for (auto& held_lock : m_held_lock_info_list) { 959 for (auto& held_lock : m_held_lock_info_list) {
960 if (held_lock.GetAddressKey() == address_key_ && 960 if (held_lock.GetAddressKey() == address_key &&
961 held_lock.GetIsKernelAddressKey() == is_kernel_address_key_) { 961 held_lock.GetIsKernelAddressKey() == is_kernel_address_key) {
962 return std::addressof(held_lock); 962 return std::addressof(held_lock);
963 } 963 }
964 } 964 }
@@ -1166,7 +1166,7 @@ Result KThread::Run() {
1166 1166
1167 // If we're not a kernel thread and we've been asked to suspend, suspend ourselves. 1167 // If we're not a kernel thread and we've been asked to suspend, suspend ourselves.
1168 if (KProcess* owner = this->GetOwnerProcess(); owner != nullptr) { 1168 if (KProcess* owner = this->GetOwnerProcess(); owner != nullptr) {
1169 if (IsUserThread() && IsSuspended()) { 1169 if (this->IsUserThread() && this->IsSuspended()) {
1170 this->UpdateState(); 1170 this->UpdateState();
1171 } 1171 }
1172 owner->IncrementRunningThreadCount(); 1172 owner->IncrementRunningThreadCount();
@@ -1201,7 +1201,7 @@ void KThread::Exit() {
1201 m_suspend_allowed_flags = 0; 1201 m_suspend_allowed_flags = 0;
1202 1202
1203 // Start termination. 1203 // Start termination.
1204 StartTermination(); 1204 this->StartTermination();
1205 1205
1206 // Register the thread as a work task. 1206 // Register the thread as a work task.
1207 KWorkerTaskManager::AddTask(m_kernel, KWorkerTaskManager::WorkerType::Exit, this); 1207 KWorkerTaskManager::AddTask(m_kernel, KWorkerTaskManager::WorkerType::Exit, this);
@@ -1285,7 +1285,7 @@ Result KThread::Sleep(s64 timeout) {
1285 ASSERT(this == GetCurrentThreadPointer(m_kernel)); 1285 ASSERT(this == GetCurrentThreadPointer(m_kernel));
1286 ASSERT(timeout > 0); 1286 ASSERT(timeout > 0);
1287 1287
1288 ThreadQueueImplForKThreadSleep wait_queue_(m_kernel); 1288 ThreadQueueImplForKThreadSleep wait_queue(m_kernel);
1289 KHardwareTimer* timer{}; 1289 KHardwareTimer* timer{};
1290 { 1290 {
1291 // Setup the scheduling lock and sleep. 1291 // Setup the scheduling lock and sleep.
@@ -1298,9 +1298,9 @@ Result KThread::Sleep(s64 timeout) {
1298 } 1298 }
1299 1299
1300 // Wait for the sleep to end. 1300 // Wait for the sleep to end.
1301 wait_queue_.SetHardwareTimer(timer); 1301 wait_queue.SetHardwareTimer(timer);
1302 this->BeginWait(std::addressof(wait_queue_)); 1302 this->BeginWait(std::addressof(wait_queue));
1303 SetWaitReasonForDebugging(ThreadWaitReasonForDebugging::Sleep); 1303 this->SetWaitReasonForDebugging(ThreadWaitReasonForDebugging::Sleep);
1304 } 1304 }
1305 1305
1306 R_SUCCEED(); 1306 R_SUCCEED();
@@ -1335,7 +1335,7 @@ void KThread::DummyThreadEndWait() {
1335 1335
1336void KThread::BeginWait(KThreadQueue* queue) { 1336void KThread::BeginWait(KThreadQueue* queue) {
1337 // Set our state as waiting. 1337 // Set our state as waiting.
1338 SetState(ThreadState::Waiting); 1338 this->SetState(ThreadState::Waiting);
1339 1339
1340 // Set our wait queue. 1340 // Set our wait queue.
1341 m_wait_queue = queue; 1341 m_wait_queue = queue;
@@ -1381,7 +1381,7 @@ void KThread::SetState(ThreadState state) {
1381 KScopedSchedulerLock sl{m_kernel}; 1381 KScopedSchedulerLock sl{m_kernel};
1382 1382
1383 // Clear debugging state 1383 // Clear debugging state
1384 SetWaitReasonForDebugging({}); 1384 this->SetWaitReasonForDebugging({});
1385 1385
1386 const ThreadState old_state = m_thread_state.load(std::memory_order_relaxed); 1386 const ThreadState old_state = m_thread_state.load(std::memory_order_relaxed);
1387 m_thread_state.store( 1387 m_thread_state.store(