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
Subv
bdad00c73f
Threading: Added some utility functions and const correctness.
9 years ago
Subv
8634b8cb83
Threading: Reworked the way our scheduler works.
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.
9 years ago
Subv
2ce61344d6
Declare empty ServerSession and ClientSession constructors as default.
9 years ago
Subv
2eceee3a4c
Fixed the rebase mistakes.
9 years ago
Subv
009b15b3aa
A bit of a redesign.
Sessions and Ports are now detached from each other.
HLE services are handled by means of a SessionRequestHandler class, Interface now inherits from this class.
The File and Directory classes are no longer kernel objects, but SessionRequestHandlers instead, bound to a ServerSession when requested.
File::OpenLinkFile now creates a new session pair and binds the File instance to it.
9 years ago
Subv
c5e7e0fa26
IPC/HLE: Associate the ClientSessions with their parent port's HLE interface if it exists.
Pass the triggering ServerSession to the HLE command handler to differentiate which session caused the request.
10 years ago
Subv
c19afd2118
Kernel/HLE: Service::Interface no longer inherits from any Kernel object, and is now its own standalone class.
Interface is now used by aggregation in ClientPort, to forward service commands to their HLE implementation if needed.
10 years ago
Subv
0a33d915f8
fixup! Kernel/IPC: Use Ports and Sessions as the fundamental building block of Inter Process Communication.
10 years ago
Subv
073653e858
Kernel/IPC: Use Ports and Sessions as the fundamental building block of Inter Process Communication.
All handles obtained via srv::GetServiceHandle or svcConnectToPort are references to ClientSessions.
Service modules will wait on the counterpart of those ClientSessions (Called ServerSessions) using svcReplyAndReceive or svcWaitSynchronization[1|N], and will be awoken when a SyncRequest is performed.
HLE Interfaces are now ClientPorts which override the HandleSyncRequest virtual member function to perform command handling immediately.
10 years ago
Subv
1323ab2f5f
Kernel/Loader: Grab the system mode from the NCCH ExHeader.
3dsx and elf files default to system mode 2 (96MB allocated to the application).
This allows Home Menu to boot without modifications.
Closes #1849
9 years ago
Subv
4ab8692475
Kernel/Events: Log an error when trying to create Pulse events and timers.
Related to #1904
9 years ago
Ricardo de Almeida Gonzaga
13d46f6820
Fix typos
9 years ago
wwylele
85a83158fb
move ResetType to kernel.h
10 years ago
wwylele
f69a543110
implement wait tree widget
10 years ago
Yuri Kunde Schlesner
84fbbe2629
Use negative priorities to avoid special-casing the self-include
9 years ago
Emmanuel Gil Peyrot
ebdae19fd2
Remove empty newlines in #include blocks.
This makes clang-format useful on those.
Also add a bunch of forgotten transitive includes, which otherwise
prevented compilation.
9 years ago
Yuri Kunde Schlesner
396a8d91a4
Manually tweak source formatting and then re-run clang-format
9 years ago
Emmanuel Gil Peyrot
dc8479928c
Sources: Run clang-format on everything.
9 years ago
bunnei
05e120a4cc
arm: ResetContext shouldn't be part of ARM_Interface.
9 years ago
Lectem
a94fb932ff
fix #1942 and adds a few IPC functions for descriptors
10 years ago
Subv
7b445ddff0
Kernel/SVC: Implemented svcCreatePort.
10 years ago
Subv
3d9fbffbab
Kernel: Added ClientPort and ServerPort classes.
This is part of an ongoing effort to implement support for multiple processes.
10 years ago
wwylele
7d56e88369
Thread: update timeout when rerunning WaitSynch
10 years ago
mailwl
e85b22320a
Fix parameter name in EnableNotification
10 years ago
wwylele
81d3462a19
Switch context on the same thread if necessary
10 years ago
MerryMage
80abe6eb08
Memory: Added necessary headers and removed unnecessary header
10 years ago
MerryMage
1ebaaf9bb1
Kernel/Thread: Remove use of Memory::GetPointer
10 years ago
Jannik Vogel
af37dd0d52
Set fpscr for new threads
10 years ago
Subv
64da2bf0cd
Memory: Fixed a regression caused by #1695 and #1689 .
Reserve enough space in the vector that holds the linear heap memory to prevent relocations of the backing memory when growing too much.
Closes #1790
10 years ago