소스 검색

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
Mary 4 년 전
부모
커밋
786fb04d20
2개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      Ryujinx.HLE/HOS/Kernel/Common/KSystemControl.cs
  2. 1 0
      Ryujinx.HLE/HOS/Kernel/Threading/KThread.cs

+ 6 - 0
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

+ 1 - 0
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