This is used by svcControlProcessMemory and maps memory as Locked/AliasCode pair.
Also fixed a bug where map didn't apply specified permissions to the alias memory
* 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
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.
Fix a warning where class definition and forward declaration mismatch. CodeSet is a kernel object and have ctor/dtor/private members like others, so in convention it should be a class
* Initial implementation
* Various fixes and new features
* Address some review comments
* Fixes
* Address more comments
* Use g_hle_lock
* Add more state checking, remove unneeded include
* Minor changes
Two functional change:
QueryProcessMemory uses the process passed from handle instead current_process
Thread::Stop() uses TLS from owner_process instead of current_process
This should be using the process instance retrieved within the function,
and not g_current_process, otherwise this is potentially comparing
iterators from unrelated vma_map instances (which is undefined
behavior).