mirror of
https://github.com/wiiu-env/wut.git
synced 2025-01-06 13:58:18 +01:00
coreinit: Add virtual memory mapping functions.
This commit is contained in:
parent
5ce21d4fdc
commit
524fd9143a
@ -264,10 +264,20 @@ MEMGetNthListObject
|
||||
// coreinit/memory.h
|
||||
OSBlockMove
|
||||
OSBlockSet
|
||||
OSEffectiveToPhysical
|
||||
OSAllocFromSystem
|
||||
OSFreeToSystem
|
||||
|
||||
// coreinit/memorymap.h
|
||||
OSEffectiveToPhysical
|
||||
OSAllocVirtAddr
|
||||
OSFreeVirtAddr
|
||||
OSQueryVirtAddr
|
||||
OSMapMemory
|
||||
OSUnmapMemory
|
||||
OSGetMapVirtAddrRange
|
||||
OSGetAvailPhysAddrRange
|
||||
OSGetDataPhysAddrRange
|
||||
|
||||
// coreinit/messagequeue.h
|
||||
OSInitMessageQueue
|
||||
OSInitMessageQueueEx
|
||||
|
@ -23,9 +23,6 @@ OSBlockSet(void *dst,
|
||||
uint8_t val,
|
||||
uint32_t size);
|
||||
|
||||
uint32_t
|
||||
OSEffectiveToPhysical(void *vaddr);
|
||||
|
||||
void*
|
||||
OSAllocFromSystem(uint32_t size,
|
||||
int align);
|
||||
|
65
include/coreinit/memorymap.h
Normal file
65
include/coreinit/memorymap.h
Normal file
@ -0,0 +1,65 @@
|
||||
#pragma once
|
||||
#include <wut.h>
|
||||
|
||||
/**
|
||||
* \defgroup coreinit_memorymap Memory Map
|
||||
* \ingroup coreinit
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum OSMemoryMapMode
|
||||
{
|
||||
OS_MAP_MEMORY_INVALID = 0,
|
||||
OS_MAP_MEMORY_READ_ONLY = 1,
|
||||
OS_MAP_MEMORY_READ_WRITE = 2,
|
||||
OS_MAP_MEMORY_FREE = 3,
|
||||
OS_MAP_MEMORY_ALLOCATED = 4,
|
||||
} OSMemoryMapMode;
|
||||
|
||||
#define OS_PAGE_SIZE (128 * 1024)
|
||||
|
||||
uint32_t
|
||||
OSEffectiveToPhysical(uint32_t virtualAddress);
|
||||
|
||||
uint32_t
|
||||
OSAllocVirtAddr(uint32_t virtualAddress,
|
||||
uint32_t size,
|
||||
uint32_t align);
|
||||
|
||||
BOOL
|
||||
OSFreeVirtAddr(uint32_t virtualAddress,
|
||||
uint32_t size);
|
||||
|
||||
OSMemoryMapMode
|
||||
OSQueryVirtAddr(uint32_t virtualAddress);
|
||||
|
||||
BOOL
|
||||
OSMapMemory(uint32_t virtualAddress,
|
||||
uint32_t physicalAddress,
|
||||
uint32_t size,
|
||||
OSMemoryMapMode mode);
|
||||
|
||||
BOOL
|
||||
OSUnmapMemory(uint32_t virtualAddress,
|
||||
uint32_t size);
|
||||
|
||||
void
|
||||
OSGetMapVirtAddrRange(uint32_t *outVirtualAddress,
|
||||
uint32_t *outSize);
|
||||
|
||||
void
|
||||
OSGetAvailPhysAddrRange(uint32_t *outPhysicalAddress,
|
||||
uint32_t *outSize);
|
||||
|
||||
void
|
||||
OSGetDataPhysAddrRange(uint32_t *outPhysicalAddress,
|
||||
uint32_t *outSize);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user