diff options
| author | 2019-02-12 19:26:37 -0500 | |
|---|---|---|
| committer | 2019-02-12 19:26:37 -0500 | |
| commit | 8135f4bfcef268c2d29a636f1c0b9f38ab8a25e4 (patch) | |
| tree | 83c843cf14d53a45ed5aad3d60b00cecb9e6d20e /src/core/hle/kernel | |
| parent | Merge pull request #2104 from ReinUsesLisp/compute-assert (diff) | |
| parent | core_timing: Rename CoreTiming namespace to Core::Timing (diff) | |
| download | yuzu-8135f4bfcef268c2d29a636f1c0b9f38ab8a25e4.tar.gz yuzu-8135f4bfcef268c2d29a636f1c0b9f38ab8a25e4.tar.xz yuzu-8135f4bfcef268c2d29a636f1c0b9f38ab8a25e4.zip | |
Merge pull request #2110 from lioncash/namespace
core_timing: Rename CoreTiming namespace to Core::Timing
Diffstat (limited to 'src/core/hle/kernel')
| -rw-r--r-- | src/core/hle/kernel/kernel.cpp | 6 | ||||
| -rw-r--r-- | src/core/hle/kernel/kernel.h | 4 | ||||
| -rw-r--r-- | src/core/hle/kernel/scheduler.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 8 | ||||
| -rw-r--r-- | src/core/hle/kernel/thread.cpp | 13 |
5 files changed, 17 insertions, 16 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index 7a524ce5a..3721ae8fe 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp | |||
| @@ -124,7 +124,7 @@ struct KernelCore::Impl { | |||
| 124 | 124 | ||
| 125 | void InitializeThreads() { | 125 | void InitializeThreads() { |
| 126 | thread_wakeup_event_type = | 126 | thread_wakeup_event_type = |
| 127 | CoreTiming::RegisterEvent("ThreadWakeupCallback", ThreadWakeupCallback); | 127 | Core::Timing::RegisterEvent("ThreadWakeupCallback", ThreadWakeupCallback); |
| 128 | } | 128 | } |
| 129 | 129 | ||
| 130 | std::atomic<u32> next_object_id{0}; | 130 | std::atomic<u32> next_object_id{0}; |
| @@ -137,7 +137,7 @@ struct KernelCore::Impl { | |||
| 137 | 137 | ||
| 138 | SharedPtr<ResourceLimit> system_resource_limit; | 138 | SharedPtr<ResourceLimit> system_resource_limit; |
| 139 | 139 | ||
| 140 | CoreTiming::EventType* thread_wakeup_event_type = nullptr; | 140 | Core::Timing::EventType* thread_wakeup_event_type = nullptr; |
| 141 | // TODO(yuriks): This can be removed if Thread objects are explicitly pooled in the future, | 141 | // TODO(yuriks): This can be removed if Thread objects are explicitly pooled in the future, |
| 142 | // allowing us to simply use a pool index or similar. | 142 | // allowing us to simply use a pool index or similar. |
| 143 | Kernel::HandleTable thread_wakeup_callback_handle_table; | 143 | Kernel::HandleTable thread_wakeup_callback_handle_table; |
| @@ -213,7 +213,7 @@ u64 KernelCore::CreateNewProcessID() { | |||
| 213 | return impl->next_process_id++; | 213 | return impl->next_process_id++; |
| 214 | } | 214 | } |
| 215 | 215 | ||
| 216 | CoreTiming::EventType* KernelCore::ThreadWakeupCallbackEventType() const { | 216 | Core::Timing::EventType* KernelCore::ThreadWakeupCallbackEventType() const { |
| 217 | return impl->thread_wakeup_event_type; | 217 | return impl->thread_wakeup_event_type; |
| 218 | } | 218 | } |
| 219 | 219 | ||
diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h index c643a6401..7406f107e 100644 --- a/src/core/hle/kernel/kernel.h +++ b/src/core/hle/kernel/kernel.h | |||
| @@ -11,7 +11,7 @@ | |||
| 11 | template <typename T> | 11 | template <typename T> |
| 12 | class ResultVal; | 12 | class ResultVal; |
| 13 | 13 | ||
| 14 | namespace CoreTiming { | 14 | namespace Core::Timing { |
| 15 | struct EventType; | 15 | struct EventType; |
| 16 | } | 16 | } |
| 17 | 17 | ||
| @@ -89,7 +89,7 @@ private: | |||
| 89 | u64 CreateNewThreadID(); | 89 | u64 CreateNewThreadID(); |
| 90 | 90 | ||
| 91 | /// Retrieves the event type used for thread wakeup callbacks. | 91 | /// Retrieves the event type used for thread wakeup callbacks. |
| 92 | CoreTiming::EventType* ThreadWakeupCallbackEventType() const; | 92 | Core::Timing::EventType* ThreadWakeupCallbackEventType() const; |
| 93 | 93 | ||
| 94 | /// Provides a reference to the thread wakeup callback handle table. | 94 | /// Provides a reference to the thread wakeup callback handle table. |
| 95 | Kernel::HandleTable& ThreadWakeupCallbackHandleTable(); | 95 | Kernel::HandleTable& ThreadWakeupCallbackHandleTable(); |
diff --git a/src/core/hle/kernel/scheduler.cpp b/src/core/hle/kernel/scheduler.cpp index df4d6cf0a..9e2517e1b 100644 --- a/src/core/hle/kernel/scheduler.cpp +++ b/src/core/hle/kernel/scheduler.cpp | |||
| @@ -111,7 +111,7 @@ void Scheduler::SwitchContext(Thread* new_thread) { | |||
| 111 | 111 | ||
| 112 | void Scheduler::UpdateLastContextSwitchTime(Thread* thread, Process* process) { | 112 | void Scheduler::UpdateLastContextSwitchTime(Thread* thread, Process* process) { |
| 113 | const u64 prev_switch_ticks = last_context_switch_time; | 113 | const u64 prev_switch_ticks = last_context_switch_time; |
| 114 | const u64 most_recent_switch_ticks = CoreTiming::GetTicks(); | 114 | const u64 most_recent_switch_ticks = Core::Timing::GetTicks(); |
| 115 | const u64 update_ticks = most_recent_switch_ticks - prev_switch_ticks; | 115 | const u64 update_ticks = most_recent_switch_ticks - prev_switch_ticks; |
| 116 | 116 | ||
| 117 | if (thread != nullptr) { | 117 | if (thread != nullptr) { |
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 7cfecb68c..5f040f79f 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -927,9 +927,9 @@ static ResultCode GetInfo(u64* result, u64 info_id, u64 handle, u64 info_sub_id) | |||
| 927 | if (same_thread && info_sub_id == 0xFFFFFFFFFFFFFFFF) { | 927 | if (same_thread && info_sub_id == 0xFFFFFFFFFFFFFFFF) { |
| 928 | const u64 thread_ticks = current_thread->GetTotalCPUTimeTicks(); | 928 | const u64 thread_ticks = current_thread->GetTotalCPUTimeTicks(); |
| 929 | 929 | ||
| 930 | out_ticks = thread_ticks + (CoreTiming::GetTicks() - prev_ctx_ticks); | 930 | out_ticks = thread_ticks + (Core::Timing::GetTicks() - prev_ctx_ticks); |
| 931 | } else if (same_thread && info_sub_id == system.CurrentCoreIndex()) { | 931 | } else if (same_thread && info_sub_id == system.CurrentCoreIndex()) { |
| 932 | out_ticks = CoreTiming::GetTicks() - prev_ctx_ticks; | 932 | out_ticks = Core::Timing::GetTicks() - prev_ctx_ticks; |
| 933 | } | 933 | } |
| 934 | 934 | ||
| 935 | *result = out_ticks; | 935 | *result = out_ticks; |
| @@ -1546,10 +1546,10 @@ static ResultCode SignalToAddress(VAddr address, u32 type, s32 value, s32 num_to | |||
| 1546 | static u64 GetSystemTick() { | 1546 | static u64 GetSystemTick() { |
| 1547 | LOG_TRACE(Kernel_SVC, "called"); | 1547 | LOG_TRACE(Kernel_SVC, "called"); |
| 1548 | 1548 | ||
| 1549 | const u64 result{CoreTiming::GetTicks()}; | 1549 | const u64 result{Core::Timing::GetTicks()}; |
| 1550 | 1550 | ||
| 1551 | // Advance time to defeat dumb games that busy-wait for the frame to end. | 1551 | // Advance time to defeat dumb games that busy-wait for the frame to end. |
| 1552 | CoreTiming::AddTicks(400); | 1552 | Core::Timing::AddTicks(400); |
| 1553 | 1553 | ||
| 1554 | return result; | 1554 | return result; |
| 1555 | } | 1555 | } |
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index d3984dfc4..7881c2b90 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp | |||
| @@ -43,7 +43,7 @@ Thread::~Thread() = default; | |||
| 43 | 43 | ||
| 44 | void Thread::Stop() { | 44 | void Thread::Stop() { |
| 45 | // Cancel any outstanding wakeup events for this thread | 45 | // Cancel any outstanding wakeup events for this thread |
| 46 | CoreTiming::UnscheduleEvent(kernel.ThreadWakeupCallbackEventType(), callback_handle); | 46 | Core::Timing::UnscheduleEvent(kernel.ThreadWakeupCallbackEventType(), callback_handle); |
| 47 | kernel.ThreadWakeupCallbackHandleTable().Close(callback_handle); | 47 | kernel.ThreadWakeupCallbackHandleTable().Close(callback_handle); |
| 48 | callback_handle = 0; | 48 | callback_handle = 0; |
| 49 | 49 | ||
| @@ -85,12 +85,13 @@ void Thread::WakeAfterDelay(s64 nanoseconds) { | |||
| 85 | 85 | ||
| 86 | // This function might be called from any thread so we have to be cautious and use the | 86 | // This function might be called from any thread so we have to be cautious and use the |
| 87 | // thread-safe version of ScheduleEvent. | 87 | // thread-safe version of ScheduleEvent. |
| 88 | CoreTiming::ScheduleEventThreadsafe(CoreTiming::nsToCycles(nanoseconds), | 88 | Core::Timing::ScheduleEventThreadsafe(Core::Timing::nsToCycles(nanoseconds), |
| 89 | kernel.ThreadWakeupCallbackEventType(), callback_handle); | 89 | kernel.ThreadWakeupCallbackEventType(), callback_handle); |
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | void Thread::CancelWakeupTimer() { | 92 | void Thread::CancelWakeupTimer() { |
| 93 | CoreTiming::UnscheduleEventThreadsafe(kernel.ThreadWakeupCallbackEventType(), callback_handle); | 93 | Core::Timing::UnscheduleEventThreadsafe(kernel.ThreadWakeupCallbackEventType(), |
| 94 | callback_handle); | ||
| 94 | } | 95 | } |
| 95 | 96 | ||
| 96 | static std::optional<s32> GetNextProcessorId(u64 mask) { | 97 | static std::optional<s32> GetNextProcessorId(u64 mask) { |
| @@ -197,7 +198,7 @@ ResultVal<SharedPtr<Thread>> Thread::Create(KernelCore& kernel, std::string name | |||
| 197 | thread->stack_top = stack_top; | 198 | thread->stack_top = stack_top; |
| 198 | thread->tpidr_el0 = 0; | 199 | thread->tpidr_el0 = 0; |
| 199 | thread->nominal_priority = thread->current_priority = priority; | 200 | thread->nominal_priority = thread->current_priority = priority; |
| 200 | thread->last_running_ticks = CoreTiming::GetTicks(); | 201 | thread->last_running_ticks = Core::Timing::GetTicks(); |
| 201 | thread->processor_id = processor_id; | 202 | thread->processor_id = processor_id; |
| 202 | thread->ideal_core = processor_id; | 203 | thread->ideal_core = processor_id; |
| 203 | thread->affinity_mask = 1ULL << processor_id; | 204 | thread->affinity_mask = 1ULL << processor_id; |
| @@ -257,7 +258,7 @@ void Thread::SetStatus(ThreadStatus new_status) { | |||
| 257 | } | 258 | } |
| 258 | 259 | ||
| 259 | if (status == ThreadStatus::Running) { | 260 | if (status == ThreadStatus::Running) { |
| 260 | last_running_ticks = CoreTiming::GetTicks(); | 261 | last_running_ticks = Core::Timing::GetTicks(); |
| 261 | } | 262 | } |
| 262 | 263 | ||
| 263 | status = new_status; | 264 | status = new_status; |