summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-12-20 03:28:44 +0100
committerLioncash <mathew1800@gmail.com>2018-12-21 13:05:34 +0100
commite0e84aede01763f219c4ac4fc0c9c5034dd2656b (patch)
tree3efec5eebaa90808d8b0313b9e017945753eb47b /src/core
parentkernel/process_capability: Handle program capability flags (diff)
downloadyuzu-e0e84aede01763f219c4ac4fc0c9c5034dd2656b.tar
yuzu-e0e84aede01763f219c4ac4fc0c9c5034dd2656b.tar.gz
yuzu-e0e84aede01763f219c4ac4fc0c9c5034dd2656b.tar.bz2
yuzu-e0e84aede01763f219c4ac4fc0c9c5034dd2656b.tar.lz
yuzu-e0e84aede01763f219c4ac4fc0c9c5034dd2656b.tar.xz
yuzu-e0e84aede01763f219c4ac4fc0c9c5034dd2656b.tar.zst
yuzu-e0e84aede01763f219c4ac4fc0c9c5034dd2656b.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/kernel/process_capability.cpp14
-rw-r--r--src/core/hle/kernel/process_capability.h5
2 files changed, 18 insertions, 1 deletions
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;
}
diff --git a/src/core/hle/kernel/process_capability.h b/src/core/hle/kernel/process_capability.h
index 140d60267..9a7da8bfa 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 kernel version value.
+ u32 GetKernelVersion() const {
+ return kernel_version;
+ }
+
private:
/// Attempts to parse a given sequence of capability descriptors.
///