summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Lioncash2018-12-19 20:38:29 -0500
committerGravatar Lioncash2018-12-21 07:05:34 -0500
commit0f216d20e368dfc3978bef0b9327b5fbf150af4a (patch)
tree1631df2daa4691980348f44b0d72ea91a3a0a365
parentkernel/process_capability: Handle syscall capability flags (diff)
downloadyuzu-0f216d20e368dfc3978bef0b9327b5fbf150af4a.tar.gz
yuzu-0f216d20e368dfc3978bef0b9327b5fbf150af4a.tar.xz
yuzu-0f216d20e368dfc3978bef0b9327b5fbf150af4a.zip
kernel/process_capability: Handle interrupt capability flags
Similar to the service capability flags, however, we currently don't emulate the GIC, so this currently handles all interrupts as being valid for the time being.
-rw-r--r--src/core/hle/kernel/process_capability.cpp22
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
278} 278}
279 279
280ResultCode ProcessCapabilities::HandleInterruptFlags(u32 flags) { 280ResultCode ProcessCapabilities::HandleInterruptFlags(u32 flags) {
281 // TODO: Implement 281 constexpr u32 interrupt_ignore_value = 0x3FF;
282 const u32 interrupt0 = (flags >> 12) & 0x3FF;
283 const u32 interrupt1 = (flags >> 22) & 0x3FF;
284
285 for (u32 interrupt : {interrupt0, interrupt1}) {
286 if (interrupt == interrupt_ignore_value) {
287 continue;
288 }
289
290 // NOTE:
291 // This should be checking a generic interrupt controller value
292 // as part of the calculation, however, given we don't currently
293 // emulate that, it's sufficient to mark every interrupt as defined.
294
295 if (interrupt >= interrupt_capabilities.size()) {
296 return ERR_OUT_OF_RANGE;
297 }
298
299 interrupt_capabilities[interrupt] = true;
300 }
301
282 return RESULT_SUCCESS; 302 return RESULT_SUCCESS;
283} 303}
284 304