From e0e84aede01763f219c4ac4fc0c9c5034dd2656b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 19 Dec 2018 21:28:44 -0500 Subject: kernel/process_capability: Handle kernel version capability flags --- src/core/hle/kernel/process_capability.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/core/hle/kernel/process_capability.cpp') 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) { } ResultCode ProcessCapabilities::HandleKernelVersionFlags(u32 flags) { - // TODO: Implement + // Yes, the internal member variable is checked in the actual kernel here. + // This might look odd for options that are only allowed to be initialized + // just once, however the kernel has a separate initialization function for + // kernel processes and userland processes. The kernel variant sets this + // member variable ahead of time. + + const u32 major_version = kernel_version >> 19; + + if (major_version != 0 || flags < 0x80000) { + return ERR_INVALID_CAPABILITY_DESCRIPTOR; + } + + kernel_version = flags; return RESULT_SUCCESS; } -- cgit v1.2.3