bunnei
a5ab85ac37
Revert "core: Switch to unique_ptr for usage of Common::Fiber."
5 years ago
bunnei
51fb0a6f96
core: Switch to unique_ptr for usage of Common::Fiber.
- 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.
5 years ago
bunnei
6e953f7f02
hle: kernel: Allocate a dummy KThread for each host thread, and use it for scheduling.
5 years ago
bunnei
37f74d8741
hle: kernel: k_scheduler: Use atomics for current_thread, etc.
5 years ago
bunnei
cdd14b03e5
hle: kernel: Recode implementation of KThread to be more accurate.
5 years ago
bunnei
c0d3aef28c
core: hle: kernel: Rename Thread to KThread.
5 years ago
bunnei
f12701b303
hle: kernel: k_scheduler: Cleanup OnThreadPriorityChanged.
5 years ago
bunnei
c3c43e32fc
hle: kernel: thread: Replace ThreadStatus/ThreadSchedStatus with a single ThreadState.
- This is how the real kernel works, and is more accurate and simpler.
5 years ago
bunnei
960500cfd2
hle: kernel: KScheduler: Various style fixes based on code review feedback.
5 years ago
bunnei
ccce6cb3be
hle: kernel: Migrate to KScopedSchedulerLock.
5 years ago
bunnei
4756cb203e
hle: kernel: Separate KScopedSchedulerLockAndSleep from k_scheduler.
5 years ago
bunnei
8d3e06349e
hle: kernel: Separate KScheduler from GlobalSchedulerContext class.
5 years ago
bunnei
9e29e36a78
hle: kernel: Rewrite scheduler implementation based on Mesopshere.
5 years ago
bunnei
4b9e1b6586
kernel: scheduler: Minor cleanup to remove duplicated code.
5 years ago
Lioncash
f808258ed9
kernel/scheduler: Mark SchedulerLock constructor as nodiscard
Allows the compiler to warn about cases where the constructor is used
but then immediately discarded, which is a potential cause of
locking/unlocking bugs.
5 years ago
ReinUsesLisp
9b38f4fc55
kernel/scheduler: Use std::mutex instead of spin lock
Profiling shows that this is a highly contested mutex, causing dimishing
results compared to a OS lock. std::mutex implementations can spin for a
while before falling back to an OS lock.
This avoids wasting precious CPU cycles in a no-op.
6 years ago
Fernando Sahmkow
2f8947583f
Core/Common: Address Feedback.
6 years ago
Fernando Sahmkow
d240143588
Kernel: Correct Host Context on Threads and Scheduler.
6 years ago
Fernando Sahmkow
7e2ce2f7f4
SingleCore: Improve Cycle timing Behavior and replace mutex in global scheduler for spinlock.
6 years ago
Fernando Sahmkow
a439cdf22e
CPU_Manager: Unload/Reload threads on preemption on SingleCore
6 years ago
Fernando Sahmkow
6515c6e8c6
Kernel: Fixes, corrections and asserts to scheduler and different svcs.
6 years ago
Fernando Sahmkow
1c672128c4
Scheduler: Release old thread fiber before trying to switch to the next thread fiber.
6 years ago
Fernando Sahmkow
07993ac8c8
Kernel: Corrections to Scheduling.
6 years ago
Fernando Sahmkow
2a8837ff51
General: Add Asserts
6 years ago
Fernando Sahmkow
15a79eb0d7
SVC: Correct SendSyncRequest.
6 years ago
Fernando Sahmkow
e31425df38
General: Recover Prometheus project from harddrive failure
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.
6 years ago
bunnei
c083ea7d78
core: Implement separate A32/A64 ARM interfaces.
6 years ago
Fernando Sahmkow
d219a96cc8
Kernel: Address Feedback.
6 years ago
Fernando Sahmkow
ea956c823e
Kernel: Implement Scheduler locks
6 years ago
Fernando Sahmkow
0728dfef84
Kernel: Make global scheduler depend on KernelCore
6 years ago
Fernando Sahmkow
1e6f8aba04
Core: Set all hardware emulation constants in a single file.
6 years ago
Lioncash
c3e43c7e81
kernel: Remove unnecessary includes
Over the course of the changes to the kernel code, a few includes are no
longer necessary, particularly with the change over to std::shared_ptr
from Boost's intrusive_ptr.
6 years ago
bunnei
9046d4a548
kernel: Replace usage of boost::intrusive_ptr with std::shared_ptr for 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.
6 years ago
Lioncash
12dc918937
kernel: Resolve sign conversion warnings
Uncovered a bug within Thread's SetCoreAndAffinityMask() where an
unsigned variable (ideal_core) was being compared against "< 0", which
would always be a false condition.
We can also get rid of an unused function (GetNextProcessorId) which contained a sign
mismatch warning.
6 years ago
Lioncash
6c8f28813c
scheduler: Mark parameter of AskForReselectionOrMarkRedundant() as const
This is only compared against, so it can be made const.
6 years ago
Lioncash
2fb0bbff29
scheduler: Initialize class members directly where applicable
Reduces the overall amount of code.
6 years ago
Lioncash
2dc469ceba
scheduler: Amend documentation comments
Adjusts the formatting of a few of the comments an ensures they get
recognized as proper Doxygen comments.
6 years ago
Fernando Sahmkow
3073615dbc
Kernel: Address Feedback.
6 years ago
Fernando Sahmkow
25f8606a6d
Kernel Scheduler: Make sure the global scheduler shutdowns correctly.
6 years ago
Fernando Sahmkow
2d382de6fa
Scheduler: Corrections to YieldAndBalanceLoad and Yield bombing protection.
6 years ago
Fernando Sahmkow
b49c0dab87
Kernel: Initial implementation of thread preemption.
6 years ago
Fernando Sahmkow
103f3a2fe5
Scheduler: Add protections for Yield bombing
In case of redundant yields, the scheduler will now idle the core for
it's timeslice, in order to avoid continuously yielding the same thing
over and over.
6 years ago
Fernando Sahmkow
82218c925a
Kernel: Style and Corrections
7 years ago
Fernando Sahmkow
3a94e7ea33
Comment and reorganize the scheduler
7 years ago
Fernando Sahmkow
b164d8ee53
Implement a new Core Scheduler
7 years ago
Lioncash
824b8e4086
kernel/scheduler: Remove unused parameter to AddThread()
This was made unused in b404fcdf14 , but
the parameter itself wasn't removed.
7 years ago
Fernando Sahmkow
dde0814837
Use MultiLevelQueue instead of old ThreadQueueList
7 years ago
Lioncash
fad20213e6
kernel/scheduler: Pass in system instance in constructor
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.
7 years ago
Zach Hilman
b5af41a07b
scheduler: Only work steal higher priority threads from other cores
7 years ago
Zach Hilman
820d81b9a5
scheduler: Add explanations for YieldWith and WithoutLoadBalancing
7 years ago