diff options
| author | 2018-12-19 21:28:44 -0500 | |
|---|---|---|
| committer | 2018-12-21 07:05:34 -0500 | |
| commit | e0e84aede01763f219c4ac4fc0c9c5034dd2656b (patch) | |
| tree | 3efec5eebaa90808d8b0313b9e017945753eb47b /src/core | |
| parent | kernel/process_capability: Handle program capability flags (diff) | |
| download | yuzu-e0e84aede01763f219c4ac4fc0c9c5034dd2656b.tar.gz yuzu-e0e84aede01763f219c4ac4fc0c9c5034dd2656b.tar.xz yuzu-e0e84aede01763f219c4ac4fc0c9c5034dd2656b.zip | |
kernel/process_capability: Handle kernel version capability flags
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/hle/kernel/process_capability.cpp | 14 | ||||
| -rw-r--r-- | src/core/hle/kernel/process_capability.h | 5 |
2 files changed, 18 insertions, 1 deletions
diff --git a/src/core/hle/kernel/process_capability.cpp b/src/core/hle/kernel/process_capability.cpp index ef506b9f3..fb4467793 100644 --- a/src/core/hle/kernel/process_capability.cpp +++ b/src/core/hle/kernel/process_capability.cpp | |||
| @@ -315,7 +315,19 @@ ResultCode ProcessCapabilities::HandleProgramTypeFlags(u32 flags) { | |||
| 315 | } | 315 | } |
| 316 | 316 | ||
| 317 | ResultCode ProcessCapabilities::HandleKernelVersionFlags(u32 flags) { | 317 | ResultCode ProcessCapabilities::HandleKernelVersionFlags(u32 flags) { |
| 318 | // TODO: Implement | 318 | // Yes, the internal member variable is checked in the actual kernel here. |
| 319 | // This might look odd for options that are only allowed to be initialized | ||
| 320 | // just once, however the kernel has a separate initialization function for | ||
| 321 | // kernel processes and userland processes. The kernel variant sets this | ||
| 322 | // member variable ahead of time. | ||
| 323 | |||
| 324 | const u32 major_version = kernel_version >> 19; | ||
| 325 | |||
| 326 | if (major_version != 0 || flags < 0x80000) { | ||
| 327 | return ERR_INVALID_CAPABILITY_DESCRIPTOR; | ||
| 328 | } | ||
| 329 | |||
| 330 | kernel_version = flags; | ||
| 319 | return RESULT_SUCCESS; | 331 | return RESULT_SUCCESS; |
| 320 | } | 332 | } |
| 321 | 333 | ||
diff --git a/src/core/hle/kernel/process_capability.h b/src/core/hle/kernel/process_capability.h index 140d60267..9a7da8bfa 100644 --- a/src/core/hle/kernel/process_capability.h +++ b/src/core/hle/kernel/process_capability.h | |||
| @@ -155,6 +155,11 @@ public: | |||
| 155 | return program_type; | 155 | return program_type; |
| 156 | } | 156 | } |
| 157 | 157 | ||
| 158 | /// Gets the kernel version value. | ||
| 159 | u32 GetKernelVersion() const { | ||
| 160 | return kernel_version; | ||
| 161 | } | ||
| 162 | |||
| 158 | private: | 163 | private: |
| 159 | /// Attempts to parse a given sequence of capability descriptors. | 164 | /// Attempts to parse a given sequence of capability descriptors. |
| 160 | /// | 165 | /// |