aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/process.cpp
AgeCommit message (Collapse)Author
2018-12-21kernel/process: Hook up the process capability parser to the process itselfLioncash
While we're at it, we can also toss out the leftover capability parsing from Citra.
2018-12-12vm_manager: Amend MemoryState enum membersLioncash
Amends the MemoryState enum to use the same values like the actual kernel does. Also provides the necessary operators to operate on them. This will be necessary in the future for implementing svcSetMemoryAttribute, as memory block state is checked before applying the attribute.
2018-12-10Merge pull request #1872 from lioncash/proc-infoHexagon12
kernel/process: Set ideal core from metadata
2018-12-05kernel/process: Set ideal core from metadataLioncash
A very trivial change. If metadata is available, the process should use it to retrieve the desired core for the process to run on.
2018-12-04kernel/process: Make Process a WaitObjectLioncash
Process instances can be waited upon for state changes. This is also utilized by svcResetSignal, which will be modified in an upcoming change. This simply puts all of the WaitObject related machinery in place.
2018-12-04kernel/svc: Implement the resource limit svcGetInfo optionLioncash
Allows a process to register the resource limit as part of its handle table.
2018-11-20kernel/process: Move <random> include to the cpp fileLioncash
<random> isn't necesary directly within the header and can be placed in the cpp file where its needed. Avoids propagating random generation utilities via a header file.
2018-11-19kernel/resource_limit: Clean up interfaceLioncash
Cleans out the citra/3DS-specific implementation details that don't apply to the Switch. Sets the stage for implementing ResourceLimit instances properly. While we're at it, remove the erroneous checks within CreateThread() and SetThreadPriority(). While these are indeed checked in some capacity, they are not checked via a ResourceLimit instance. In the process of moving out Citra-specifics, this also replaces the system ResourceLimit instance's values with ones from the Switch.
2018-11-17ldr_ro: Add error check for memory allocation failureZach Hilman
2018-11-14Merge pull request #1679 from DarkLordZach/deterministic-rng-2bunnei
svc: Use proper random entropy generation algorithm
2018-11-13kernel/process: Migrate heap-related memory management out of the process ↵Lioncash
class and into the vm manager Avoids a breach of responsibilities in the interface and keeps the direct code for memory management within the VMManager class.
2018-11-13svc: Use proper random entropy generation algorithmZach Hilman
2018-10-25process: LoadModule should clear JIT instruction cache.bunnei
2018-10-15core_cpu: Make Cpu scheduler instances unique_ptrs instead of shared_ptrsLioncash
2018-10-12kernel/process: Make CodeSet a regular non-inherited objectLioncash
These only exist to ferry data into a Process instance and end up going out of scope quite early. Because of this, we can just make it a plain struct for holding things and just std::move it into the relevant function. There's no need to make this inherit from the kernel's Object type.
2018-10-04kernel/thread: Make all instance variables privateLioncash
Many of the member variables of the thread class aren't even used outside of the class itself, so there's no need to make those variables public. This change follows in the steps of the previous changes that made other kernel types' members private. The main motivation behind this is that the Thread class will likely change in the future as emulation becomes more accurate, and letting random bits of the emulator access data members of the Thread class directly makes it a pain to shuffle around and/or modify internals. Having all data members public like this also makes it difficult to reason about certain bits of behavior without first verifying what parts of the core actually use them. Everything being public also generally follows the tendency for changes to be introduced in completely different translation units that would otherwise be better introduced as an addition to the Thread class' public interface.
2018-09-30kernel/process: Add a data member to determine if a process is 64-bit or not.Lioncash
This will be necessary for the implementation of svcGetThreadContext(), as the kernel checks whether or not the process that owns the thread that has it context being retrieved is a 64-bit or 32-bit process. If the process is 32-bit, then the upper 15 general-purpose registers and upper 16 vector registers are cleared to zero (as AArch32 only has 15 GPRs and 16 128-bit vector registers. not 31 general-purpose registers and 32 128-bit vector registers like AArch64).
2018-09-24memory: Dehardcode the use of fixed memory range constantsLioncash
The locations of these can actually vary depending on the address space layout, so we shouldn't be using these when determining where to map memory or be using them as offsets for calculations. This keeps all the memory ranges flexible and malleable based off of the virtual memory manager instance state.
2018-09-24process/vm_manager: Amend API to allow reading parameters from NPDM metadataLioncash
Rather than hard-code the address range to be 36-bit, we can derive the parameters from supplied NPDM metadata if the supplied exectuable supports it. This is the bare minimum necessary for this to be possible. The following commits will rework the memory code further to adjust to this.
2018-09-21svc: Move most process termination code to its own function within ProcessLioncash
Reduces the use of Process class members externally and keeps most code related to tearing down a process with the rest of the process code.
2018-09-21thread/process: Move TLS slot marking/freeing to the process classLioncash
Allows making several members of the process class private, it also avoids going through Core::CurrentProcess() just to retrieve the owning process.
2018-09-20kernel/thread: Use owner_process when setting the page table in ↵Lioncash
SetupMainThread() The owning process of a thread is required to exist before the thread, so we can enforce this API-wise by using a reference. We can also avoid the reliance on the system instance by using that parameter to access the page table that needs to be set.
2018-09-15Port #4182 from Citra: "Prefix all size_t with std::"fearlessTobi
2018-08-28kernel: Eliminate kernel global stateLioncash
As means to pave the way for getting rid of global state within core, This eliminates kernel global state by removing all globals. Instead this introduces a KernelCore class which acts as a kernel instance. This instance lives in the System class, which keeps its lifetime contained to the lifetime of the System class. This also forces the kernel types to actually interact with the main kernel instance itself instead of having transient kernel state placed all over several translation units, keeping everything together. It also has a nice consequence of making dependencies much more explicit. This also makes our initialization a tad bit more correct. Previously we were creating a kernel process before the actual kernel was initialized, which doesn't really make much sense. The KernelCore class itself follows the PImpl idiom, which allows keeping all the implementation details sealed away from everything else, which forces the use of the exposed API and allows us to avoid any unnecessary inclusions within the main kernel header.
2018-08-03kernel/process: Use accessors instead of class members for referencing ↵Lioncash
segment array Using member variables for referencing the segments array increases the size of the class in memory for little benefit. The same behavior can be achieved through the use of accessors that just return the relevant segment.
2018-08-03core/memory: Get rid of 3DS leftoversLioncash
Removes leftover code from citra that isn't needed.
2018-07-02Rename logging macro back to LOG_*James Rowe
2018-05-02general: Make formatting of logged hex values more straightforwardLioncash
This makes the formatting expectations more obvious (e.g. any zero padding specified is padding that's entirely dedicated to the value being printed, not any pretty-printing that also gets tacked on).
2018-04-27core: Replace usages of LOG_GENERIC with new fmt-capable equivalentsLioncash
2018-04-25kernel: Migrate logging macros to fmt-compatible onesLioncash
2018-03-31memory: Fix stack region.bunnei
2018-03-16process: MirrorMemory should use MemoryState::Mapped.bunnei
2018-03-16process: Unmap previously allocated heap.bunnei
2018-03-16kernel: Move stack region outside of application heap.bunnei
2018-03-16process: Fix stack memory state.bunnei
2018-03-16MemoryState: Add additional memory states and improve naming.bunnei
2018-03-14core: Move process creation out of global state.bunnei
2018-03-01Kernel: Store the program id in the Process class instead of the CodeSet class.Subv
There may be many CodeSets per Process, so it's wasteful and overcomplicated to store the program id in each of them.
2018-01-01svc: Implement svcExitProcess.bunnei
2017-12-31svc: Implement svcUnmapMemory.bunnei
2017-12-29kernel: Various 64-bit fixes in memory/process/threadbunnei
2017-12-28process: Add method to mirror a memory region.bunnei
2017-10-19hle: Fix QueryMemory response for MemoryInfo.bunnei
2017-10-09Merge remote-tracking branch 'upstream/master' into nxbunnei
# Conflicts: # src/core/CMakeLists.txt # src/core/arm/dynarmic/arm_dynarmic.cpp # src/core/arm/dyncom/arm_dyncom.cpp # src/core/hle/kernel/process.cpp # src/core/hle/kernel/thread.cpp # src/core/hle/kernel/thread.h # src/core/hle/kernel/vm_manager.cpp # src/core/loader/3dsx.cpp # src/core/loader/elf.cpp # src/core/loader/ncch.cpp # src/core/memory.cpp # src/core/memory.h # src/core/memory_setup.h
2017-10-09loader: Various improvements for NSO/NRO loaders.bunnei
2017-09-30nso: Refactor and allocate .bss section.bunnei
2017-09-30process: Support loading multiple codesets.bunnei
2017-09-26Kernel/Thread: Allow specifying which process a thread belongs to when ↵Subv
creating it. Don't automatically assume that Thread::Create will only be called when the parent process is currently scheduled. This assumption will be broken when applets or system modules are loaded.
2017-06-18Kernel: Add comment about the extended linear heap areaYuri Kunde Schlesner
2017-05-24Kernel: Centralize error definitions in errors.hYuri Kunde Schlesner