diff options
Diffstat (limited to 'src/core/hle/kernel/process.cpp')
| -rw-r--r-- | src/core/hle/kernel/process.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp index ddbd75b8d..bf727901d 100644 --- a/src/core/hle/kernel/process.cpp +++ b/src/core/hle/kernel/process.cpp | |||
| @@ -59,7 +59,8 @@ void SetupMainThread(Process& owner_process, KernelCore& kernel, u32 priority) { | |||
| 59 | // (whichever page happens to have an available slot). | 59 | // (whichever page happens to have an available slot). |
| 60 | class TLSPage { | 60 | class TLSPage { |
| 61 | public: | 61 | public: |
| 62 | static constexpr std::size_t num_slot_entries = Memory::PAGE_SIZE / Memory::TLS_ENTRY_SIZE; | 62 | static constexpr std::size_t num_slot_entries = |
| 63 | Core::Memory::PAGE_SIZE / Core::Memory::TLS_ENTRY_SIZE; | ||
| 63 | 64 | ||
| 64 | explicit TLSPage(VAddr address) : base_address{address} {} | 65 | explicit TLSPage(VAddr address) : base_address{address} {} |
| 65 | 66 | ||
| @@ -78,7 +79,7 @@ public: | |||
| 78 | } | 79 | } |
| 79 | 80 | ||
| 80 | is_slot_used[i] = true; | 81 | is_slot_used[i] = true; |
| 81 | return base_address + (i * Memory::TLS_ENTRY_SIZE); | 82 | return base_address + (i * Core::Memory::TLS_ENTRY_SIZE); |
| 82 | } | 83 | } |
| 83 | 84 | ||
| 84 | return std::nullopt; | 85 | return std::nullopt; |
| @@ -88,15 +89,15 @@ public: | |||
| 88 | // Ensure that all given addresses are consistent with how TLS pages | 89 | // Ensure that all given addresses are consistent with how TLS pages |
| 89 | // are intended to be used when releasing slots. | 90 | // are intended to be used when releasing slots. |
| 90 | ASSERT(IsWithinPage(address)); | 91 | ASSERT(IsWithinPage(address)); |
| 91 | ASSERT((address % Memory::TLS_ENTRY_SIZE) == 0); | 92 | ASSERT((address % Core::Memory::TLS_ENTRY_SIZE) == 0); |
| 92 | 93 | ||
| 93 | const std::size_t index = (address - base_address) / Memory::TLS_ENTRY_SIZE; | 94 | const std::size_t index = (address - base_address) / Core::Memory::TLS_ENTRY_SIZE; |
| 94 | is_slot_used[index] = false; | 95 | is_slot_used[index] = false; |
| 95 | } | 96 | } |
| 96 | 97 | ||
| 97 | private: | 98 | private: |
| 98 | bool IsWithinPage(VAddr address) const { | 99 | bool IsWithinPage(VAddr address) const { |
| 99 | return base_address <= address && address < base_address + Memory::PAGE_SIZE; | 100 | return base_address <= address && address < base_address + Core::Memory::PAGE_SIZE; |
| 100 | } | 101 | } |
| 101 | 102 | ||
| 102 | VAddr base_address; | 103 | VAddr base_address; |
| @@ -306,7 +307,7 @@ VAddr Process::CreateTLSRegion() { | |||
| 306 | } | 307 | } |
| 307 | 308 | ||
| 308 | void Process::FreeTLSRegion(VAddr tls_address) { | 309 | void Process::FreeTLSRegion(VAddr tls_address) { |
| 309 | const VAddr aligned_address = Common::AlignDown(tls_address, Memory::PAGE_SIZE); | 310 | const VAddr aligned_address = Common::AlignDown(tls_address, Core::Memory::PAGE_SIZE); |
| 310 | auto iter = | 311 | auto iter = |
| 311 | std::find_if(tls_pages.begin(), tls_pages.end(), [aligned_address](const auto& page) { | 312 | std::find_if(tls_pages.begin(), tls_pages.end(), [aligned_address](const auto& page) { |
| 312 | return page.GetBaseAddress() == aligned_address; | 313 | return page.GetBaseAddress() == aligned_address; |