Commit Graph

146 Commits

Author SHA1 Message Date
8abc5525be Added Signals; more runtime fixes 2020-02-13 17:42:09 +08:00
116d22d562 Refactor out the wakeup_callback function pointer 2020-02-13 17:42:05 +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
3e752002c4 Replace g_kernel with Core::Global etc. 2020-02-13 17:38:21 +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
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
42535468c3 kernel/server_session: Return a std::pair from CreateSessionPair()
Keeps the return type consistent with the function name. While we're at
it, we can also reduce the amount of boilerplate involved with handling
these by using structured bindings.
2019-04-15 21:46:57 +02:00
1afc2c72d6 kernel/server_port: Return a std::pair from CreatePortPair()
Returns the same type that the function name describes.
2019-04-15 18:42:17 +02:00
05058863b5 cleanup includes 2019-03-26 10:50:41 -04: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
296c458e0e Memory: move GetPhysicalPointer and IsValidPhysicalAddress into class 2018-12-05 20:21:14 -05:00
8118be6615 Kernel: pass in MemorySystem 2018-12-05 20:16:42 -05:00
cfa9a322c7 Kernel/SharedMemory: set and reset source memory state 2018-11-16 00:24:08 -05:00
2067946f59 Kernel: reimplement memory management on physical FCRAM (#4392)
* Kernel: reimplement memory management on physical FCRAM

* Kernel/Process: Unmap does not care the source memory permission

What game usually does is after mapping the memory, they reprotect the source memory as no permission to avoid modification there

* Kernel/SharedMemory: zero initialize new-allocated memory

* Process/Thread: zero new TLS entry

* Kernel: fix a bug where code segments memory usage are accumulated twice

It is added to both misc and heap (done inside HeapAlloc), which results a doubled number reported by svcGetProcessInfo. While we are on it, we just merge the three number misc, heap and linear heap usage together, as there is no where they are distinguished.

Question: is TLS page also added to this number?

* Kernel/SharedMemory: add more object info on mapping error

* Process: lower log level; SharedMemory: store phys offset

* VMManager: add helper function to retrieve backing block list for a range
2018-11-06 15:00:47 -05:00
2d9dfe5bce Kernel: thread manager still has to be destructed first 2018-11-04 09:29:28 -05:00
57e1f47a52 Kernel: destruct thread/timer managers after processes (#4399)
Processes can keep some Thread/Timer object alive while the manager is already destructed, resulting use-after-free in Thread::Stop and Timer::dtor. To resolve this, the manager objects should be destructed after all related object destructed.
Fixes a bug where quiting citra causes crash while the game is using a Timer.
2018-11-04 10:24:37 +01: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
e5b93741d3 kernel/timer: add TimerManager for timer system states 2018-10-26 16:07:45 -04:00
34f1fe088c kernel/thread: add ThreadManager 2018-10-26 16:07:11 -04:00
8ad6cbfde2 kernel/thread: change owner_process parameter to reference
To enforce a valid process object
2018-10-26 09:37:46 -04:00
e5c5d1ecce Kernel: change owner_process in Thread/SharedMemory to raw pointer
Otherwise circular ownership would form in Process->handle_table->thread->owner_process
2018-10-25 19:54:06 -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
d9342622b0 kennel/process: move process list to kernel instance 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
87426b29ff kernel: pass ref to shared memory 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
13c26b4371 Kernel: pass ref to session pair 2018-10-18 21:41:36 -04:00
1213a298df Kernel: pass ref to port 2018-10-18 21:41:36 -04:00
c141657d83 Kernel: pass ref to timer 2018-10-18 21:41:36 -04:00
247249d5d3 Kernel: pass ref to sempahore 2018-10-18 21:41:36 -04:00
d940293d32 Kernel: pass ref to thread 2018-10-18 21:41:36 -04:00
9565091fc2 kernel: pass ref in Process 2018-10-18 21:41:36 -04:00
213b259cf1 kernel: pass ref in CodeSet 2018-10-18 21:41:36 -04:00
7449ba85a6 Kernel: pass ref in Mutex 2018-10-18 21:41:36 -04:00
eec11a94cb Kernel: pass Kernel ref in Event 2018-10-18 21:41:36 -04:00
734be98966 Kernel: pass Kernel reference into AddressArbiter 2018-10-18 21:41:00 -04:00
f446fd1fe5 Kernel: add KernelSystem class 2018-10-18 21:41:00 -04:00
63c7b44ba8 kernel: Move object class to its own source files
General moving to keep kernel object types separate from the direct
kernel code. Also essentially a preliminary cleanup before eliminating
global kernel state in the kernel code.
2018-08-23 17:31:59 +02:00
61442d6afb Merge pull request #2839 from Subv/global_kernel_lock
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).
2017-08-23 18:17:44 -06:00
bca8916cea 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.
2017-08-22 09:30:55 -05:00
65f19b51c4 Warnings: Add UNREACHABLE macros to switches that contemplate all possible values. 2017-08-21 08:34:28 -05:00