From 10824c5d635be0bdfb79f4b3af8c9481034b437f Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 19 Dec 2018 21:43:10 -0500 Subject: kernel/process_capability: Handle handle table capability flags This just specifies the handle table size. There's also a section of reserved bits that are checked against. --- src/core/hle/kernel/process_capability.cpp | 7 ++++++- src/core/hle/kernel/process_capability.h | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/core/hle/kernel/process_capability.cpp b/src/core/hle/kernel/process_capability.cpp index fb4467793..7ee0ad9cc 100644 --- a/src/core/hle/kernel/process_capability.cpp +++ b/src/core/hle/kernel/process_capability.cpp @@ -332,7 +332,12 @@ ResultCode ProcessCapabilities::HandleKernelVersionFlags(u32 flags) { } ResultCode ProcessCapabilities::HandleHandleTableFlags(u32 flags) { - // TODO: Implement + const u32 reserved = flags >> 26; + if (reserved != 0) { + return ERR_RESERVED_VALUE; + } + + handle_table_size = (flags >> 16) & 0x3FF; return RESULT_SUCCESS; } diff --git a/src/core/hle/kernel/process_capability.h b/src/core/hle/kernel/process_capability.h index 9a7da8bfa..7b9f24d51 100644 --- a/src/core/hle/kernel/process_capability.h +++ b/src/core/hle/kernel/process_capability.h @@ -155,6 +155,11 @@ public: return program_type; } + /// Gets the number of total allowable handles for the process' handle table. + u32 GetHandleTableSize() const { + return handle_table_size; + } + /// Gets the kernel version value. u32 GetKernelVersion() const { return kernel_version; -- cgit v1.2.3