2015-05-13 08:08:56 +05:30
|
|
|
// Copyright 2015 Citra Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "common/common_types.h"
|
2016-05-26 23:23:30 +05:30
|
|
|
#include "core/mmio.h"
|
2015-05-21 09:07:07 +05:30
|
|
|
|
2015-05-13 08:08:56 +05:30
|
|
|
namespace Memory {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Maps an allocated buffer onto a region of the emulated process address space.
|
|
|
|
*
|
2017-07-22 07:47:57 +05:30
|
|
|
* @param page_table The page table of the emulated process.
|
2015-05-13 08:08:56 +05:30
|
|
|
* @param base The address to start mapping at. Must be page-aligned.
|
|
|
|
* @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`.
|
|
|
|
*/
|
2017-07-22 07:47:57 +05:30
|
|
|
void MapMemoryRegion(PageTable& page_table, VAddr base, u32 size, u8* target);
|
2015-05-13 08:08:56 +05:30
|
|
|
|
|
|
|
/**
|
|
|
|
* Maps a region of the emulated process address space as a IO region.
|
2017-07-22 07:47:57 +05:30
|
|
|
* @param page_table The page table of the emulated process.
|
2016-01-31 00:11:04 +05:30
|
|
|
* @param base The address to start mapping at. Must be page-aligned.
|
|
|
|
* @param size The amount of bytes to map. Must be page-aligned.
|
|
|
|
* @param mmio_handler The handler that backs the mapping.
|
2015-05-13 08:08:56 +05:30
|
|
|
*/
|
2017-07-22 07:47:57 +05:30
|
|
|
void MapIoRegion(PageTable& page_table, VAddr base, u32 size, MMIORegionPointer mmio_handler);
|
2015-05-13 08:08:56 +05:30
|
|
|
|
2017-07-22 07:47:57 +05:30
|
|
|
void UnmapRegion(PageTable& page_table, VAddr base, u32 size);
|
2018-03-09 23:24:43 +05:30
|
|
|
} // namespace Memory
|