MerryMage
6b8ad273fc
memory: Add GetCurrentPageTable/SetCurrentPageTable
Don't expose Memory::current_page_table as a global.
9 years ago
Subv
9200465e55
Kernel/Threads: Don't clear the CPU instruction cache when performing a context switch from an idle thread into a thread in the same process.
We were unnecessarily clearing the cache when going from Process A -> Idle -> Process A, this caused extreme performance regressions.
9 years ago
Subv
71281c2114
Kernel/Memory: Changed GetPhysicalPointer so that it doesn't go through the current process' page table to obtain a pointer.
9 years ago
Subv
23ad87098d
Kernel/Memory: Switch the current page table when a new process is scheduled.
9 years ago
Subv
36100ec791
Kernel/Memory: Give each Process its own page table.
The loader is in charge of setting the newly created process's page table as the main one during the loading process.
9 years ago
Subv
9cf64ca2cf
Kernel/HLE: Use a mutex to synchronize access to the HLE kernel state between the cpu thread and any other possible threads that might touch the kernel (network thread, etc).
This mutex is acquired in SVC::CallSVC, ie, as soon as the guest application enters the HLE kernel, and should be acquired by the aforementioned threads before modifying kernel structures.
9 years ago
Subv
733dfe220e
Kernel/Threads: Don't immediately switch to the new main thread when loading a new process.
This is necessary for loading multiple processes at the same time.
The main thread will be automatically scheduled when necessary once the scheduler runs.
9 years ago
Subv
f94bd67a0d
Warnings: Add UNREACHABLE macros to switches that contemplate all possible values.
9 years ago
Subv
4a8de6bb00
Kernel/SVC: Pass the current thread as a parameter to ClientSession::SendSyncRequest.
9 years ago
Subv
44f4737f99
Kernel/Sessions: Clean up the list of pending request threads of a session when the client endpoint is closed.
9 years ago
Subv
d7538409fb
Kernel/ServerSession: Keep track of which threads have issued sync requests.
9 years ago
Yuri Kunde Schlesner
afa851d0a4
Kernel: Implement AcceptSession SVC
9 years ago
Yuri Kunde Schlesner
1dd91e371b
Memory: Make PhysicalToVirtualAddress return a boost::optional
And fix a few places in the code to take advantage of that.
9 years ago
Yuri Kunde Schlesner
b3e13d653f
Kernel/IPC: Support translation of null handles
Missed this in my first implementation. Thanks to @wwylele for pointing
out that this was missing.
9 years ago
Yuri Kunde Schlesner
c27dad4cd1
ResultVal: Remove MoveFrom()
Replace it with std::move(result_val).Unwrap(), or Foo().Unwrap() in
case you already have an rvalue.
9 years ago
Yuri Kunde Schlesner
41376f050a
Kernel: Add comment about the extended linear heap area
9 years ago
Yuri Kunde Schlesner
6382e341f8
Kernel/IPC: Make HLERequestContext usable from outside kernel
9 years ago
Yuri Kunde Schlesner
48b7e2b061
Kernel/IPC: Use boost::small_vector for HLE context objects
9 years ago
Yuri Kunde Schlesner
192a95390e
Kernel: Allow clearing request_objects to re-use buffer space
Reduces the necessary allocation to max(in_handles, out_handles) rather
than (in_handles + out_handles).
9 years ago
Yuri Kunde Schlesner
e639024013
Kernel: Basic support for IPC translation for HLE services
9 years ago
Yuri Kunde Schlesner
ccba9e903f
Kernel: Add methods in HLERequestContext abstracting handle creation
9 years ago
Yuri Kunde Schlesner
1e8c1ed676
ServiceFramework: Use separate copy of command buffer
Copy the IPC command buffer to/from the request context before/after the
handler is invoked. This is part of a move away from using global data
for handling IPC requests.
9 years ago
Yuri Kunde Schlesner
5a6d4a2f19
Session: Remove/add some forward declarations
9 years ago
Yuri Kunde Schlesner
82a355b3cd
Kernel: Ensure objects are kept alive during ClientSession disconnection
Fixes #2760
9 years ago
Yuri Kunde Schlesner
0a7f4f531f
Service: Add new ServiceFramework framework for writing HLE services
The old "Interface" class had a few problems such as using free
functions (Which didn't allow you to write the service handler as if it
were a regular class.) which weren't very extensible. (Only received one
parameter with a pointer to the Interface object.)
The new ServiceFramework aims to solve these problems by working with
member functions and passing a generic context struct as parameter. This
struct can be extended in the future without having to update all
existing service implementations.
9 years ago
Yuri Kunde Schlesner
1e267fd653
Kernel: Remove some unnecessary namespace qualifications
9 years ago
Yuri Kunde Schlesner
8a35f3634e
Kernel: Add a dedicated SetHleHandler method to ServerPort/ServerSession
This allows attaching a HLE handle to a ServerPort at any point after it
is created, allowing port/session creation to be generic between HLE and
regular services.
9 years ago
Yuri Kunde Schlesner
41a3feea66
HLE: Move SessionRequestHandler from Service:: to Kernel::
Most of the code that works with this is or will be in the kernel, so
it's a more appropriate place for it to be.
9 years ago
Yuri Kunde Schlesner
ecfda5317e
Kernel: Move HandleTable to a separate file
9 years ago
Yuri Kunde Schlesner
6f662625d3
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
ddbf9cec1b
Kernel: Removed HandleTable::GetWaitObject
This isn't necessary anymore since plain Get works correctly for
WaitObjects.
9 years ago
Yuri Kunde Schlesner
74aa9efe3e
Kernel: Extract dynamic Object pointer cast into its own function
9 years ago
Yuri Kunde Schlesner
467545ed48
Kernel: Centralize error definitions in errors.h
9 years ago
Subv
8e4b05c22a
Kernel/Sessions: Remove the ClientSession::Create function.
It is not meant to be used by anything other than CreateSessionPair.
9 years ago
Subv
f98eb7d315
Kernel: Remove a now unused enum and variable regarding a session's status.
9 years ago
Subv
9c496013b3
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
2668c26a68
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
03ad0ec0e5
DSP: Create backing memory for entire DSP RAM
Also move address space mapping out of video_core.
9 years ago
wwylele
67ead14445
Timer: restore missing signaled=true from #2421
9 years ago
B3n30
3fef6c1b0b
Fix log entry in timer::signal ( #2600 )
9 years ago
Mat M
dc1927a9d1
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
28c24c2c6e
Core: Remove unnecessary include in thread.h
9 years ago
Subv
f814a914b0
Timers: Immediately signal the timer if it was started with an initial value of 0.
9 years ago
Subv
a81290ffb4
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
fbe090645c
Thread: Added priority range checking to svcSetThreadPriority and removed priority clamping code from Thread::SetPriority.
9 years ago
Subv
6c6117868a
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
975f3e0853
Kernel: Remove some unused functions.
9 years ago
Subv
d27ef4a5d3
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
c6ccb7c6f2
Kernel: Implemented Pulse event and timers.
Closes #1904
9 years ago
Subv
f8d98e241d
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