Yuri Kunde Schlesner
be031989ee
Kernel: Move HandleTable to a separate file
9 years ago
Yuri Kunde Schlesner
64ecf81a3c
Kernel: Move WaitObject to a separate file
Now that HandleTable doesn't directly depend on WaitObject anymore, this
can be separated from the main kernel.h header.
9 years ago
Yuri Kunde Schlesner
9453223075
Kernel: Removed HandleTable::GetWaitObject
This isn't necessary anymore since plain Get works correctly for
WaitObjects.
9 years ago
Yuri Kunde Schlesner
b17754f998
Kernel: Extract dynamic Object pointer cast into its own function
9 years ago
Yuri Kunde Schlesner
2cdb40d709
Kernel: Centralize error definitions in errors.h
9 years ago
Subv
37347bfa38
Kernel/Sessions: Remove the ClientSession::Create function.
It is not meant to be used by anything other than CreateSessionPair.
9 years ago
Subv
ce5bc477ca
Kernel: Remove a now unused enum and variable regarding a session's status.
9 years ago
Subv
ddfabf3133
Kernel: Use a Session object to keep track of the status of a Client/Server session pair.
Reduce the associated port's connection count when a ServerSession is destroyed.
9 years ago
Yuri Kunde Schlesner
f18d454eb6
Kernel: Map special regions according to ExHeader
This replaces the hardcoded VRAM/DSP mappings with ones made based on
the ExHeader ARM11 Kernel caps list. While this has no visible effect
for most applications (since they use a standard set of mappings) it
does improve support for system modules and n3DS exclusives.
9 years ago
Yuri Kunde Schlesner
b4a93cfdde
DSP: Create backing memory for entire DSP RAM
Also move address space mapping out of video_core.
9 years ago
wwylele
85ba60d5ec
Timer: restore missing signaled=true from #2421
9 years ago
B3n30
dcf115778a
Fix log entry in timer::signal ( #2600 )
9 years ago
Mat M
0cb52ee74a
Doxygen: Amend minor issues ( #2593 )
Corrects a few issues with regards to Doxygen documentation, for example:
- Incorrect parameter referencing.
- Missing @param tags.
- Typos in @param tags.
and a few minor other issues.
9 years ago
Yuri Kunde Schlesner
441f8b5a4b
Core: Remove unnecessary include in thread.h
9 years ago
Subv
029a11030e
Timers: Immediately signal the timer if it was started with an initial value of 0.
9 years ago
Subv
1ddff14511
Threads: Check the process' resource limit for the max allowed priority when creating a thread and remove the priority clamping code.
9 years ago
Subv
f2f2572fed
Thread: Added priority range checking to svcSetThreadPriority and removed priority clamping code from Thread::SetPriority.
9 years ago
Subv
fc2266130b
Kernel: Don't attempt to yield execution in SleepThread(0) if there are no available threads to run.
With this we avoid an useless temporary deschedule of the current thread.
9 years ago
Subv
5e2a8ebabf
Kernel: Remove some unused functions.
9 years ago
Subv
933df2606a
Kernel: Removed the priority boost code for starved threads.
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.
9 years ago
Subv
e52ca85711
Kernel: Implemented Pulse event and timers.
Closes #1904
9 years ago
Subv
4251eb26ec
Kernel/Semaphore: Fixed a regression in semaphore waits.
The regression was caused by a missing check in #2260 .
The new behavior is consistent with the real kernel.
9 years ago
Subv
dda4ec93be
Kernel: Add some asserts to enforce the invariants in the scheduler.
9 years ago
Subv
7f1dca8cd2
Kernel: Remove a thread from all of its waiting objects' waiting_threads list when it is awoken.
This fixes a potential bug where threads would not get removed from said list if they awoke after waiting with WaitSynchronizationN with wait_all = false
9 years ago
Subv
fd95b6ee26
Kernel: Remove Thread::wait_objects_index and use wait_objects to hold all the objects that a thread is waiting on.
9 years ago
Subv
cef5f45de2
Kernel: Use different thread statuses when a thread calls 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.
9 years ago
Subv
d3ff5b91e1
Kernel/Mutex: Propagate thread priority changes to other threads inheriting the priority via mutexes
9 years ago
Subv
b6a0355568
Kernel/Mutex: Update a mutex priority when a thread stops waiting on it.
9 years ago
Subv
7abf185390
Kernel/Mutex: Implemented priority inheritance.
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.
9 years ago
Subv
e6a7723f2f
Kernel: Object ShouldWait and Acquire calls now take a thread as a parameter.
This will be useful when implementing mutex priority inheritance.
9 years ago
Subv
38a90882a4
Kernel/Synch: Do not attempt a reschedule on every syscall.
Not all syscalls should cause reschedules, this commit attempts to remedy that, however, it still does not cover all cases.
9 years ago
bunnei
8b1e269e58
ThreadContext: Move from "core" to "arm_interface".
9 years ago
bunnei
e26fbfd1d7
core: Replace "AppCore" nomenclature with just "CPU".
9 years ago
bunnei
4fc8b8229e
core: Remove HLE module, consolidate code & various cleanups.
9 years ago
bunnei
232ef55c1a
core: Consolidate core and system state, remove system module & cleanups.
9 years ago
wwylele
5728e42634
Thread: remove the thread from the thread list when exiting
9 years ago
wwylele
4c9b80cee3
Kernel: remove object's waiting thread if it is dead
9 years ago
Subv
016307ae65
Fixed the codestyle to match our clang-format rules.
9 years ago
Subv
5b1edc6ae7
Fixed the codestyle to match our clang-format rules.
9 years ago
Subv
406907d570
Properly remove a thread from its wait_objects' waitlist when it is awoken by a timeout.
9 years ago
Subv
ebbb55ec8f
Moved the HLE command buffer translation task to ServerSession instead of the HLE handler superclass.
9 years ago
Subv
17b29d8865
WaitSynch: Removed unused variables and reduced SharedPtr copies.
Define a variable with the value of the sync timeout error code.
Use a boost::flat_map instead of an unordered_map to hold the equivalence of objects and wait indices in a WaitSynchN call.
9 years ago
Subv
386112da32
Added a framework for partially handling Session disconnections.
Further implementation will happen in a future commit.
Fixes a regression.
9 years ago
Subv
f9bcf89510
Use std::move where appropriate.
9 years ago
Subv
7cde5b83bc
Use boost remove_erase_if instead of the erase-remove idiom
9 years ago
Subv
1f286b72a1
Improved the algorithm for GetHighestPriorityReadyThread.
9 years ago
Subv
c93c5a72bb
Return an error code when connecting to a saturated port.
The error code was taken from the 3DS kernel.
9 years ago
Subv
00f0c77570
Split SessionRequestHandler::HandleSyncRequest into HandleSyncRequest, TranslateRequest and HandleSyncRequestImpl.
HandleSyncRequest now takes care of calling the command buffer translate function before actually invoking the command handler for HLE services.
9 years ago
Subv
29d809b6e1
Kernel: Remove the Redirection handle type.
9 years ago
Subv
dd8887c8cf
KServerPorts now have an HLE handler "template", which is inherited by all ServerSessions created from it.
9 years ago