memory_setup.h 1012 B

1234567891011121314151617181920212223242526272829303132
  1. // Copyright 2015 Citra Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include "common/common_types.h"
  6. #include "core/mmio.h"
  7. namespace Memory {
  8. void InitMemoryMap();
  9. /**
  10. * Maps an allocated buffer onto a region of the emulated process address space.
  11. *
  12. * @param base The address to start mapping at. Must be page-aligned.
  13. * @param size The amount of bytes to map. Must be page-aligned.
  14. * @param target Buffer with the memory backing the mapping. Must be of length at least `size`.
  15. */
  16. void MapMemoryRegion(VAddr base, u32 size, u8* target);
  17. /**
  18. * Maps a region of the emulated process address space as a IO region.
  19. * @param base The address to start mapping at. Must be page-aligned.
  20. * @param size The amount of bytes to map. Must be page-aligned.
  21. * @param mmio_handler The handler that backs the mapping.
  22. */
  23. void MapIoRegion(VAddr base, u32 size, MMIORegionPointer mmio_handler);
  24. void UnmapRegion(VAddr base, u32 size);
  25. }