summaryrefslogtreecommitdiffstats
path: root/src/core/memory.cpp
diff options
context:
space:
mode:
authorfearlessTobi <thm.frey@gmail.com>2018-09-15 15:21:06 +0200
committerfearlessTobi <thm.frey@gmail.com>2018-09-15 15:21:06 +0200
commit63c2e32e207d31ecadd9022e1d7cd705c9febac8 (patch)
tree8a90e8ef2804f147dff7225a543a8740ecf7160c /src/core/memory.cpp
parentMerge pull request #1310 from lioncash/kernel-ns (diff)
downloadyuzu-63c2e32e207d31ecadd9022e1d7cd705c9febac8.tar
yuzu-63c2e32e207d31ecadd9022e1d7cd705c9febac8.tar.gz
yuzu-63c2e32e207d31ecadd9022e1d7cd705c9febac8.tar.bz2
yuzu-63c2e32e207d31ecadd9022e1d7cd705c9febac8.tar.lz
yuzu-63c2e32e207d31ecadd9022e1d7cd705c9febac8.tar.xz
yuzu-63c2e32e207d31ecadd9022e1d7cd705c9febac8.tar.zst
yuzu-63c2e32e207d31ecadd9022e1d7cd705c9febac8.zip
Diffstat (limited to '')
-rw-r--r--src/core/memory.cpp55
1 files changed, 28 insertions, 27 deletions
diff --git a/src/core/memory.cpp b/src/core/memory.cpp
index 0e4e0157c..316b46820 100644
--- a/src/core/memory.cpp
+++ b/src/core/memory.cpp
@@ -370,16 +370,16 @@ u64 Read64(const VAddr addr) {
}
void ReadBlock(const Kernel::Process& process, const VAddr src_addr, void* dest_buffer,
- const size_t size) {
+ const std::size_t size) {
auto& page_table = process.vm_manager.page_table;
- size_t remaining_size = size;
- size_t page_index = src_addr >> PAGE_BITS;
- size_t page_offset = src_addr & PAGE_MASK;
+ std::size_t remaining_size = size;
+ std::size_t page_index = src_addr >> PAGE_BITS;
+ std::size_t page_offset = src_addr & PAGE_MASK;
while (remaining_size > 0) {
- const size_t copy_amount =
- std::min(static_cast<size_t>(PAGE_SIZE) - page_offset, remaining_size);
+ const std::size_t copy_amount =
+ std::min(static_cast<std::size_t>(PAGE_SIZE) - page_offset, remaining_size);
const VAddr current_vaddr = static_cast<VAddr>((page_index << PAGE_BITS) + page_offset);
switch (page_table.attributes[page_index]) {
@@ -414,7 +414,7 @@ void ReadBlock(const Kernel::Process& process, const VAddr src_addr, void* dest_
}
}
-void ReadBlock(const VAddr src_addr, void* dest_buffer, const size_t size) {
+void ReadBlock(const VAddr src_addr, void* dest_buffer, const std::size_t size) {
ReadBlock(*Core::CurrentProcess(), src_addr, dest_buffer, size);
}
@@ -435,15 +435,15 @@ void Write64(const VAddr addr, const u64 data) {
}
void WriteBlock(const Kernel::Process& process, const VAddr dest_addr, const void* src_buffer,
- const size_t size) {
+ const std::size_t size) {
auto& page_table = process.vm_manager.page_table;
- size_t remaining_size = size;
- size_t page_index = dest_addr >> PAGE_BITS;
- size_t page_offset = dest_addr & PAGE_MASK;
+ std::size_t remaining_size = size;
+ std::size_t page_index = dest_addr >> PAGE_BITS;
+ std::size_t page_offset = dest_addr & PAGE_MASK;
while (remaining_size > 0) {
- const size_t copy_amount =
- std::min(static_cast<size_t>(PAGE_SIZE) - page_offset, remaining_size);
+ const std::size_t copy_amount =
+ std::min(static_cast<std::size_t>(PAGE_SIZE) - page_offset, remaining_size);
const VAddr current_vaddr = static_cast<VAddr>((page_index << PAGE_BITS) + page_offset);
switch (page_table.attributes[page_index]) {
@@ -477,19 +477,19 @@ void WriteBlock(const Kernel::Process& process, const VAddr dest_addr, const voi
}
}
-void WriteBlock(const VAddr dest_addr, const void* src_buffer, const size_t size) {
+void WriteBlock(const VAddr dest_addr, const void* src_buffer, const std::size_t size) {
WriteBlock(*Core::CurrentProcess(), dest_addr, src_buffer, size);
}
-void ZeroBlock(const Kernel::Process& process, const VAddr dest_addr, const size_t size) {
+void ZeroBlock(const Kernel::Process& process, const VAddr dest_addr, const std::size_t size) {
auto& page_table = process.vm_manager.page_table;
- size_t remaining_size = size;
- size_t page_index = dest_addr >> PAGE_BITS;
- size_t page_offset = dest_addr & PAGE_MASK;
+ std::size_t remaining_size = size;
+ std::size_t page_index = dest_addr >> PAGE_BITS;
+ std::size_t page_offset = dest_addr & PAGE_MASK;
while (remaining_size > 0) {
- const size_t copy_amount =
- std::min(static_cast<size_t>(PAGE_SIZE) - page_offset, remaining_size);
+ const std::size_t copy_amount =
+ std::min(static_cast<std::size_t>(PAGE_SIZE) - page_offset, remaining_size);
const VAddr current_vaddr = static_cast<VAddr>((page_index << PAGE_BITS) + page_offset);
switch (page_table.attributes[page_index]) {
@@ -522,15 +522,16 @@ void ZeroBlock(const Kernel::Process& process, const VAddr dest_addr, const size
}
}
-void CopyBlock(const Kernel::Process& process, VAddr dest_addr, VAddr src_addr, const size_t size) {
+void CopyBlock(const Kernel::Process& process, VAddr dest_addr, VAddr src_addr,
+ const std::size_t size) {
auto& page_table = process.vm_manager.page_table;
- size_t remaining_size = size;
- size_t page_index = src_addr >> PAGE_BITS;
- size_t page_offset = src_addr & PAGE_MASK;
+ std::size_t remaining_size = size;
+ std::size_t page_index = src_addr >> PAGE_BITS;
+ std::size_t page_offset = src_addr & PAGE_MASK;
while (remaining_size > 0) {
- const size_t copy_amount =
- std::min(static_cast<size_t>(PAGE_SIZE) - page_offset, remaining_size);
+ const std::size_t copy_amount =
+ std::min(static_cast<std::size_t>(PAGE_SIZE) - page_offset, remaining_size);
const VAddr current_vaddr = static_cast<VAddr>((page_index << PAGE_BITS) + page_offset);
switch (page_table.attributes[page_index]) {
@@ -565,7 +566,7 @@ void CopyBlock(const Kernel::Process& process, VAddr dest_addr, VAddr src_addr,
}
}
-void CopyBlock(VAddr dest_addr, VAddr src_addr, size_t size) {
+void CopyBlock(VAddr dest_addr, VAddr src_addr, std::size_t size) {
CopyBlock(*Core::CurrentProcess(), dest_addr, src_addr, size);
}