Commit graph

529 commits

Author SHA1 Message Date
Lioncash
469ed4a09f kernel/vm_manager: Convert loop into std::any_of() 2018-08-23 17:53:37 +02:00
Lioncash
c7e1dab45b kernel/vm_manager: Use const where applicable
Makes our immutable state explicit.
2018-08-23 17:53:20 +02:00
Lioncash
bb88c3b7b5 kernel/vm_manager: Use the VAddr type alias in CarveVMA()
These two variables correspond to address ranges.
2018-08-23 17:39:18 +02:00
Merry
44fc338f21
Merge pull request #4083 from zhaowenlan1779/port-yuzu-904
Port "kernel/thread: Minor changes" from yuzu
2018-08-10 21:08:22 +01:00
Lioncash
39d5ada4e1 kernel/thread: Remove unimplemented function prototype
Given there's no implementation, we may as well remove the code
entirely.
2018-08-10 17:05:01 +08:00
Lioncash
596caf70b7 kernel/thread: Make GetFreeThreadLocalSlot()'s loop indices size_t
Avoids using a u32 to compare against a range of size_t, which can be a
source of warnings. While we're at it, compress a std::tie into a
structured binding.
2018-08-10 10:13:50 +08:00
Lioncash
893d9c5ff3 kernel/thread: Make GetFreeThreadLocalSlot() reference parameter a const reference
This function only reads the data being referenced, it doesn't modify
it, so we can turn the reference into a const reference.
2018-08-10 10:13:49 +08:00
Lioncash
c71c9e63ec kernel/thread: Make GetFreeThreadLocalSlot() internally linked
This function isn't used outside of this translation unit, so we can
make it internally linked.
2018-08-10 10:13:48 +08:00
BreadFish64
74cd98ecad core: clean up warnings 2018-08-01 14:10:23 -05:00
Lioncash
8e103d0675
kernel/timer: Make data members private where applicable
Instead, we can just expose functions that return the queryable state
instead of letting anything modify it.
2018-08-01 17:49:52 +08:00
wwylele
0eab948728 reformat all files with clang-format 2018-06-29 16:56:12 +03:00
wwylele
7c5a76e58b log: replace all NGLOG with LOG 2018-06-29 14:18:07 +03:00
NarcolepticK
ed18140daa hle/kernel: Addressed comment about obscure formating 2018-06-23 14:12:54 -04:00
NarcolepticK
d433a07b6b hle/kernel: Fix clang format 2018-06-22 19:20:58 -04:00
NarcolepticK
a8110cfd3f hle/kernel: Migrate logging macros 2018-06-22 18:54:50 -04:00
Daniel Lim Wee Soong
730f8a4103 Fix formatting mistakes 2018-03-28 22:28:55 +08:00
Daniel Lim Wee Soong
20776b37be Fix wrongly converted specifiers
Sorry that was a lot in one go so some of them had some mistakes
2018-03-27 23:37:36 +08:00
Daniel Lim Wee Soong
968569aa61 Replace format specifiers for all usages of ASSERT_MSG 2018-03-27 23:28:42 +08:00
James Rowe
f61141e86a Update the entire application to use the new clang format style 2018-03-09 10:54:43 -07:00
Weiyi Wang
4befbddc34
Merge pull request #3281 from jroweboy/texcache-pt2
Texture Cache Rework
2018-03-05 11:57:25 +02:00
B3n30
98771a6363 GSP_GPU: Release the GPU right if the active session closes the gsp_gpu session 2018-03-01 14:54:38 +01:00
Weiyi Wang
48512d9011
Merge pull request #3101 from Subv/hle_thread_pause2
Kernel/Threads: Add a new thread status that will allow using a Kernel::Event to put a guest thread to sleep inside an HLE handler until said event is signaled
2018-02-22 16:23:34 +02:00
wwylele
42ab8d9d0b HLE: specify that the command buffer is an array of u32_le 2018-02-22 16:12:39 +02:00
Subv
b0f4390247 HLE: Use std::chrono::nanoseconds instead of a plain u64 in SleepClientThread. 2018-02-21 22:03:46 -05:00
wwylele
c4db298a7d
HLE/IPC: remove assertion on empty buffer.
Some service functions do require to push an empty buffer in some cases. See APT:ReceiveParameter/GlanceParameter
2018-02-11 00:09:52 +02:00
bunnei
dca5fd291f
Merge pull request #3272 from MerryMage/dynarmic
core/arm: Backend-specific context implementations
2018-02-02 12:27:52 -08:00
B3n30
33b0b5163f
Merge pull request #3136 from Subv/mem_aliasing1
Kernel/Memory: Added a function to change the memory state of an address range
2018-01-24 10:17:25 +01:00
Subv
a7a5c5aa0d Kernel/IPC: Partially implement MappedBuffer translation.
Right now only MappedBuffers that only span a single page and are not aligned are implemented.

MappedBuffers are unmapped during the reply part of ReplyAndReceive. Only unmapping of ReadOnly buffers is currently implemented.
2018-01-23 08:27:00 -05:00
Subv
928202f744 Kernel/VMManager: Added a function to map a block of memory into the first available address after a given base. 2018-01-23 08:24:15 -05:00
Subv
e4f35f70ac Memory: Added a function to change the memory state of an address range.
This will be useful when implementing memory aliasing operations.
2018-01-23 08:19:47 -05:00
Weiyi Wang
9b647d459b
Merge pull request #3324 from Subv/gspgpu
Services: Keep track of per-session data in GSPGPU
2018-01-11 20:03:46 +02:00
Subv
aa90198ec5 Services: Make SessionDataBase's destructor virtual. 2018-01-03 10:52:46 -05:00
wwylele
7daa2a51d7
Kernel/SVC: fix typo in GetResourceLimitLimitValues 2017-12-30 23:42:32 +02:00
James Rowe
13606a6d0b Memory: Remove count of cached pages and add InvalidateRegion
In a future commit, the count of cached pages will be reintroduced in
the actual surface cache. Also adds an Invalidate only to the cache
which marks a region as invalid in order to try to avoid a costly flush
from 3ds memory
2017-12-23 16:10:25 -07:00
Sebastian Valle
c3c684cd2b
Merge pull request #3301 from Subv/exitprocess2
Kernel/SVC: Partially implemented svcExitProcess.
2017-12-23 10:49:36 -05:00
Subv
1856aa7b32 Kernel/SVC: Partially implemented svcExitProcess.
Terminating processes with ready threads is not currently implemented and will assert. It is currently unknown how the 3DS kernel stops ready threads or threads running in another core.
2017-12-15 15:47:33 -05:00
Subv
daecd812b0 HLE/Services: Allow specifying a SessionData template parameter to ServiceFramework.
Some services can have multiple clients at the same time, and they identify the different clients using the server session as a key.
This parameter (if present) should be a structure that contains the per-session data for each service.
The data can be retrieved using ServiceFramework::GetSessionData(session)
2017-12-14 18:24:02 -05:00
MerryMage
fb2d34997e core/arm: Backend-specific context implementations 2017-12-12 19:12:03 +00:00
Subv
c9ddd5b0ae HLE/FS: Implemented FSFile::OpenSubFile.
The File class now holds a list of connected sessions along with data unique to each session.

A subfile is a window into an existing file. They have a few limitations compared to normal files:

* They can't be written to.
* They can't be flushed.
* Their size can not be changed.
* New subfiles can't be created from another subfile.
2017-12-12 13:34:02 -05:00
Lioncash
c31f932afe common/core: Silence initialization order warnings 2017-12-10 19:50:45 -05:00
B3n30
2146311ad1
Merge pull request #3091 from Subv/hle_request_delat
Kernel/IPC: Add a small delay after each SyncRequest to prevent thread starvation.
2017-12-10 19:59:19 +01:00
Subv
98e3872353 Kernel/IPC: Use 39 microseconds for the SendSyncRequest delay approximation.
As measured by the time it takes for to return when performing the SetLcdForceBlack IPC request to the GSP:GPU service in a n3DS with firmware 11.6

See https://gist.github.com/ds84182/ecdbbd25b56a29bd4e5b32a7544b8e92 for the source code of the test.
2017-12-10 13:00:05 -05:00
Sebastian Valle
2859b98884
Merge pull request #3234 from Subv/dlp2
HLE/FS: Implemented FS::GetProgramLaunchInfo.
2017-12-10 08:58:08 -05:00
Yuri Kunde Schlesner
21188f5683 HLE: Move SVC handlers to the Kernel namespace 2017-12-09 20:32:58 -08:00
Yuri Kunde Schlesner
ad71e23f23 HLE: Move svc.{cpp,h} to kernel/ 2017-12-09 18:10:47 -08:00
Subv
7d038b9bd8 HLE/FS: Implemented FS::GetProgramLaunchInfo.
This function is used by the DLP system module during the DLPSRVR initialization.
2017-12-09 18:46:34 -05:00
Subv
e90daa6a4f Kernel/IPC: Add a small delay after each SyncRequest to prevent thread starvation.
In a real 3DS, threads that call svcSyncRequest are put to sleep until the server responds via svcReplyAndReceive. Our HLE services don't implement this mechanism and are effectively immediate from the 3DS's point of view. This commit makes it so that we at least simulate the IPC delay.

Specific HLE handlers might need to put their callers to sleep for a longer period of time to simulate IO timings. This is their responsibility but doing so is currently not implemented.

See https://gist.github.com/ds84182/4a7690c5376e045cab9129ca4185bbeb for a test that was not passing before this commit.
2017-12-07 22:40:15 -05:00
Subv
8c16b90eae HLE/AddressArbiter: Remove threads that were awoken by timeout from the arbiter's waitlist when using WaitIfLessThanWithTimeout and DecrementAndWaitIfLessThanWithTimeout.
Fixes a regression introduced in #3096
2017-12-06 09:06:45 -05:00
CDAGaming
2052a201c0 Fix Clang Format Error 2017-12-05 14:21:59 -05:00
Subv
3d000c834b Kernel/Threads: Implement an SleepClientThread function for HLERequestContext-based services to make performing async tasks on the host while in an HLE service function easier.
An HLE service function that wants to perform an async operation should put the caller guest thread to sleep using SleepClientThread, passing in a callback to execute when the thread is resumed.
SleepClientThread returns a Kernel::Event that should be signaled to resume the guest thread when the host async operation completes.
2017-12-05 14:21:59 -05:00