diff options
author | Lioncash <mathew1800@gmail.com> | 2018-12-21 04:54:05 +0100 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2018-12-21 13:05:34 +0100 |
commit | 3dc59b74ec92f8ee6b856eb4a18c3efa9286730e (patch) | |
tree | e3d3d41ee14f7a27c955a50b74d2b4c16582aafa /src/core/hle/kernel/process_capability.cpp | |
parent | kernel/process_capability: Handle the priority mask and core mask flags (diff) | |
download | yuzu-3dc59b74ec92f8ee6b856eb4a18c3efa9286730e.tar yuzu-3dc59b74ec92f8ee6b856eb4a18c3efa9286730e.tar.gz yuzu-3dc59b74ec92f8ee6b856eb4a18c3efa9286730e.tar.bz2 yuzu-3dc59b74ec92f8ee6b856eb4a18c3efa9286730e.tar.lz yuzu-3dc59b74ec92f8ee6b856eb4a18c3efa9286730e.tar.xz yuzu-3dc59b74ec92f8ee6b856eb4a18c3efa9286730e.tar.zst yuzu-3dc59b74ec92f8ee6b856eb4a18c3efa9286730e.zip |
Diffstat (limited to 'src/core/hle/kernel/process_capability.cpp')
-rw-r--r-- | src/core/hle/kernel/process_capability.cpp | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/core/hle/kernel/process_capability.cpp b/src/core/hle/kernel/process_capability.cpp index 9f513b25b..615b354c6 100644 --- a/src/core/hle/kernel/process_capability.cpp +++ b/src/core/hle/kernel/process_capability.cpp @@ -239,7 +239,30 @@ ResultCode ProcessCapabilities::HandlePriorityCoreNumFlags(u32 flags) { } ResultCode ProcessCapabilities::HandleSyscallFlags(u32& set_svc_bits, u32 flags) { - // TODO: Implement + const u32 index = flags >> 29; + const u32 svc_bit = 1U << index; + + // If we've already set this svc before, bail. + if ((set_svc_bits & svc_bit) != 0) { + return ERR_INVALID_COMBINATION; + } + set_svc_bits |= svc_bit; + + const u32 svc_mask = (flags >> 5) & 0xFFFFFF; + for (u32 i = 0; i < 24; ++i) { + const u32 svc_number = index * 24 + i; + + if ((svc_mask & (1U << i)) == 0) { + continue; + } + + if (svc_number >= svc_capabilities.size()) { + return ERR_OUT_OF_RANGE; + } + + svc_capabilities[svc_number] = true; + } + return RESULT_SUCCESS; } |