diff options
Diffstat (limited to 'src/core/hle/kernel/process.h')
| -rw-r--r-- | src/core/hle/kernel/process.h | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h index 83ea02bee..3196014da 100644 --- a/src/core/hle/kernel/process.h +++ b/src/core/hle/kernel/process.h | |||
| @@ -168,8 +168,24 @@ public: | |||
| 168 | return capabilities.GetPriorityMask(); | 168 | return capabilities.GetPriorityMask(); |
| 169 | } | 169 | } |
| 170 | 170 | ||
| 171 | u32 IsVirtualMemoryEnabled() const { | 171 | /// Gets the amount of secure memory to allocate for memory management. |
| 172 | return is_virtual_address_memory_enabled; | 172 | u32 GetSystemResourceSize() const { |
| 173 | return system_resource_size; | ||
| 174 | } | ||
| 175 | |||
| 176 | /// Gets the amount of secure memory currently in use for memory management. | ||
| 177 | u32 GetSystemResourceUsage() const { | ||
| 178 | // On hardware, this returns the amount of system resource memory that has | ||
| 179 | // been used by the kernel. This is problematic for Yuzu to emulate, because | ||
| 180 | // system resource memory is used for page tables -- and yuzu doesn't really | ||
| 181 | // have a way to calculate how much memory is required for page tables for | ||
| 182 | // the current process at any given time. | ||
| 183 | // TODO: Is this even worth implementing? Games may retrieve this value via | ||
| 184 | // an SDK function that gets used + available system resource size for debug | ||
| 185 | // or diagnostic purposes. However, it seems unlikely that a game would make | ||
| 186 | // decisions based on how much system memory is dedicated to its page tables. | ||
| 187 | // Is returning a value other than zero wise? | ||
| 188 | return 0; | ||
| 173 | } | 189 | } |
| 174 | 190 | ||
| 175 | /// Whether this process is an AArch64 or AArch32 process. | 191 | /// Whether this process is an AArch64 or AArch32 process. |
| @@ -196,15 +212,15 @@ public: | |||
| 196 | u64 GetTotalPhysicalMemoryAvailable() const; | 212 | u64 GetTotalPhysicalMemoryAvailable() const; |
| 197 | 213 | ||
| 198 | /// Retrieves the total physical memory available to this process in bytes, | 214 | /// Retrieves the total physical memory available to this process in bytes, |
| 199 | /// without the size of the personal heap added to it. | 215 | /// without the size of the personal system resource heap added to it. |
| 200 | u64 GetTotalPhysicalMemoryAvailableWithoutMmHeap() const; | 216 | u64 GetTotalPhysicalMemoryAvailableWithoutSystemResource() const; |
| 201 | 217 | ||
| 202 | /// Retrieves the total physical memory used by this process in bytes. | 218 | /// Retrieves the total physical memory used by this process in bytes. |
| 203 | u64 GetTotalPhysicalMemoryUsed() const; | 219 | u64 GetTotalPhysicalMemoryUsed() const; |
| 204 | 220 | ||
| 205 | /// Retrieves the total physical memory used by this process in bytes, | 221 | /// Retrieves the total physical memory used by this process in bytes, |
| 206 | /// without the size of the personal heap added to it. | 222 | /// without the size of the personal system resource heap added to it. |
| 207 | u64 GetTotalPhysicalMemoryUsedWithoutMmHeap() const; | 223 | u64 GetTotalPhysicalMemoryUsedWithoutSystemResource() const; |
| 208 | 224 | ||
| 209 | /// Gets the list of all threads created with this process as their owner. | 225 | /// Gets the list of all threads created with this process as their owner. |
| 210 | const std::list<const Thread*>& GetThreadList() const { | 226 | const std::list<const Thread*>& GetThreadList() const { |
| @@ -298,12 +314,16 @@ private: | |||
| 298 | /// Title ID corresponding to the process | 314 | /// Title ID corresponding to the process |
| 299 | u64 program_id = 0; | 315 | u64 program_id = 0; |
| 300 | 316 | ||
| 317 | /// Specifies additional memory to be reserved for the process's memory management by the | ||
| 318 | /// system. When this is non-zero, secure memory is allocated and used for page table allocation | ||
| 319 | /// instead of using the normal global page tables/memory block management. | ||
| 320 | u32 system_resource_size = 0; | ||
| 321 | |||
| 301 | /// Resource limit descriptor for this process | 322 | /// Resource limit descriptor for this process |
| 302 | SharedPtr<ResourceLimit> resource_limit; | 323 | SharedPtr<ResourceLimit> resource_limit; |
| 303 | 324 | ||
| 304 | /// The ideal CPU core for this process, threads are scheduled on this core by default. | 325 | /// The ideal CPU core for this process, threads are scheduled on this core by default. |
| 305 | u8 ideal_core = 0; | 326 | u8 ideal_core = 0; |
| 306 | u32 is_virtual_address_memory_enabled = 0; | ||
| 307 | 327 | ||
| 308 | /// The Thread Local Storage area is allocated as processes create threads, | 328 | /// The Thread Local Storage area is allocated as processes create threads, |
| 309 | /// each TLS area is 0x200 bytes, so one page (0x1000) is split up in 8 parts, and each part | 329 | /// each TLS area is 0x200 bytes, so one page (0x1000) is split up in 8 parts, and each part |