diff options
| author | 2018-12-27 21:14:59 -0500 | |
|---|---|---|
| committer | 2018-12-27 21:48:49 -0500 | |
| commit | f80bc712ea60d10db10af6c752218bd3512e22b0 (patch) | |
| tree | 506970e7559e2b58c4cac84517835527183e4a4c /src | |
| parent | kernel/thread: Move process thread initialization into process.cpp (diff) | |
| download | yuzu-f80bc712ea60d10db10af6c752218bd3512e22b0.tar.gz yuzu-f80bc712ea60d10db10af6c752218bd3512e22b0.tar.xz yuzu-f80bc712ea60d10db10af6c752218bd3512e22b0.zip | |
kernel: Rename 'default' CPU core to 'ideal' core
This makes the naming more closely match its meaning. It's just a
preferred core, not a required default core. This also makes the usages
of this term consistent across the thread and process implementations.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/kernel/process.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/process.h | 10 | ||||
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 18 | ||||
| -rw-r--r-- | src/core/hle/kernel/thread.h | 12 | ||||
| -rw-r--r-- | src/yuzu/debugger/wait_tree.cpp | 4 |
5 files changed, 23 insertions, 23 deletions
diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp index 81a23dfbf..645c1d6f5 100644 --- a/src/core/hle/kernel/process.cpp +++ b/src/core/hle/kernel/process.cpp | |||
| @@ -93,7 +93,7 @@ ResultCode Process::ClearSignalState() { | |||
| 93 | 93 | ||
| 94 | ResultCode Process::LoadFromMetadata(const FileSys::ProgramMetadata& metadata) { | 94 | ResultCode Process::LoadFromMetadata(const FileSys::ProgramMetadata& metadata) { |
| 95 | program_id = metadata.GetTitleID(); | 95 | program_id = metadata.GetTitleID(); |
| 96 | ideal_processor = metadata.GetMainThreadCore(); | 96 | ideal_core = metadata.GetMainThreadCore(); |
| 97 | is_64bit_process = metadata.Is64BitProgram(); | 97 | is_64bit_process = metadata.Is64BitProgram(); |
| 98 | 98 | ||
| 99 | vm_manager.Reset(metadata.GetAddressSpaceType()); | 99 | vm_manager.Reset(metadata.GetAddressSpaceType()); |
diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h index 2c0b20f9e..ce7d143de 100644 --- a/src/core/hle/kernel/process.h +++ b/src/core/hle/kernel/process.h | |||
| @@ -168,9 +168,9 @@ public: | |||
| 168 | /// Gets the resource limit descriptor for this process | 168 | /// Gets the resource limit descriptor for this process |
| 169 | SharedPtr<ResourceLimit> GetResourceLimit() const; | 169 | SharedPtr<ResourceLimit> GetResourceLimit() const; |
| 170 | 170 | ||
| 171 | /// Gets the default CPU ID for this process | 171 | /// Gets the ideal CPU core ID for this process |
| 172 | u8 GetDefaultProcessorID() const { | 172 | u8 GetIdealCore() const { |
| 173 | return ideal_processor; | 173 | return ideal_core; |
| 174 | } | 174 | } |
| 175 | 175 | ||
| 176 | /// Gets the bitmask of allowed CPUs that this process' threads can run on. | 176 | /// Gets the bitmask of allowed CPUs that this process' threads can run on. |
| @@ -287,8 +287,8 @@ private: | |||
| 287 | /// Resource limit descriptor for this process | 287 | /// Resource limit descriptor for this process |
| 288 | SharedPtr<ResourceLimit> resource_limit; | 288 | SharedPtr<ResourceLimit> resource_limit; |
| 289 | 289 | ||
| 290 | /// The default CPU for this process, threads are scheduled on this cpu by default. | 290 | /// The ideal CPU core for this process, threads are scheduled on this core by default. |
| 291 | u8 ideal_processor = 0; | 291 | u8 ideal_core = 0; |
| 292 | u32 is_virtual_address_memory_enabled = 0; | 292 | u32 is_virtual_address_memory_enabled = 0; |
| 293 | 293 | ||
| 294 | /// The Thread Local Storage area is allocated as processes create threads, | 294 | /// The Thread Local Storage area is allocated as processes create threads, |
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 2e80b48c2..18fb3c44d 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -1220,10 +1220,10 @@ static ResultCode CreateThread(Handle* out_handle, VAddr entry_point, u64 arg, V | |||
| 1220 | 1220 | ||
| 1221 | auto* const current_process = Core::CurrentProcess(); | 1221 | auto* const current_process = Core::CurrentProcess(); |
| 1222 | 1222 | ||
| 1223 | if (processor_id == THREADPROCESSORID_DEFAULT) { | 1223 | if (processor_id == THREADPROCESSORID_IDEAL) { |
| 1224 | // Set the target CPU to the one specified in the process' exheader. | 1224 | // Set the target CPU to the one specified by the process. |
| 1225 | processor_id = current_process->GetDefaultProcessorID(); | 1225 | processor_id = current_process->GetIdealCore(); |
| 1226 | ASSERT(processor_id != THREADPROCESSORID_DEFAULT); | 1226 | ASSERT(processor_id != THREADPROCESSORID_IDEAL); |
| 1227 | } | 1227 | } |
| 1228 | 1228 | ||
| 1229 | switch (processor_id) { | 1229 | switch (processor_id) { |
| @@ -1632,13 +1632,13 @@ static ResultCode SetThreadCoreMask(Handle thread_handle, u32 core, u64 mask) { | |||
| 1632 | return ERR_INVALID_HANDLE; | 1632 | return ERR_INVALID_HANDLE; |
| 1633 | } | 1633 | } |
| 1634 | 1634 | ||
| 1635 | if (core == static_cast<u32>(THREADPROCESSORID_DEFAULT)) { | 1635 | if (core == static_cast<u32>(THREADPROCESSORID_IDEAL)) { |
| 1636 | const u8 default_processor_id = thread->GetOwnerProcess()->GetDefaultProcessorID(); | 1636 | const u8 ideal_cpu_core = thread->GetOwnerProcess()->GetIdealCore(); |
| 1637 | 1637 | ||
| 1638 | ASSERT(default_processor_id != static_cast<u8>(THREADPROCESSORID_DEFAULT)); | 1638 | ASSERT(ideal_cpu_core != static_cast<u8>(THREADPROCESSORID_IDEAL)); |
| 1639 | 1639 | ||
| 1640 | // Set the target CPU to the one specified in the process' exheader. | 1640 | // Set the target CPU to the ideal core specified by the process. |
| 1641 | core = default_processor_id; | 1641 | core = ideal_cpu_core; |
| 1642 | mask = 1ULL << core; | 1642 | mask = 1ULL << core; |
| 1643 | } | 1643 | } |
| 1644 | 1644 | ||
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index cc68eed2f..c48b21aba 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h | |||
| @@ -30,12 +30,12 @@ enum ThreadPriority : u32 { | |||
| 30 | }; | 30 | }; |
| 31 | 31 | ||
| 32 | enum ThreadProcessorId : s32 { | 32 | enum ThreadProcessorId : s32 { |
| 33 | THREADPROCESSORID_DEFAULT = -2, ///< Run thread on default core specified by exheader | 33 | THREADPROCESSORID_IDEAL = -2, ///< Run thread on the ideal core specified by the process. |
| 34 | THREADPROCESSORID_0 = 0, ///< Run thread on core 0 | 34 | THREADPROCESSORID_0 = 0, ///< Run thread on core 0 |
| 35 | THREADPROCESSORID_1 = 1, ///< Run thread on core 1 | 35 | THREADPROCESSORID_1 = 1, ///< Run thread on core 1 |
| 36 | THREADPROCESSORID_2 = 2, ///< Run thread on core 2 | 36 | THREADPROCESSORID_2 = 2, ///< Run thread on core 2 |
| 37 | THREADPROCESSORID_3 = 3, ///< Run thread on core 3 | 37 | THREADPROCESSORID_3 = 3, ///< Run thread on core 3 |
| 38 | THREADPROCESSORID_MAX = 4, ///< Processor ID must be less than this | 38 | THREADPROCESSORID_MAX = 4, ///< Processor ID must be less than this |
| 39 | 39 | ||
| 40 | /// Allowed CPU mask | 40 | /// Allowed CPU mask |
| 41 | THREADPROCESSORID_DEFAULT_MASK = (1 << THREADPROCESSORID_0) | (1 << THREADPROCESSORID_1) | | 41 | THREADPROCESSORID_DEFAULT_MASK = (1 << THREADPROCESSORID_0) | (1 << THREADPROCESSORID_1) | |
diff --git a/src/yuzu/debugger/wait_tree.cpp b/src/yuzu/debugger/wait_tree.cpp index 1adf6e330..df6eeb9a6 100644 --- a/src/yuzu/debugger/wait_tree.cpp +++ b/src/yuzu/debugger/wait_tree.cpp | |||
| @@ -293,8 +293,8 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeThread::GetChildren() const { | |||
| 293 | 293 | ||
| 294 | QString processor; | 294 | QString processor; |
| 295 | switch (thread.GetProcessorID()) { | 295 | switch (thread.GetProcessorID()) { |
| 296 | case Kernel::ThreadProcessorId::THREADPROCESSORID_DEFAULT: | 296 | case Kernel::ThreadProcessorId::THREADPROCESSORID_IDEAL: |
| 297 | processor = tr("default"); | 297 | processor = tr("ideal"); |
| 298 | break; | 298 | break; |
| 299 | case Kernel::ThreadProcessorId::THREADPROCESSORID_0: | 299 | case Kernel::ThreadProcessorId::THREADPROCESSORID_0: |
| 300 | case Kernel::ThreadProcessorId::THREADPROCESSORID_1: | 300 | case Kernel::ThreadProcessorId::THREADPROCESSORID_1: |