mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-23 11:16:57 -04:00
kern: use KScopedLightLockPair helper for page table pair-locks
This commit is contained in:
parent
60b5bd73b7
commit
85f9355184
2 changed files with 83 additions and 64 deletions
|
@ -301,9 +301,22 @@ namespace ams::kern {
|
|||
void CleanupForIpcClientOnServerSetupFailure(PageLinkedList *page_list, KProcessAddress address, size_t size, KMemoryPermission prot_perm);
|
||||
|
||||
size_t GetSize(KMemoryState state) const;
|
||||
|
||||
ALWAYS_INLINE bool GetPhysicalAddressLocked(KPhysicalAddress *out, KProcessAddress virt_addr) const {
|
||||
/* Validate pre-conditions. */
|
||||
MESOSPHERE_AUDIT(this->IsLockedByCurrentThread());
|
||||
|
||||
return this->GetImpl().GetPhysicalAddress(out, virt_addr);
|
||||
}
|
||||
public:
|
||||
bool GetPhysicalAddress(KPhysicalAddress *out, KProcessAddress virt_addr) const {
|
||||
return this->GetImpl().GetPhysicalAddress(out, virt_addr);
|
||||
/* Validate pre-conditions. */
|
||||
MESOSPHERE_AUDIT(!this->IsLockedByCurrentThread());
|
||||
|
||||
/* Acquire exclusive access to the table while doing address translation. */
|
||||
KScopedLightLock lk(m_general_lock);
|
||||
|
||||
return this->GetPhysicalAddressLocked(out, virt_addr);
|
||||
}
|
||||
|
||||
KBlockInfoManager *GetBlockInfoManager() const { return m_block_info_manager; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue