kernel: KPageTable: Rename SetCodeMemoryPermission to SetProcessMemoryPermission

This commit is contained in:
Morph 2021-11-20 20:05:02 -05:00
parent ea6fa044f3
commit 281437c811
4 changed files with 8 additions and 8 deletions

View File

@ -685,8 +685,8 @@ ResultCode KPageTable::UnmapPages(VAddr addr, KPageLinkedList& page_linked_list,
return ResultSuccess; return ResultSuccess;
} }
ResultCode KPageTable::SetCodeMemoryPermission(VAddr addr, std::size_t size, ResultCode KPageTable::SetProcessMemoryPermission(VAddr addr, std::size_t size,
KMemoryPermission perm) { KMemoryPermission perm) {
std::lock_guard lock{page_table_lock}; std::lock_guard lock{page_table_lock};

View File

@ -41,7 +41,7 @@ public:
ResultCode MapPages(VAddr addr, KPageLinkedList& page_linked_list, KMemoryState state, ResultCode MapPages(VAddr addr, KPageLinkedList& page_linked_list, KMemoryState state,
KMemoryPermission perm); KMemoryPermission perm);
ResultCode UnmapPages(VAddr addr, KPageLinkedList& page_linked_list, KMemoryState state); ResultCode UnmapPages(VAddr addr, KPageLinkedList& page_linked_list, KMemoryState state);
ResultCode SetCodeMemoryPermission(VAddr addr, std::size_t size, KMemoryPermission perm); ResultCode SetProcessMemoryPermission(VAddr addr, std::size_t size, KMemoryPermission perm);
KMemoryInfo QueryInfo(VAddr addr); KMemoryInfo QueryInfo(VAddr addr);
ResultCode ReserveTransferMemory(VAddr addr, std::size_t size, KMemoryPermission perm); ResultCode ReserveTransferMemory(VAddr addr, std::size_t size, KMemoryPermission perm);
ResultCode ResetTransferMemory(VAddr addr, std::size_t size); ResultCode ResetTransferMemory(VAddr addr, std::size_t size);

View File

@ -528,7 +528,7 @@ void KProcess::LoadModule(CodeSet code_set, VAddr base_addr) {
std::lock_guard lock{HLE::g_hle_lock}; std::lock_guard lock{HLE::g_hle_lock};
const auto ReprotectSegment = [&](const CodeSet::Segment& segment, const auto ReprotectSegment = [&](const CodeSet::Segment& segment,
KMemoryPermission permission) { KMemoryPermission permission) {
page_table->SetCodeMemoryPermission(segment.addr + base_addr, segment.size, permission); page_table->SetProcessMemoryPermission(segment.addr + base_addr, segment.size, permission);
}; };
kernel.System().Memory().WriteBlock(*this, base_addr, code_set.memory.data(), kernel.System().Memory().WriteBlock(*this, base_addr, code_set.memory.data(),

View File

@ -396,12 +396,12 @@ public:
CopyCode(nro_addr + nro_header.segment_headers[DATA_INDEX].memory_offset, data_start, CopyCode(nro_addr + nro_header.segment_headers[DATA_INDEX].memory_offset, data_start,
nro_header.segment_headers[DATA_INDEX].memory_size); nro_header.segment_headers[DATA_INDEX].memory_size);
CASCADE_CODE(process->PageTable().SetCodeMemoryPermission( CASCADE_CODE(process->PageTable().SetProcessMemoryPermission(
text_start, ro_start - text_start, Kernel::KMemoryPermission::ReadAndExecute)); text_start, ro_start - text_start, Kernel::KMemoryPermission::ReadAndExecute));
CASCADE_CODE(process->PageTable().SetCodeMemoryPermission(ro_start, data_start - ro_start, CASCADE_CODE(process->PageTable().SetProcessMemoryPermission(
Kernel::KMemoryPermission::Read)); ro_start, data_start - ro_start, Kernel::KMemoryPermission::Read));
return process->PageTable().SetCodeMemoryPermission( return process->PageTable().SetProcessMemoryPermission(
data_start, bss_end_addr - data_start, Kernel::KMemoryPermission::ReadAndWrite); data_start, bss_end_addr - data_start, Kernel::KMemoryPermission::ReadAndWrite);
} }