Commit Graph

122 Commits

Author SHA1 Message Date
246ae84a52 Pretty sure ARM/Thread serialization works now 2020-02-13 17:42:12 +08:00
8abc5525be Added Signals; more runtime fixes 2020-02-13 17:42:09 +08:00
96432589bd Use shared_ptr for PageTable 2020-02-13 17:42:04 +08:00
65d96bf6c1 Changed u8* to MemoryRef 2020-02-13 17:42:00 +08:00
7b846ffa98 clang-format fixes 2020-02-13 17:39:15 +08:00
3e752002c4 Replace g_kernel with Core::Global etc. 2020-02-13 17:38:21 +08:00
4f95575d41 Serialize some more kernel objects 2020-02-13 17:38:18 +08:00
8c81500dee Serialize kernel/hle/memory 2020-02-13 17:38:18 +08:00
c284192a87 Serialize geometry_pipeline 2020-02-13 17:38:17 +08:00
f557d26b40 Added CPU, mutex, process, thread, timer 2020-02-13 17:38:16 +08:00
f79c9668a3 Added shader state; WIP kernel objects 2020-02-13 17:38:10 +08:00
b093d39a27 kernel: Add IPC Recorder to KernelSystem
Refer to the previous commit message for reasons why this is in kernel.
2019-08-20 03:07:26 +08:00
79b837afa7 kernel: Rename memory page table set function 2019-06-27 16:33:55 +02:00
ed095f3bff kernel: Nullability check for current_cpu when changing memory page table
This attempts to fix segfault in some tests where page table is set before initializing cpu core (intended behaviour? might be worth a check...)
see: src/tests/core/arm/arm_test_common.cpp
see: src/tests/core/arm/dyncom/arm_dyncom_vfp_tests.cpp
2019-06-26 11:51:42 +02:00
dbfd830695 kernel: Let the kernel handle all page table changes when switching processes
It will both change the page table in memory and notify the CPU about the change by itself. This way there is no need to call memory.SetCurrentPageTable() when kernel.setCurrentProcess() and the management is kept internally in the kernel
2019-06-26 00:39:11 +02:00
5f11c5f733 Kernel: replace boost::intrusive_ptr with std::shared_ptr 2019-03-24 14:32:11 -04:00
20f47583f6 Kernel: replace usage of Core::System::GetInstance().PrepareReschedule() with callback 2019-02-14 14:04:46 -05:00
eb050b8403 Kernel: replace usage of Core::System::GetInstance()::Timing() 2019-02-14 14:04:46 -05:00
8c618c3fc3 Memory: move PageTable functions into class 2018-12-05 20:16:42 -05:00
8118be6615 Kernel: pass in MemorySystem 2018-12-05 20:16:42 -05:00
fc84091d88 Service, Kernel: move named port list to kernel 2018-11-01 12:56:40 -04:00
ece96807c4 Kernel: move memory_regions into Kernel instance 2018-11-01 12:56:40 -04:00
263290d48c HLE: move SharedPage into Kernel
similar to config_mem, kernel is responsible for setting up this
2018-11-01 12:56:40 -04:00
773ec47629 Kernel: make config_mem and MapSharedPages members of KernelSystem 2018-11-01 12:56:40 -04:00
95790218f2 HLE: move config_mem to kernel
ConfigMem is initialized in kernel and only used by kernel. It is also likely how it works on real 3DS
2018-11-01 11:21:34 -04:00
e5b93741d3 kernel/timer: add TimerManager for timer system states 2018-10-26 16:07:45 -04:00
20ae37ba4f kernel/Thread: move thread list into the manager 2018-10-26 16:07:45 -04:00
7fc61920cc kernel/Thread: move thread wake up table and callback handle into the manager 2018-10-26 16:07:45 -04:00
34f1fe088c kernel/thread: add ThreadManager 2018-10-26 16:07:11 -04:00
eb285c33fd kernel: make handle table per-process 2018-10-22 21:32:34 -04:00
8fb3d8ff38 kernel/process: move current process to kernel instance
Two functional change:
QueryProcessMemory uses the process passed from handle instead current_process
Thread::Stop() uses TLS from owner_process instead of current_process
2018-10-22 21:32:34 -04:00
4238754d8c kernel/process: move next_process_id to kernel instance 2018-10-22 09:30:48 -04:00
751ebe55e9 Kernel: pass ref down to Object and wrap ID counter into kernel state 2018-10-18 21:41:36 -04:00
2a411bb501 Kernel: wrap resource limit state into kernel state; pass ref to resource limit 2018-10-18 21:41:36 -04:00
f446fd1fe5 Kernel: add KernelSystem class 2018-10-18 21:41:00 -04:00
c47e1db46d kernel/object: Tighten object against data races
Despite being covered by a global mutex, we should still ensure that the
class handles its reference counts properly. This avoids potential
shenanigans when it comes to data races.

Given this is the root object that drives quite a bit of the kernel
object hierarchy, ensuring we always have the correct behavior (and no
races) is a good thing.
2018-08-31 00:14:48 +02:00
Ben
b20607dfc6 Add system time configuration (#4043)
* Add setting to switch between a fixed start time and the system time

Add clock settings to SDL

Make clock configureable in qt

Add a SharedPage handler class

Init shared_page_handler for tests
2018-08-26 11:47:45 -06:00
f61141e86a Update the entire application to use the new clang format style 2018-03-09 10:54:43 -07:00
be031989ee Kernel: Move HandleTable to a separate file 2017-05-29 17:34:39 -07:00
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.
2017-05-29 16:16:46 -07:00
2cdb40d709 Kernel: Centralize error definitions in errors.h 2017-05-24 21:06:00 -07:00
dda4ec93be Kernel: Add some asserts to enforce the invariants in the scheduler. 2017-01-05 09:40:18 -05:00
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
2017-01-05 09:40:15 -05:00
fd95b6ee26 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
b6a0355568 Kernel/Mutex: Update a mutex priority when a thread stops waiting on it. 2017-01-04 15:58:47 -05:00
e6a7723f2f 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
4c9b80cee3 Kernel: remove object's waiting thread if it is dead 2016-12-16 12:33:18 +02:00
5b1edc6ae7 Fixed the codestyle to match our clang-format rules. 2016-12-14 12:35:01 -05:00
406907d570 Properly remove a thread from its wait_objects' waitlist when it is awoken by a timeout. 2016-12-10 13:29:31 -05:00
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.
2016-12-09 12:23:09 -05:00