summaryrefslogtreecommitdiffstats
path: root/src/core/cpu_manager.cpp (unfollow)
Commit message (Collapse)AuthorFilesLines
2022-12-06general: improve handling of system startup failureLiam1-8/+7
2022-10-04common: remove "yuzu:" prefix from thread namesLiam1-2/+2
2022-07-15kernel: fix single-core preemption pointsLiam1-28/+14
2022-07-15kernel: fix issues with single core modeLiam1-51/+101
2022-07-15kernel: use KScheduler from mesosphereLiam1-100/+61
2022-07-02common/fiber: make fibers easier to useLiam1-35/+16
2022-06-30cpu_manager: properly check idle on return from preemptionLiam1-1/+3
2022-06-23kernel: make current thread pointer thread localLiam1-9/+8
2022-06-17core: fix initialization in single core, sync GPU modeLiam1-0/+3
2022-06-15core: centralize profile scope for DynarmicLiam1-4/+0
2022-06-14kernel: implement KProcess suspensionLiam1-97/+30
2022-06-09CpuManager: simplify pausingLiam1-84/+32
2022-04-23general: Convert source file copyright comments over to SPDXMorph1-3/+2
This formats all copyright comments according to SPDX formatting guidelines. Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
2021-12-07core: hle: kernel: Disable dispatch count tracking on single core.bunnei1-1/+1
- This would have limited value, and would be a mess to handle properly.
2021-12-07core: cpu_manager: Use invalid core_id on init and simplify shutdown.bunnei1-7/+3
2021-12-07core: cpu_manager: Use KScopedDisableDispatch.bunnei1-7/+8
2021-11-04core: Remove unused includesameerj1-1/+0
2021-09-04core: cpu_manager: Use jthread.bunnei1-15/+10
2021-08-26Revert "kernel: Various improvements to scheduler"bunnei1-16/+24
2021-08-14core: hle: kernel: Disable dispatch count tracking on single core.bunnei1-1/+1
- This would have limited value, and would be a mess to handle properly.
2021-08-07core: cpu_manager: Use invalid core_id on init and simplify shutdown.bunnei1-7/+3
2021-08-07core: cpu_manager: Use KScopedDisableDispatch.bunnei1-7/+8
2021-08-07core: cpu_manager: Use jthread.bunnei1-15/+10
2021-05-16core: Make variable shadowing a compile-time errorLioncash1-1/+1
Now that we have most of core free of shadowing, we can enable the warning as an error to catch anything that may be remaining and also eliminate this class of logic bug entirely.
2021-03-07common: Fiber: use a reference for YieldTo.bunnei1-4/+4
- Fixes another small leak.
2021-03-06Revert "core: Switch to unique_ptr for usage of Common::Fiber."bunnei1-6/+5
2021-02-27core: Switch to unique_ptr for usage of Common::Fiber.bunnei1-5/+6
- With using unique_ptr instead of shared_ptr, we have more explicit ownership of the context. - Fixes a memory leak due to circular reference of the shared pointer.
2021-01-29core: cpu_manager: Remove unused variable.bunnei1-1/+0
2021-01-29hle: kernel: Recode implementation of KThread to be more accurate.bunnei1-2/+1
2021-01-29hle: kernel: Move single core "phantom mode" out of KThread.bunnei1-6/+7
- This is a workaround that does not belong in a kernel primitive.
2021-01-29hle: kernel: KThread: Remove thread types that do not exist.bunnei1-1/+1
2021-01-29core: hle: kernel: Rename Thread to KThread.bunnei1-4/+4
2020-12-06core: cpu_manager: Fix a typo in PreemptSingleCore, which broke many games.bunnei1-21/+26
- We were reload'ing the old current scheduler, which may have changed.
2020-12-06hle: kernel: Rewrite scheduler implementation based on Mesopshere.bunnei1-34/+21
2020-11-29hle: kernel: multicore: Replace n-JITs impl. with 4 JITs.bunnei1-7/+9
2020-11-27core: Eliminate remaining usages of the global system instanceLioncash1-1/+0
Removes all remaining usages of the global system instance. After this, migration can begin to migrate to being constructed and managed entirely by the various frontends.
2020-11-25core: cpu_manager: Fix shutdown crash when closing before emulation starts.bunnei1-7/+17
2020-10-27core: cpu_manager: Add missing call to MicroProfileOnThreadExit().bunnei1-0/+2
- Fixes an occasional crash when trying to launch subsequent games.
2020-08-23cpu_manager: Make use of ranged for where applicableLioncash1-16/+13
We can simplify a few loops by making use of ranged for.
2020-08-06Fix thread naming on Linux, which limits names to 15 bytes.comex1-1/+1
- In `SetCurrentThreadName`, when on Linux, truncate to 15 bytes, as (at least on glibc) `pthread_set_name_np` will otherwise return `ERANGE` and do nothing. - Also, add logging in case `pthread_set_name_np` returns an error anyway. This is Linux-specific, as the Apple and BSD versions of `pthread_set_name_np return `void`. - Change the name for CPU threads in multi-core mode from "yuzu:CoreCPUThread_N" (19 bytes) to "yuzu:CPUCore_N" (14 bytes) so it fits into the Linux limit. Some other thread names are also cut off, but I didn't bother addressing them as you can guess them from the truncated versions. For a CPU thread, truncation means you can't see which core it is!
2020-07-28cpu_manager: Remove redundant std::function declarationsLioncash1-3/+3
We can just return the function directly. Making for less reading.
2020-06-27General: Tune the priority of main emulation threads so they have higher priority than less important helper threads.Fernando Sahmkow1-0/+1
2020-06-27General: Correct rebase, sync gpu and context management.Fernando Sahmkow1-9/+2
2020-06-27SingleCore: Correct ticks reset to be on preemption.Fernando Sahmkow1-1/+1
2020-06-27Bootmanager/CPU_Manager: Correct shader caches and sync GPU on OpenGL.Fernando Sahmkow1-6/+9
2020-06-27SingleCore: Improve Cycle timing Behavior and replace mutex in global scheduler for spinlock.Fernando Sahmkow1-0/+1
2020-06-27SingleCore: Use Cycle Timing instead of Host Timing.Fernando Sahmkow1-9/+9
2020-06-27General: Move ARM_Interface into Threads.Fernando Sahmkow1-16/+14
2020-06-27SingleCore: Move Host Timing from a sepparate thread to main cpu thread.Fernando Sahmkow1-2/+15
2020-06-27GUI: Make multicore only work with Async and add GUI for multicore.Fernando Sahmkow1-0/+11
2020-06-27CPU_Manager: Correct stopping on SingleCore.Fernando Sahmkow1-3/+8
2020-06-27General: Fix microprofile on dynarmic/svc, fix wait tree showing which threads were running.Fernando Sahmkow1-0/+4
2020-06-27CPU_Manager: Unload/Reload threads on preemption on SingleCoreFernando Sahmkow1-5/+9
2020-06-27General: Initial Setup for Single Core.Fernando Sahmkow1-26/+160
2020-06-27General: Add better safety for JIT use.Fernando Sahmkow1-6/+19
2020-06-27SVC: Correct races on physical core switching.Fernando Sahmkow1-5/+6
2020-06-27CPU_Manager: Reconfigre guest threads for dynamrmic downsidesFernando Sahmkow1-1/+2
2020-06-27SVC: Correct SendSyncRequest.Fernando Sahmkow1-2/+1
2020-06-27General: Setup yuzu threads' microprofile, naming and registry.Fernando Sahmkow1-1/+4
2020-06-27CPU_Manager: remove debugging code.Fernando Sahmkow1-8/+4
2020-06-27General: Recover Prometheus project from harddrive failure Fernando Sahmkow1-41/+153
This commit: Implements CPU Interrupts, Replaces Cycle Timing for Host Timing, Reworks the Kernel's Scheduler, Introduce Idle State and Suspended State, Recreates the bootmanager, Initializes Multicore system.
2020-01-31core/cpu_manager: Remove unused includesLioncash1-2/+0
Nothing from these headers are used within this source file, so we can remove them.
2020-01-27System: Address FeedbackFernando Sahmkow1-1/+0
2020-01-26Core: Refactor CpuCoreManager to CpuManager and Cpu to Core Manager.Fernando Sahmkow1-26/+19
This commit instends on better naming the new purpose of this classes.
2020-01-25Core: Refactor CPU Management.Fernando Sahmkow1-62/+1
This commit moves ARM Interface and Scheduler handling into the kernel.
2019-11-27core/memory: Migrate over Write{8, 16, 32, 64, Block} to the Memory classLioncash1-1/+1
The Write functions are used slightly less than the Read functions, which make these a bit nicer to move over. The only adjustments we really need to make here are to Dynarmic's exclusive monitor instance. We need to keep a reference to the currently active memory instance to perform exclusive read/write operations.
2019-10-15Kernel Scheduler: Make sure the global scheduler shutdowns correctly.Fernando Sahmkow1-0/+1
2019-10-11Core_Timing: Address Feedback and suppress warnings.Fernando Sahmkow1-2/+2
2019-10-09Core Timing: Rework Core Timing to run all cores evenly.Fernando Sahmkow1-6/+13
2019-04-12core/cpu_core_manager: Create threads separately from initialization.Lioncash1-2/+4
Our initialization process is a little wonky than one would expect when it comes to code flow. We initialize the CPU last, as opposed to hardware, where the CPU obviously needs to be first, otherwise nothing else would work, and we have code that adds checks to get around this. For example, in the page table setting code, we check to see if the system is turned on before we even notify the CPU instances of a page table switch. This results in dead code (at the moment), because the only time a page table switch will occur is when the system is *not* running, preventing the emulated CPU instances from being notified of a page table switch in a convenient manner (technically the code path could be taken, but we don't emulate the process creation svc handlers yet). This moves the threads creation into its own member function of the core manager and restores a little order (and predictability) to our initialization process. Previously, in the multi-threaded cases, we'd kick off several threads before even the main kernel process was created and ready to execute (gross!). Now the initialization process is like so: Initialization: 1. Timers 2. CPU 3. Kernel 4. Filesystem stuff (kind of gross, but can be amended trivially) 5. Applet stuff (ditto in terms of being kind of gross) 6. Main process (will be moved into the loading step in a following change) 7. Telemetry (this should be initialized last in the future). 8. Services (4 and 5 should ideally be alongside this). 9. GDB (gross. Uses namespace scope state. Needs to be refactored into a class or booted altogether). 10. Renderer 11. GPU (will also have its threads created in a separate step in a following change). Which... isn't *ideal* per-se, however getting rid of the wonky intertwining of CPU state initialization out of this mix gets rid of most of the footguns when it comes to our initialization process.
2019-03-04kernel/scheduler: Pass in system instance in constructorLioncash1-2/+1
Avoids directly relying on the global system instance and instead makes an arbitrary system instance an explicit dependency on construction. This also allows removing dependencies on some global accessor functions as well.
2019-02-16core_timing: Convert core timing into a classLioncash1-1/+2
Gets rid of the largest set of mutable global state within the core. This also paves a way for eliminating usages of GetInstance() on the System class as a follow-up. Note that no behavioral changes have been made, and this simply extracts the functionality into a class. This also has the benefit of making dependencies on the core timing functionality explicit within the relevant interfaces.
2018-11-22core: Relocate CPU core management to its own classLioncash1-0/+142
Keeps the CPU-specific behavior from being spread throughout the main System class. This will also act as the home to contain member functions that perform operations on all cores. The reason for this being that the following pattern is sort of prevalent throughout sections of the codebase: If clearing the instruction cache for all 4 cores is necessary: Core::System::GetInstance().ArmInterface(0).ClearInstructionCache(); Core::System::GetInstance().ArmInterface(1).ClearInstructionCache(); Core::System::GetInstance().ArmInterface(2).ClearInstructionCache(); Core::System::GetInstance().ArmInterface(3).ClearInstructionCache(); This is kind of... well, silly to copy around whenever it's needed. especially when it can be reduced down to a single line. This change also puts the basics in place to begin "ungrafting" all of the forwarding member functions from the System class that are used to access CPU state or invoke CPU-specific behavior. As such, this change itself makes no changes to the direct external interface of System. This will be covered by another changeset.