mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-26 21:36:27 -05:00
memory: Fix cast for ReadBlock/WriteBlock/ZeroBlock/CopyBlock.
This commit is contained in:
parent
527ce12ce4
commit
d4fb8a887c
1 changed files with 8 additions and 4 deletions
|
@ -439,7 +439,8 @@ void ReadBlock(const Kernel::Process& process, const VAddr src_addr, void* dest_
|
||||||
size_t page_offset = src_addr & PAGE_MASK;
|
size_t page_offset = src_addr & PAGE_MASK;
|
||||||
|
|
||||||
while (remaining_size > 0) {
|
while (remaining_size > 0) {
|
||||||
const size_t copy_amount = std::min(PAGE_SIZE - page_offset, remaining_size);
|
const size_t copy_amount =
|
||||||
|
std::min(static_cast<size_t>(PAGE_SIZE) - page_offset, remaining_size);
|
||||||
const VAddr current_vaddr = static_cast<VAddr>((page_index << PAGE_BITS) + page_offset);
|
const VAddr current_vaddr = static_cast<VAddr>((page_index << PAGE_BITS) + page_offset);
|
||||||
|
|
||||||
switch (page_table.attributes[page_index]) {
|
switch (page_table.attributes[page_index]) {
|
||||||
|
@ -501,7 +502,8 @@ void WriteBlock(const Kernel::Process& process, const VAddr dest_addr, const voi
|
||||||
size_t page_offset = dest_addr & PAGE_MASK;
|
size_t page_offset = dest_addr & PAGE_MASK;
|
||||||
|
|
||||||
while (remaining_size > 0) {
|
while (remaining_size > 0) {
|
||||||
const size_t copy_amount = std::min(PAGE_SIZE - page_offset, remaining_size);
|
const size_t copy_amount =
|
||||||
|
std::min(static_cast<size_t>(PAGE_SIZE) - page_offset, remaining_size);
|
||||||
const VAddr current_vaddr = static_cast<VAddr>((page_index << PAGE_BITS) + page_offset);
|
const VAddr current_vaddr = static_cast<VAddr>((page_index << PAGE_BITS) + page_offset);
|
||||||
|
|
||||||
switch (page_table.attributes[page_index]) {
|
switch (page_table.attributes[page_index]) {
|
||||||
|
@ -548,7 +550,8 @@ void ZeroBlock(const Kernel::Process& process, const VAddr dest_addr, const size
|
||||||
static const std::array<u8, PAGE_SIZE> zeros = {};
|
static const std::array<u8, PAGE_SIZE> zeros = {};
|
||||||
|
|
||||||
while (remaining_size > 0) {
|
while (remaining_size > 0) {
|
||||||
const size_t copy_amount = std::min(PAGE_SIZE - page_offset, remaining_size);
|
const size_t copy_amount =
|
||||||
|
std::min(static_cast<size_t>(PAGE_SIZE) - page_offset, remaining_size);
|
||||||
const VAddr current_vaddr = static_cast<VAddr>((page_index << PAGE_BITS) + page_offset);
|
const VAddr current_vaddr = static_cast<VAddr>((page_index << PAGE_BITS) + page_offset);
|
||||||
|
|
||||||
switch (page_table.attributes[page_index]) {
|
switch (page_table.attributes[page_index]) {
|
||||||
|
@ -587,7 +590,8 @@ void CopyBlock(const Kernel::Process& process, VAddr dest_addr, VAddr src_addr,
|
||||||
size_t page_offset = src_addr & PAGE_MASK;
|
size_t page_offset = src_addr & PAGE_MASK;
|
||||||
|
|
||||||
while (remaining_size > 0) {
|
while (remaining_size > 0) {
|
||||||
const size_t copy_amount = std::min(PAGE_SIZE - page_offset, remaining_size);
|
const size_t copy_amount =
|
||||||
|
std::min(static_cast<size_t>(PAGE_SIZE) - page_offset, remaining_size);
|
||||||
const VAddr current_vaddr = static_cast<VAddr>((page_index << PAGE_BITS) + page_offset);
|
const VAddr current_vaddr = static_cast<VAddr>((page_index << PAGE_BITS) + page_offset);
|
||||||
|
|
||||||
switch (page_table.attributes[page_index]) {
|
switch (page_table.attributes[page_index]) {
|
||||||
|
|
Loading…
Reference in a new issue