summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/kernel/memory.cpp4
-rw-r--r--src/core/memory.cpp16
-rw-r--r--src/core/memory.h10
-rw-r--r--src/core/memory_setup.h6
4 files changed, 18 insertions, 18 deletions
diff --git a/src/core/hle/kernel/memory.cpp b/src/core/hle/kernel/memory.cpp
index 95d3a6bf6..d990d0569 100644
--- a/src/core/hle/kernel/memory.cpp
+++ b/src/core/hle/kernel/memory.cpp
@@ -69,8 +69,8 @@ void MemoryInit(u32 mem_type) {
// app_mem_malloc does not always match the configured size for memory_region[0]: in case the
// n3DS type override is in effect it reports the size the game expects, not the real one.
config_mem.app_mem_alloc = memory_region_sizes[mem_type][0];
- config_mem.sys_mem_alloc = memory_regions[1].size;
- config_mem.base_mem_alloc = memory_regions[2].size;
+ config_mem.sys_mem_alloc = static_cast<u32_le>(memory_regions[1].size);
+ config_mem.base_mem_alloc = static_cast<u32_le>(memory_regions[2].size);
}
void MemoryShutdown() {
diff --git a/src/core/memory.cpp b/src/core/memory.cpp
index 9a5661a99..93ffe9938 100644
--- a/src/core/memory.cpp
+++ b/src/core/memory.cpp
@@ -37,7 +37,7 @@ PageTable* GetCurrentPageTable() {
return current_page_table;
}
-static void MapPages(PageTable& page_table, VAddr base, u32 size, u8* memory, PageType type) {
+static void MapPages(PageTable& page_table, VAddr base, u64 size, u8* memory, PageType type) {
LOG_DEBUG(HW_Memory, "Mapping %p onto %08X-%08X", memory, base * PAGE_SIZE,
(base + size) * PAGE_SIZE);
@@ -58,13 +58,13 @@ static void MapPages(PageTable& page_table, VAddr base, u32 size, u8* memory, Pa
}
}
-void MapMemoryRegion(PageTable& page_table, VAddr base, u32 size, u8* target) {
+void MapMemoryRegion(PageTable& page_table, VAddr base, u64 size, u8* target) {
ASSERT_MSG((size & PAGE_MASK) == 0, "non-page aligned size: %08X", size);
ASSERT_MSG((base & PAGE_MASK) == 0, "non-page aligned base: %08X", base);
MapPages(page_table, base / PAGE_SIZE, size / PAGE_SIZE, target, PageType::Memory);
}
-void MapIoRegion(PageTable& page_table, VAddr base, u32 size, MMIORegionPointer mmio_handler) {
+void MapIoRegion(PageTable& page_table, VAddr base, u64 size, MMIORegionPointer mmio_handler) {
ASSERT_MSG((size & PAGE_MASK) == 0, "non-page aligned size: %08X", size);
ASSERT_MSG((base & PAGE_MASK) == 0, "non-page aligned base: %08X", base);
MapPages(page_table, base / PAGE_SIZE, size / PAGE_SIZE, nullptr, PageType::Special);
@@ -72,7 +72,7 @@ void MapIoRegion(PageTable& page_table, VAddr base, u32 size, MMIORegionPointer
page_table.special_regions.emplace_back(SpecialRegion{base, size, mmio_handler});
}
-void UnmapRegion(PageTable& page_table, VAddr base, u32 size) {
+void UnmapRegion(PageTable& page_table, VAddr base, u64 size) {
ASSERT_MSG((size & PAGE_MASK) == 0, "non-page aligned size: %08X", size);
ASSERT_MSG((base & PAGE_MASK) == 0, "non-page aligned base: %08X", base);
MapPages(page_table, base / PAGE_SIZE, size / PAGE_SIZE, nullptr, PageType::Unmapped);
@@ -334,7 +334,7 @@ u8* GetPhysicalPointer(PAddr address) {
return target_pointer;
}
-void RasterizerMarkRegionCached(PAddr start, u32 size, int count_delta) {
+void RasterizerMarkRegionCached(PAddr start, u64 size, int count_delta) {
if (start == 0) {
return;
}
@@ -413,13 +413,13 @@ void RasterizerMarkRegionCached(PAddr start, u32 size, int count_delta) {
}
}
-void RasterizerFlushRegion(PAddr start, u32 size) {
+void RasterizerFlushRegion(PAddr start, u64 size) {
if (VideoCore::g_renderer != nullptr) {
VideoCore::g_renderer->Rasterizer()->FlushRegion(start, size);
}
}
-void RasterizerFlushAndInvalidateRegion(PAddr start, u32 size) {
+void RasterizerFlushAndInvalidateRegion(PAddr start, u64 size) {
// Since pages are unmapped on shutdown after video core is shutdown, the renderer may be
// null here
if (VideoCore::g_renderer != nullptr) {
@@ -427,7 +427,7 @@ void RasterizerFlushAndInvalidateRegion(PAddr start, u32 size) {
}
}
-void RasterizerFlushVirtualRegion(VAddr start, u32 size, FlushMode mode) {
+void RasterizerFlushVirtualRegion(VAddr start, u64 size, FlushMode mode) {
// Since pages are unmapped on shutdown after video core is shutdown, the renderer may be
// null here
if (VideoCore::g_renderer != nullptr) {
diff --git a/src/core/memory.h b/src/core/memory.h
index 71ba487fc..91bd4d889 100644
--- a/src/core/memory.h
+++ b/src/core/memory.h
@@ -45,7 +45,7 @@ enum class PageType {
struct SpecialRegion {
VAddr base;
- u32 size;
+ u64 size;
MMIORegionPointer handler;
};
@@ -247,17 +247,17 @@ u8* GetPhysicalPointer(PAddr address);
* Adds the supplied value to the rasterizer resource cache counter of each
* page touching the region.
*/
-void RasterizerMarkRegionCached(PAddr start, u32 size, int count_delta);
+void RasterizerMarkRegionCached(PAddr start, u64 size, int count_delta);
/**
* Flushes any externally cached rasterizer resources touching the given region.
*/
-void RasterizerFlushRegion(PAddr start, u32 size);
+void RasterizerFlushRegion(PAddr start, u64 size);
/**
* Flushes and invalidates any externally cached rasterizer resources touching the given region.
*/
-void RasterizerFlushAndInvalidateRegion(PAddr start, u32 size);
+void RasterizerFlushAndInvalidateRegion(PAddr start, u64 size);
enum class FlushMode {
/// Write back modified surfaces to RAM
@@ -270,6 +270,6 @@ enum class FlushMode {
* Flushes and invalidates any externally cached rasterizer resources touching the given virtual
* address region.
*/
-void RasterizerFlushVirtualRegion(VAddr start, u32 size, FlushMode mode);
+void RasterizerFlushVirtualRegion(VAddr start, u64 size, FlushMode mode);
} // namespace Memory
diff --git a/src/core/memory_setup.h b/src/core/memory_setup.h
index c58baa50b..ff4dcc936 100644
--- a/src/core/memory_setup.h
+++ b/src/core/memory_setup.h
@@ -17,7 +17,7 @@ namespace Memory {
* @param size The amount of bytes to map. Must be page-aligned.
* @param target Buffer with the memory backing the mapping. Must be of length at least `size`.
*/
-void MapMemoryRegion(PageTable& page_table, VAddr base, u32 size, u8* target);
+void MapMemoryRegion(PageTable& page_table, VAddr base, u64 size, u8* target);
/**
* Maps a region of the emulated process address space as a IO region.
@@ -26,7 +26,7 @@ void MapMemoryRegion(PageTable& page_table, VAddr base, u32 size, u8* target);
* @param size The amount of bytes to map. Must be page-aligned.
* @param mmio_handler The handler that backs the mapping.
*/
-void MapIoRegion(PageTable& page_table, VAddr base, u32 size, MMIORegionPointer mmio_handler);
+void MapIoRegion(PageTable& page_table, VAddr base, u64 size, MMIORegionPointer mmio_handler);
-void UnmapRegion(PageTable& page_table, VAddr base, u32 size);
+void UnmapRegion(PageTable& page_table, VAddr base, u64 size);
}