diff options
| author | Alex Barney <thealexbarney@gmail.com> | 2019-07-01 21:39:22 -0500 |
|---|---|---|
| committer | Ac_K <Acoustik666@gmail.com> | 2019-07-02 04:39:22 +0200 |
| commit | b2b736abc2569ab5d8199da666aef8d8394844a0 (patch) | |
| tree | 88bcc2ae4fb0d4161c95df2cd7edb12388de922a /Ryujinx.HLE/HOS/Kernel/Process | |
| parent | 10c74182babaf8cf6bedaeffd64c3109df4ea816 (diff) | |
Misc cleanup (#708)
* Fix typos
* Remove unneeded using statements
* Enforce var style more
* Remove redundant qualifiers
* Fix some indentation
* Disable naming warnings on files with external enum names
* Fix build
* Mass find & replace for comments with no spacing
* Standardize todo capitalization and for/if spacing
Diffstat (limited to 'Ryujinx.HLE/HOS/Kernel/Process')
| -rw-r--r-- | Ryujinx.HLE/HOS/Kernel/Process/HleProcessDebugger.cs | 10 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Kernel/Process/KProcess.cs | 34 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Kernel/Process/KProcessCapabilities.cs | 6 |
3 files changed, 24 insertions, 26 deletions
diff --git a/Ryujinx.HLE/HOS/Kernel/Process/HleProcessDebugger.cs b/Ryujinx.HLE/HOS/Kernel/Process/HleProcessDebugger.cs index d31f95b4..223bf5da 100644 --- a/Ryujinx.HLE/HOS/Kernel/Process/HleProcessDebugger.cs +++ b/Ryujinx.HLE/HOS/Kernel/Process/HleProcessDebugger.cs @@ -1,10 +1,8 @@ using ChocolArm64.Memory; using ChocolArm64.State; -using Ryujinx.Common.Logging; using Ryujinx.HLE.HOS.Diagnostics.Demangler; using Ryujinx.HLE.HOS.Kernel.Memory; using Ryujinx.HLE.Loaders.Elf; -using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -75,7 +73,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process } } - //TODO: ARM32. + // TODO: ARM32. long framePointer = (long)threadState.X29; trace.AppendLine($"Process: {_owner.Name}, PID: {_owner.Pid}"); @@ -89,8 +87,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Process break; } - //Note: This is the return address, we need to subtract one instruction - //worth of bytes to get the branch instruction address. + // Note: This is the return address, we need to subtract one instruction + // worth of bytes to get the branch instruction address. AppendTrace(_owner.CpuMemory.ReadInt64(framePointer + 8) - 4); framePointer = _owner.CpuMemory.ReadInt64(framePointer); @@ -245,7 +243,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process long ehHdrEndOffset = memory.ReadInt32(mod0Offset + 0x14) + mod0Offset; long modObjOffset = memory.ReadInt32(mod0Offset + 0x18) + mod0Offset; - //TODO: Elf32. + // TODO: Elf32. while (true) { long tagVal = memory.ReadInt64(dynamicOffset + 0); diff --git a/Ryujinx.HLE/HOS/Kernel/Process/KProcess.cs b/Ryujinx.HLE/HOS/Kernel/Process/KProcess.cs index 909f6333..1b5a6772 100644 --- a/Ryujinx.HLE/HOS/Kernel/Process/KProcess.cs +++ b/Ryujinx.HLE/HOS/Kernel/Process/KProcess.cs @@ -350,7 +350,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process private KernelResult ParseProcessInfo(ProcessCreationInfo creationInfo) { - //Ensure that the current kernel version is equal or above to the minimum required. + // Ensure that the current kernel version is equal or above to the minimum required. uint requiredKernelVersionMajor = (uint)Capabilities.KernelReleaseVersion >> 19; uint requiredKernelVersionMinor = ((uint)Capabilities.KernelReleaseVersion >> 15) & 0xf; @@ -429,7 +429,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process if (_freeTlsPages.Count > 0) { - //If we have free TLS pages available, just use the first one. + // If we have free TLS pages available, just use the first one. KTlsPageInfo pageInfo = _freeTlsPages.Values.First(); if (!pageInfo.TryGetFreePage(out address)) @@ -448,7 +448,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process } else { - //Otherwise, we need to create a new one. + // Otherwise, we need to create a new one. result = AllocateTlsPage(out KTlsPageInfo pageInfo); if (result == KernelResult.Success) @@ -522,7 +522,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process if (_fullTlsPages.TryGetValue(tlsPageAddr, out pageInfo)) { - //TLS page was full, free slot and move to free pages tree. + // TLS page was full, free slot and move to free pages tree. _fullTlsPages.Remove(tlsPageAddr); _freeTlsPages.Add(tlsPageAddr, pageInfo); @@ -538,8 +538,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Process if (pageInfo.IsEmpty()) { - //TLS page is now empty, we should ensure it is removed - //from all trees, and free the memory it was using. + // TLS page is now empty, we should ensure it is removed + // from all trees, and free the memory it was using. _freeTlsPages.Remove(tlsPageAddr); System.CriticalSection.Leave(); @@ -574,7 +574,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process private void GenerateRandomEntropy() { - //TODO. + // TODO. } public KernelResult Start(int mainThreadPriority, ulong stackSize) @@ -603,9 +603,9 @@ namespace Ryujinx.HLE.HOS.Kernel.Process ulong neededSize = stackSizeRounded + _imageSize; - //Check if the needed size for the code and the stack will fit on the - //memory usage capacity of this Process. Also check for possible overflow - //on the above addition. + // Check if the needed size for the code and the stack will fit on the + // memory usage capacity of this Process. Also check for possible overflow + // on the above addition. if (neededSize > _memoryUsageCapacity || neededSize < stackSizeRounded) { @@ -742,10 +742,10 @@ namespace Ryujinx.HLE.HOS.Kernel.Process SetState(newState); - //TODO: We can't call KThread.Start from a non-guest thread. - //We will need to make some changes to allow the creation of - //dummy threads that will be used to initialize the current - //thread on KCoreContext so that GetCurrentThread doesn't fail. + // TODO: We can't call KThread.Start from a non-guest thread. + // We will need to make some changes to allow the creation of + // dummy threads that will be used to initialize the current + // thread on KCoreContext so that GetCurrentThread doesn't fail. /* Result = MainThread.Start(); if (Result != KernelResult.Success) @@ -935,7 +935,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process if (shallTerminate) { - //UnpauseAndTerminateAllThreadsExcept(System.Scheduler.GetCurrentThread()); + // UnpauseAndTerminateAllThreadsExcept(System.Scheduler.GetCurrentThread()); HandleTable.Destroy(); @@ -948,12 +948,12 @@ namespace Ryujinx.HLE.HOS.Kernel.Process private void UnpauseAndTerminateAllThreadsExcept(KThread thread) { - //TODO. + // TODO. } private void SignalExitForDebugEvent() { - //TODO: Debug events. + // TODO: Debug events. } private void SignalExit() diff --git a/Ryujinx.HLE/HOS/Kernel/Process/KProcessCapabilities.cs b/Ryujinx.HLE/HOS/Kernel/Process/KProcessCapabilities.cs index 964762bb..2396aea8 100644 --- a/Ryujinx.HLE/HOS/Kernel/Process/KProcessCapabilities.cs +++ b/Ryujinx.HLE/HOS/Kernel/Process/KProcessCapabilities.cs @@ -131,7 +131,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process int codeMask = 1 << (32 - BitUtils.CountLeadingZeros32(code + 1)); - //Check if the property was already set. + // Check if the property was already set. if (((mask0 & codeMask) & 0x1e008) != 0) { return KernelResult.InvalidCombination; @@ -223,7 +223,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process case 0x800: { - //TODO: GIC distributor check. + // TODO: GIC distributor check. int irq0 = (cap >> 12) & 0x3ff; int irq1 = (cap >> 22) & 0x3ff; @@ -256,7 +256,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process case 0x4000: { - //Note: This check is bugged on kernel too, we are just replicating the bug here. + // Note: This check is bugged on kernel too, we are just replicating the bug here. if ((KernelReleaseVersion >> 17) != 0 || cap < 0x80000) { return KernelResult.ReservedValue; |
