diff options
| author | 2018-09-21 01:26:29 -0400 | |
|---|---|---|
| committer | 2018-09-21 03:50:12 -0400 | |
| commit | acfc801d14b1883f54b8fe66ac428982f9898258 (patch) | |
| tree | efb94a0647b8756638fc4d95d18ad9782578ce4c /src/core/hle/kernel/process.h | |
| parent | Added support for uncompressed NSOs (#1374) (diff) | |
| download | yuzu-acfc801d14b1883f54b8fe66ac428982f9898258.tar.gz yuzu-acfc801d14b1883f54b8fe66ac428982f9898258.tar.xz yuzu-acfc801d14b1883f54b8fe66ac428982f9898258.zip | |
thread/process: Move TLS slot marking/freeing to the process class
Allows making several members of the process class private, it also
avoids going through Core::CurrentProcess() just to retrieve the owning
process.
Diffstat (limited to 'src/core/hle/kernel/process.h')
| -rw-r--r-- | src/core/hle/kernel/process.h | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h index 81538f70c..84027a31a 100644 --- a/src/core/hle/kernel/process.h +++ b/src/core/hle/kernel/process.h | |||
| @@ -176,8 +176,25 @@ public: | |||
| 176 | /////////////////////////////////////////////////////////////////////////////////////////////// | 176 | /////////////////////////////////////////////////////////////////////////////////////////////// |
| 177 | // Memory Management | 177 | // Memory Management |
| 178 | 178 | ||
| 179 | // Marks the next available region as used and returns the address of the slot. | ||
| 180 | VAddr MarkNextAvailableTLSSlotAsUsed(Thread& thread); | ||
| 181 | |||
| 182 | // Frees a used TLS slot identified by the given address | ||
| 183 | void FreeTLSSlot(VAddr tls_address); | ||
| 184 | |||
| 185 | ResultVal<VAddr> HeapAllocate(VAddr target, u64 size, VMAPermission perms); | ||
| 186 | ResultCode HeapFree(VAddr target, u32 size); | ||
| 187 | |||
| 188 | ResultCode MirrorMemory(VAddr dst_addr, VAddr src_addr, u64 size); | ||
| 189 | |||
| 190 | ResultCode UnmapMemory(VAddr dst_addr, VAddr src_addr, u64 size); | ||
| 191 | |||
| 179 | VMManager vm_manager; | 192 | VMManager vm_manager; |
| 180 | 193 | ||
| 194 | private: | ||
| 195 | explicit Process(KernelCore& kernel); | ||
| 196 | ~Process() override; | ||
| 197 | |||
| 181 | // Memory used to back the allocations in the regular heap. A single vector is used to cover | 198 | // Memory used to back the allocations in the regular heap. A single vector is used to cover |
| 182 | // the entire virtual address space extents that bound the allocations, including any holes. | 199 | // the entire virtual address space extents that bound the allocations, including any holes. |
| 183 | // This makes deallocation and reallocation of holes fast and keeps process memory contiguous | 200 | // This makes deallocation and reallocation of holes fast and keeps process memory contiguous |
| @@ -197,17 +214,6 @@ public: | |||
| 197 | std::vector<std::bitset<8>> tls_slots; | 214 | std::vector<std::bitset<8>> tls_slots; |
| 198 | 215 | ||
| 199 | std::string name; | 216 | std::string name; |
| 200 | |||
| 201 | ResultVal<VAddr> HeapAllocate(VAddr target, u64 size, VMAPermission perms); | ||
| 202 | ResultCode HeapFree(VAddr target, u32 size); | ||
| 203 | |||
| 204 | ResultCode MirrorMemory(VAddr dst_addr, VAddr src_addr, u64 size); | ||
| 205 | |||
| 206 | ResultCode UnmapMemory(VAddr dst_addr, VAddr src_addr, u64 size); | ||
| 207 | |||
| 208 | private: | ||
| 209 | explicit Process(KernelCore& kernel); | ||
| 210 | ~Process() override; | ||
| 211 | }; | 217 | }; |
| 212 | 218 | ||
| 213 | } // namespace Kernel | 219 | } // namespace Kernel |