38 lines
1.8 KiB
C++
38 lines
1.8 KiB
C++
#ifndef CORE_LIBS_PRX_LIBC_INCLUDE_GUESTARENA_HPP
|
|
#define CORE_LIBS_PRX_LIBC_INCLUDE_GUESTARENA_HPP
|
|
|
|
#include <cstddef>
|
|
#include <cstdint>
|
|
|
|
// Guest virtual memory is placed inside one reserved arena below the PS5 application map limit
|
|
// absolute address and breaks on host addresses outside that range.
|
|
namespace GuestArena {
|
|
|
|
extern "C" {
|
|
|
|
bool GuestArenaAvailable_nid_postfix();
|
|
bool GuestArenaContains_nid_postfix(const void* pointer, std::size_t bytes);
|
|
void* GuestArenaAllocate_nid_postfix(std::size_t bytes, std::size_t alignment);
|
|
void GuestArenaMarkUsed_nid_postfix(const void* pointer, std::size_t bytes);
|
|
void GuestArenaRelease_nid_postfix(const void* pointer, std::size_t bytes);
|
|
// The reserved range, and whether it was reserved with page write watching (Windows MEM_WRITE_WATCH).
|
|
void GuestArenaRange_nid_postfix(std::uintptr_t* base, std::size_t* bytes);
|
|
bool GuestArenaWriteWatched_nid_postfix();
|
|
#ifdef _WIN32
|
|
void GuestArenaSetProtection_nid_postfix(std::uintptr_t address, std::size_t bytes, std::uint32_t protection);
|
|
bool GuestArenaHandleWrite_nid_postfix(std::uintptr_t address);
|
|
bool GuestArenaProtection_nid_postfix(std::uintptr_t address, std::uint32_t* protection);
|
|
bool GuestArenaCollectWrites_nid_postfix(std::uintptr_t address, std::size_t bytes, void** pages, std::size_t* count, bool clear);
|
|
void GuestArenaCommit_nid_postfix(void* pointer, std::size_t bytes, std::uint32_t protection, std::size_t granule);
|
|
void GuestArenaReset_nid_postfix(void* pointer, std::size_t bytes);
|
|
void GuestArenaMap_nid_postfix(void* pointer, std::size_t bytes, void* section, std::uint64_t offset, std::uint32_t protection);
|
|
void* GuestArenaMapAlias_nid_postfix(std::uintptr_t address, std::size_t bytes);
|
|
void GuestArenaUnmapAlias_nid_postfix(void* alias);
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|