| Age | Commit message (Collapse) | Author |
|
|
|
creating a thread and remove the priority clamping code.
|
|
priority clamping code from Thread::SetPriority.
|
|
Don't yield execution in SleepThread(0) if there are no available threads to run
|
|
Kernel: Removed the priority boost code for starved threads.
|
|
available threads to run.
With this we avoid an useless temporary deschedule of the current thread.
|
|
|
|
After hwtesting and reverse engineering the kernel, it was found that the CTROS scheduler performs no priority boosting for threads like this, although some other forms of scheduling priority-starved threads might take place.
For example, it was found that hardware interrupts might cause low-priority threads to run if the CPU is preempted in the middle of an SVC handler that deschedules the current (high priority) thread before scheduling it again.
|
|
|
|
the objects that a thread is waiting on.
|
|
WaitSynchronization1 and WaitSynchronizationN with wait_all = true.
This commit removes the overly general THREADSTATUS_WAIT_SYNCH and replaces it with two more granular statuses:
THREADSTATUS_WAIT_SYNCH_ANY when a thread waits on objects via WaitSynchronization1 or WaitSynchronizationN with wait_all = false.
THREADSTATUS_WAIT_SYNCH_ALL when a thread waits on objects via WaitSynchronizationN with wait_all = true.
|
|
the priority via mutexes
|
|
The implementation is based on reverse engineering of the 3DS's kernel.
A mutex holder's priority will be temporarily boosted to the best priority among any threads that want to acquire any of its held mutexes.
When the holder releases the mutex, it's priority will be boosted to the best priority among the threads that want to acquire any of its remaining held mutexes.
|
|
This will be useful when implementing mutex priority inheritance.
|
|
|
|
|
|
|
|
|
|
|
|
by a timeout.
|
|
Threads will now be awakened when the objects they're waiting on are signaled, instead of repeating the WaitSynchronization call every now and then.
The scheduler is now called once after every SVC call, and once after a thread is awakened from sleep by its timeout callback.
This new implementation is based off reverse-engineering of the real kernel.
See https://gist.github.com/Subv/02f29bd9f1e5deb7aceea1e8f019c8f4 for a more detailed description of how the real kernel handles rescheduling.
|
|
|
|
|
|
|
|
This makes clang-format useful on those.
Also add a bunch of forgotten transitive includes, which otherwise
prevented compilation.
|
|
|
|
|
|
|
|
Switch context to the same thread if necessary
|
|
|
|
|
|
|
|
|
|
Kernel/Threads: Dynamically allocate the TLS region for threads.
|
|
region of the linear heap.
Each thread gets a 0x200-byte area from the 0x1000-sized page, when all 8 thread slots in a single page are used up, the kernel allocates a new page to hold another 8 entries.
This is consistent with what the real kernel does.
|
|
This shouldn't be directly exposed if there's already a partial API that operates on it.
We can just provide the rest of that API.
|
|
This was verified with hwtests that i plan to upload later on.
|
|
This makes smealum/ctrulib@b96dd51d3349961189d4ab1bc2a5c45deff21c09 work
with Citra.
|
|
|
|
This also adds some basic memory usage accounting. These two types are
used by Super Smash Bros. during startup.
|
|
|
|
They'll be reset if needed during the next svcWaitSynchronization call (if there's any pending)
|
|
This commit fixes several kernel object leaks. The most severe of them
was threads not being removed from the private handle table used for
CoreTiming events. This resulted in Threads never being released, which
in turn held references to Process, causing CodeSets to never be freed
when loading other applications.
|
|
|
|
|
|
|
|
memory.cpp/h contains definitions related to acessing memory and
configuring the address space
mem_map.cpp/h contains higher-level definitions related to configuring
the address space accoording to the kernel and allocating memory.
|
|
|
|
Core/Memory: Add TLS support for creating up to 300 threads
|
|
Thread: Remove the idle thread
|