diff options
author | Mary <me@thog.eu> | 2021-11-28 13:01:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-28 13:01:17 +0100 |
commit | 786fb04d2005577fc17c5851e6d651054a1b80c4 (patch) | |
tree | 7c8d47f69daea09983d6c86e8b501052a75e160c | |
parent | 3dcee8c437635802001099bd3a38eb23d83345a8 (diff) |
kernel: Add support for CFI (#2839)
Add basic support for the CFI value being passed in X18 since 11.0.0 by the official kernel.
We do not implement any random generator atm in the kernel and as such the KSystemControl.GenerateRandom function is stubbed
-rw-r--r-- | Ryujinx.HLE/HOS/Kernel/Common/KSystemControl.cs | 6 | ||||
-rw-r--r-- | Ryujinx.HLE/HOS/Kernel/Threading/KThread.cs | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/Ryujinx.HLE/HOS/Kernel/Common/KSystemControl.cs b/Ryujinx.HLE/HOS/Kernel/Common/KSystemControl.cs index 630baacf..88142142 100644 --- a/Ryujinx.HLE/HOS/Kernel/Common/KSystemControl.cs +++ b/Ryujinx.HLE/HOS/Kernel/Common/KSystemControl.cs @@ -58,6 +58,12 @@ namespace Ryujinx.HLE.HOS.Kernel.Common return DramMemoryMap.DramBase + GetDramSize(size); } + public static ulong GenerateRandom() + { + // TODO + return 0; + } + public static ulong GetDramSize(MemorySize size) { return size switch diff --git a/Ryujinx.HLE/HOS/Kernel/Threading/KThread.cs b/Ryujinx.HLE/HOS/Kernel/Threading/KThread.cs index 396a79ba..64629248 100644 --- a/Ryujinx.HLE/HOS/Kernel/Threading/KThread.cs +++ b/Ryujinx.HLE/HOS/Kernel/Threading/KThread.cs @@ -187,6 +187,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading if (is64Bits) { + Context.SetX(18, KSystemControl.GenerateRandom() | 1); Context.SetX(31, stackTop); } else |