kern: refactor to use m_ for member variables

This commit is contained in:
Michael Scire 2020-12-17 17:18:47 -08:00 committed by SciresM
parent 0bf2ade76f
commit 968f50bc07
135 changed files with 3727 additions and 3734 deletions

View file

@ -21,9 +21,9 @@ namespace ams::kern {
MESOSPHERE_ASSERT_THIS();
/* Set members. */
this->owner_process_id = owner->GetId();
this->owner_perm = own_perm;
this->remote_perm = rem_perm;
m_owner_process_id = owner->GetId();
m_owner_perm = own_perm;
m_remote_perm = rem_perm;
/* Get the number of pages. */
const size_t num_pages = util::DivideUp(size, PageSize);
@ -37,20 +37,20 @@ namespace ams::kern {
R_UNLESS(memory_reservation.Succeeded(), svc::ResultLimitReached());
/* Allocate the memory. */
R_TRY(Kernel::GetMemoryManager().AllocateAndOpen(std::addressof(this->page_group), num_pages, owner->GetAllocateOption()));
R_TRY(Kernel::GetMemoryManager().AllocateAndOpen(std::addressof(m_page_group), num_pages, owner->GetAllocateOption()));
/* Commit our reservation. */
memory_reservation.Commit();
/* Set our resource limit. */
this->resource_limit = reslimit;
this->resource_limit->Open();
m_resource_limit = reslimit;
m_resource_limit->Open();
/* Mark initialized. */
this->is_initialized = true;
m_is_initialized = true;
/* Clear all pages in the memory. */
for (const auto &block : this->page_group) {
for (const auto &block : m_page_group) {
std::memset(GetVoidPointer(block.GetAddress()), 0, block.GetSize());
}
@ -61,16 +61,16 @@ namespace ams::kern {
MESOSPHERE_ASSERT_THIS();
/* Get the number of pages. */
const size_t num_pages = this->page_group.GetNumPages();
const size_t num_pages = m_page_group.GetNumPages();
const size_t size = num_pages * PageSize;
/* Close and finalize the page group. */
this->page_group.Close();
this->page_group.Finalize();
m_page_group.Close();
m_page_group.Finalize();
/* Release the memory reservation. */
this->resource_limit->Release(ams::svc::LimitableResource_PhysicalMemoryMax, size);
this->resource_limit->Close();
m_resource_limit->Release(ams::svc::LimitableResource_PhysicalMemoryMax, size);
m_resource_limit->Close();
/* Perform inherited finalization. */
KAutoObjectWithSlabHeapAndContainer<KSharedMemory, KAutoObjectWithList>::Finalize();
@ -80,10 +80,10 @@ namespace ams::kern {
MESOSPHERE_ASSERT_THIS();
/* Validate the size. */
R_UNLESS(this->page_group.GetNumPages() == util::DivideUp(size, PageSize), svc::ResultInvalidSize());
R_UNLESS(m_page_group.GetNumPages() == util::DivideUp(size, PageSize), svc::ResultInvalidSize());
/* Validate the permission. */
const ams::svc::MemoryPermission test_perm = (process->GetId() == this->owner_process_id) ? this->owner_perm : this->remote_perm;
const ams::svc::MemoryPermission test_perm = (process->GetId() == m_owner_process_id) ? m_owner_perm : m_remote_perm;
if (test_perm == ams::svc::MemoryPermission_DontCare) {
MESOSPHERE_ASSERT(map_perm == ams::svc::MemoryPermission_Read || map_perm == ams::svc::MemoryPermission_ReadWrite);
} else {
@ -91,7 +91,7 @@ namespace ams::kern {
}
/* Map the memory. */
return table->MapPageGroup(address, this->page_group, KMemoryState_Shared, ConvertToKMemoryPermission(map_perm));
return table->MapPageGroup(address, m_page_group, KMemoryState_Shared, ConvertToKMemoryPermission(map_perm));
}
Result KSharedMemory::Unmap(KProcessPageTable *table, KProcessAddress address, size_t size, KProcess *process) {
@ -99,10 +99,10 @@ namespace ams::kern {
MESOSPHERE_UNUSED(process);
/* Validate the size. */
R_UNLESS(this->page_group.GetNumPages() == util::DivideUp(size, PageSize), svc::ResultInvalidSize());
R_UNLESS(m_page_group.GetNumPages() == util::DivideUp(size, PageSize), svc::ResultInvalidSize());
/* Unmap the memory. */
return table->UnmapPageGroup(address, this->page_group, KMemoryState_Shared);
return table->UnmapPageGroup(address, m_page_group, KMemoryState_Shared);
}
}