diff options
author | Lioncash <mathew1800@gmail.com> | 2018-12-20 02:38:29 +0100 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2018-12-21 13:05:34 +0100 |
commit | 0f216d20e368dfc3978bef0b9327b5fbf150af4a (patch) | |
tree | 1631df2daa4691980348f44b0d72ea91a3a0a365 /src/core/hle/kernel | |
parent | kernel/process_capability: Handle syscall capability flags (diff) | |
download | yuzu-0f216d20e368dfc3978bef0b9327b5fbf150af4a.tar yuzu-0f216d20e368dfc3978bef0b9327b5fbf150af4a.tar.gz yuzu-0f216d20e368dfc3978bef0b9327b5fbf150af4a.tar.bz2 yuzu-0f216d20e368dfc3978bef0b9327b5fbf150af4a.tar.lz yuzu-0f216d20e368dfc3978bef0b9327b5fbf150af4a.tar.xz yuzu-0f216d20e368dfc3978bef0b9327b5fbf150af4a.tar.zst yuzu-0f216d20e368dfc3978bef0b9327b5fbf150af4a.zip |
Diffstat (limited to 'src/core/hle/kernel')
-rw-r--r-- | src/core/hle/kernel/process_capability.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/core/hle/kernel/process_capability.cpp b/src/core/hle/kernel/process_capability.cpp index 615b354c6..e98157f9c 100644 --- a/src/core/hle/kernel/process_capability.cpp +++ b/src/core/hle/kernel/process_capability.cpp @@ -278,7 +278,27 @@ ResultCode ProcessCapabilities::HandleMapIOFlags(u32 flags, VMManager& vm_manage } ResultCode ProcessCapabilities::HandleInterruptFlags(u32 flags) { - // TODO: Implement + constexpr u32 interrupt_ignore_value = 0x3FF; + const u32 interrupt0 = (flags >> 12) & 0x3FF; + const u32 interrupt1 = (flags >> 22) & 0x3FF; + + for (u32 interrupt : {interrupt0, interrupt1}) { + if (interrupt == interrupt_ignore_value) { + continue; + } + + // NOTE: + // This should be checking a generic interrupt controller value + // as part of the calculation, however, given we don't currently + // emulate that, it's sufficient to mark every interrupt as defined. + + if (interrupt >= interrupt_capabilities.size()) { + return ERR_OUT_OF_RANGE; + } + + interrupt_capabilities[interrupt] = true; + } + return RESULT_SUCCESS; } |