Commit graph

227 commits

Author SHA1 Message Date
bunnei
b328c577ef hle: Move SVC code to kernel namespace. 2018-01-02 20:40:30 -05:00
bunnei
add5ad40ad svc: Improve svcGetInfo. 2018-01-01 16:01:06 -05:00
bunnei
7a96dfa16f svc: Fix string formatting for CreateThread. 2018-01-01 15:48:08 -05:00
bunnei
082be53aab svc: Stub out svcWaitSynchronization.
- This does not matter until we implement other kernel objects, mutexes use svcLockMutex for waiting.
2018-01-01 14:47:57 -05:00
bunnei
37d55a0317 svc: Implement svcExitProcess. 2018-01-01 14:38:34 -05:00
bunnei
aec03c0e73 svc: Implement svcUnlockMutex. 2018-01-01 14:04:36 -05:00
bunnei
16c66e09cc svc: Implement svcLockMutex. 2018-01-01 14:02:26 -05:00
bunnei
57d3544f96 thread: Keep track of the initially created handle.
This is kinda crufty, but we need it for now to update guest state variables.
2017-12-31 17:23:36 -05:00
bunnei
a373ba43e4 svc: Implement svcExitThread. 2017-12-31 16:11:27 -05:00
bunnei
c943ab553f svc: Implement svcCreateThread. 2017-12-31 16:10:01 -05:00
bunnei
753ab82242 svc: Cleanup svcGetThreadPriority. 2017-12-31 16:06:11 -05:00
bunnei
647243bd78 svc: Stub out svcGetCurrentProcessorNumber. 2017-12-31 16:01:04 -05:00
bunnei
8c14a2704d svc: Implement svcSetThreadPriority. 2017-12-31 15:58:16 -05:00
bunnei
4564526c43 svc: Change SignalProcessWideKey to a stub. 2017-12-31 15:55:11 -05:00
bunnei
3af6ad6bb9 svc: Implement svcUnmapMemory. 2017-12-31 15:22:49 -05:00
bunnei
f10d490c94 svc: Minor cleanups. 2017-12-30 13:40:28 -05:00
bunnei
7a612ba7dd svc: Implement svcStartThread. 2017-12-30 13:37:07 -05:00
bunnei
8fdafee314 kernel: Add SyncObject primitive, use it for ClientSession. 2017-12-28 23:12:28 -05:00
bunnei
58cf9d847a svc: Implement MapMemory. 2017-12-28 21:38:38 -05:00
bunnei
4678ba1e18 svc: Implement SetHeapSize. 2017-12-28 15:29:52 -05:00
bunnei
bfd01c7c71 svc: Implement GetThreadId and GetProcessId. 2017-10-23 00:15:45 -04:00
bunnei
bf69f3d1eb hle: Fix QueryMemory response for MemoryInfo. 2017-10-19 23:00:46 -04:00
bunnei
2ea8867549 hle: Initial implementation of NX service framework and IPC. 2017-10-14 22:18:42 -04:00
bunnei
0176bad5b2 svc: Some logging cleanup. 2017-10-14 17:35:21 -04:00
bunnei
bdc3ccc8ac svc: Initial nx impl. for QueryMemory, ConnectToPort, SendSyncRequest, etc. 2017-10-14 17:30:07 -04:00
Sebastian Valle
4f7e8c6f1e Merge pull request #2793 from Subv/replyandreceive
Kernel/SVC: Partially implemented svcReplyAndReceive
2017-06-29 17:05:22 -05:00
Subv
4a8de6bb00 Kernel/SVC: Pass the current thread as a parameter to ClientSession::SendSyncRequest. 2017-06-29 12:30:34 -05:00
Subv
820509103c Kernel/SVC: Partially implemented svcReplyAndReceive.
It behaves mostly as WaitSynchronizationN with wait_all = false, except for IPC buffer translation.

The target thread of an IPC response will now wake up when responding.
IPC buffer translation is currently not implemented.
Error passing back to svcSendSyncRequest is currently not implemented.
2017-06-25 23:38:28 -05:00
Yuri Kunde Schlesner
afa851d0a4 Kernel: Implement AcceptSession SVC 2017-06-23 11:26:37 -07:00
Yuri Kunde Schlesner
cf12983372 Kernel: Implement CreateSessionToPort SVC 2017-06-23 11:22:02 -07:00
Yuri Kunde Schlesner
364ef24f77 Kernel: Implement CreateSession SVC 2017-06-22 00:39:27 -07:00
Yuri Kunde Schlesner
ecfda5317e Kernel: Move HandleTable to a separate file 2017-05-29 17:34:39 -07:00
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.
2017-05-29 16:16:46 -07:00
Yuri Kunde Schlesner
ddbf9cec1b Kernel: Removed HandleTable::GetWaitObject
This isn't necessary anymore since plain Get works correctly for
WaitObjects.
2017-05-29 15:10:06 -07:00
Yuri Kunde Schlesner
467545ed48 Kernel: Centralize error definitions in errors.h 2017-05-24 21:06:00 -07:00
Yuri Kunde Schlesner
88fddcbce4 Remove ability to load symbol maps
This was now mostly unused except by thread creation, which used a
symbol of the entrypoint, if available, to name the thread.
2017-05-07 15:33:07 -07:00
Michael Theall
775ae0634e Fix OutputDebugString syscall 2017-04-01 04:09:39 -05:00
Fernando Sahmkow
b302e3e34d Refined thread launch on syscore error messages 2017-03-09 08:18:18 -05:00
Subv
be2b4057e5 Timers: Return an error when calling SetTimer with negative timeouts. 2017-02-21 20:51:56 -05:00
Subv
a81290ffb4 Threads: Check the process' resource limit for the max allowed priority when creating a thread and remove the priority clamping code. 2017-01-11 16:38:05 -05:00
Subv
fbe090645c Thread: Added priority range checking to svcSetThreadPriority and removed priority clamping code from Thread::SetPriority. 2017-01-11 16:38:04 -05:00
bunnei
961bb24cf9 Merge pull request #2410 from Subv/sleepthread
Don't yield execution in SleepThread(0) if there are no available threads to run
2017-01-06 22:01:33 -05:00
Hyper
82ed89eec2 Kernel: Fix SharedMemory objects always returning error when addr = 0 (#2404)
Closes #2400
2017-01-06 08:21:22 -05:00
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.
2017-01-05 19:11:34 -05:00
Subv
3ce2c24665 Kernel: Remove Thread::wait_objects_index and use wait_objects to hold all the objects that a thread is waiting on. 2017-01-05 09:40:14 -05:00
Subv
bcad1d6f12 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.
2017-01-04 15:58:50 -05:00
Subv
8503e56689 Kernel/Mutex: Propagate thread priority changes to other threads inheriting the priority via mutexes 2017-01-04 15:58:48 -05:00
Subv
d33885b60b Kernel/Mutex: Update a mutex priority when a thread stops waiting on it. 2017-01-04 15:58:47 -05:00
Subv
4e6369d41d 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.
2017-01-04 15:58:46 -05:00
Subv
90570c153b Kernel: Object ShouldWait and Acquire calls now take a thread as a parameter.
This will be useful when implementing mutex priority inheritance.
2017-01-04 15:58:45 -05:00