aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/process.h
AgeCommit message (Collapse)Author
2021-05-05hle: kernel: Rename Process to KProcess.bunnei
2021-05-05hle: kernel: Remove deprecated Object class.bunnei
2021-05-05hle: kernel: Migrate KResourceLimit to KAutoObject.bunnei
2021-05-05hle: kernel: Migrate KProcess to KAutoObject.bunnei
2021-02-18hle: kernel: Migrate PageHeap/PageTable to KPageHeap/KPageTable.bunnei
2021-02-05hle: kernel: svc: Cleanup KEvent/KReadableEvent/KWritableEvent SVCs.bunnei
2021-01-30kernel: Rewrite resource limit to be more accurateChloe Marcec
Matches closer to hardware
2021-01-28hle: kernel: process: Add state lock.bunnei
2021-01-28hle: kernel: Recode implementation of KThread to be more accurate.bunnei
2021-01-28core: hle: kernel: object: Implement Finalize() virtual method.bunnei
2021-01-28hle: kernel: KThread: Clean up thread priorities.bunnei
2021-01-28core: hle: kernel: Rename Thread to KThread.bunnei
2021-01-11core: hle: Integrate new KConditionVariable and KAddressArbiter implementations.bunnei
2021-01-11core: hle: kernel: Update KSynchronizationObject.bunnei
2020-12-06hle: kernel: Process: Various style fixes based on code review feedback.bunnei
2020-12-06hle: kernel: process: Add schedule count tracking, to be used for yield impl.bunnei
2020-07-15kernel/process: Move name and system context to the bottom of the member listLioncash
These aren't directly important or commonly used within the process, so we can move these to the bottom to allow everything else to be more likely to be within a cache line.
2020-04-17kernel: process: Updates for new VMM.bunnei
2020-02-11Kernel: Refactor synchronization to better match REFernando Sahmkow
2020-02-11Kernel: Change WaitObject to Synchronization object. In order to better ↵Fernando Sahmkow
reflect RE.
2019-11-24kernel: Replace usage of boost::intrusive_ptr with std::shared_ptr for ↵bunnei
kernel objects. (#3154) * kernel: Replace usage of boost::intrusive_ptr with std::shared_ptr for kernel objects. - See https://github.com/citra-emu/citra/pull/4710 for details.
2019-11-21Kernel: Optimize condition variable threads management.Fernando Sahmkow
2019-11-21Kernel: Correct behavior of Condition Variables to be more similar to real ↵Fernando Sahmkow
hardware. This commit ensures cond var threads act exactly as they do in the real console. The original implementation uses an RBTree and the behavior of cond var threads is that at the same priority level they act like a FIFO.
2019-07-18Merge pull request #2687 from lioncash/tls-processbunnei
kernel/process: Allocate the process' TLS region during initialization
2019-07-07address review commentaryMichael Scire
2019-07-07Implement MapPhysicalMemory/UnmapPhysicalMemoryMichael Scire
This implements svcMapPhysicalMemory/svcUnmapPhysicalMemory for Yuzu, which can be used to map memory at a desired address by games since 3.0.0. It also properly parses SystemResourceSize from NPDM, and makes information available via svcGetInfo. This is needed for games like Super Smash Bros. and Diablo 3 -- this PR's implementation does not run into the "ASCII reads" issue mentioned in the comments of #2626, which was caused by the following bugs in Yuzu's memory management that this PR also addresses: * Yuzu's memory coalescing does not properly merge blocks. This results in a polluted address space/svcQueryMemory results that would be impossible to replicate on hardware, which can lead to game code making the wrong assumptions about memory layout. * This implements better merging for AllocatedMemoryBlocks. * Yuzu's implementation of svcMirrorMemory unprotected the entire virtual memory range containing the range being mirrored. This could lead to games attempting to map data at that unprotected range/attempting to access that range after yuzu improperly unmapped it. * This PR fixes it by simply calling ReprotectRange instead of Reprotect.
2019-07-07kernel/process: Allocate the process' TLS region during initializationLioncash
Prior to execution within a process beginning, the process establishes its own TLS region for uses (as far as I can tell) related to exception handling. Now that TLS creation was decoupled from threads themselves, we can add this behavior to our Process class. This is also good, as it allows us to remove a stub within svcGetInfo, namely querying the address of that region.
2019-07-07kernel/process: Move main thread stack allocation to its own functionLioncash
Keeps this particular set of behavior isolated to its own function.
2019-07-03kernel/process: Default initialize all member variablesLioncash
Ensures a Process instance is always created with a deterministic initial state.
2019-07-03kernel/process: Decouple TLS handling from threadsLioncash
Extracts out all of the thread local storage management from thread instances themselves and makes the owning process handle the management of the memory. This brings the memory management slightly more in line with how the kernel handles these allocations. Furthermore, this also makes the TLS page management a little more readable compared to the lingering implementation that was carried over from Citra.
2019-06-10kernel: Differentiate kernel and user processes when picking IDZach Hilman
This allows kernel internal type processes to be assigned IDs in the KIP range while userland processes are assigned in the user range.
2019-06-09Merge pull request #2571 from lioncash/refZach Hilman
kernel/process: Make Create()'s name parameter be taken by value
2019-06-09kernel/process: Make Create()'s name parameter be taken by valueLioncash
Makes the interface more flexible in terms of how Create() may be called, while still allowing the parameter itself to be moved into.
2019-06-09kernel/svc: Implement ↵Lioncash
TotalMemoryUsedWithoutMmHeap/TotalMemoryAvailableWithoutMmHeap Given we don't currently implement the personal heap yet, the existing memory querying functions are essentially doing what the memory querying types introduced in 6.0.0 do. So, we can build the necessary machinery over the top of those and just use them as part of info types.
2019-06-05kernel/process: Remove unused boost header includeLioncash
Boost headers typically include a lot of other headers, so removing this can prevent a bit of unnecessary compiler churn when building.
2019-04-11core/core: Move process execution start to System's Load()Lioncash
This gives us significantly more control over where in the initialization process we start execution of the main process. Previously we were running the main process before the CPU or GPU threads were initialized (not good). This amends execution to start after all of our threads are properly set up.
2019-04-11kernel: Make handle type declarations constexprLioncash
Some objects declare their handle type as const, while others declare it as constexpr. This makes the const ones constexpr for consistency, and prevent unexpected compilation errors if these happen to be attempted to be used within a constexpr context.
2019-04-03Merge pull request #2314 from lioncash/constbunnei
kernel/thread: Minor interface cleanup
2019-04-02kernel/svc: Implement svcGetThreadListLioncash
Similarly like svcGetProcessList, this retrieves the list of threads from the current process. In the kernel itself, a process instance maintains a list of threads, which are used within this function. Threads are registered to a process' thread list at thread initialization, and unregistered from the list upon thread destruction (if said thread has a non-null owning process). We assert on the debug event case, as we currently don't implement kernel debug objects.
2019-04-01kernel/wait_object: Make ShouldWait() take thread members by pointer-to-constLioncash
Given this is intended as a querying function, it doesn't make sense to allow the implementer to modify the state of the given thread.
2019-03-28kernel/process: Report total physical memory used to svcGetInfoLioncash
Reports the (mostly) correct size through svcGetInfo now for queries to total used physical memory. This still doesn't correctly handle memory allocated via svcMapPhysicalMemory, however, we don't currently handle that case anyways.
2019-03-28kernel/process: Store the total size of the code memory loadedLioncash
This will be necessary to properly report the used memory size in svcGetInfo.
2019-03-28kernel/process: Store the main thread stack size to a data memberLioncash
This will be necessary in order to properly report memory usage within svcGetInfo.
2019-03-28kernel/process: Make Run's stack size parameter a u64Lioncash
This will make operating with the process-related SVC commands much nicer in the future (the parameter representing the stack size in svcStartProcess is a 64-bit value).
2019-03-24kernel/process: Remove unused AddressMapping structLioncash
Another leftover from citra that's now no longer necessary.
2019-03-21Merge pull request #2234 from lioncash/mutexbunnei
core/hle/kernel: Make Mutex a per-process class.
2019-03-20kernel: Move CodeSet structure to its own source filesLioncash
Given this is utilized by the loaders, this allows avoiding inclusion of the kernel process definitions where avoidable. This also keeps the loading format for all executable data separate from the kernel objects.
2019-03-14core/hle/kernel: Make Mutex a per-process class.Lioncash
Makes it an instantiable class like it is in the actual kernel. This will also allow removing reliance on global accessors in a following change, now that we can encapsulate a reference to the system instance in the class.
2019-03-12kernel/process: Remove use of global system accessorsLioncash
Now that we pass in a reference to the system instance, we can utilize it to eliminate the global accessors in Process-related code.
2019-03-07kernel: Make the address arbiter instance per-processLioncash
Now that we have the address arbiter extracted to its own class, we can fix an innaccuracy with the kernel. Said inaccuracy being that there isn't only one address arbiter. Each process instance contains its own AddressArbiter instance in the actual kernel. This fixes that and gets rid of another long-standing issue that could arise when attempting to create more than one process.