aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/mem_map.h
diff options
context:
space:
mode:
authorGravatar bunnei <ericbunnie@gmail.com>2014-04-24 22:32:26 -0400
committerGravatar bunnei <ericbunnie@gmail.com>2014-04-24 22:32:26 -0400
commitb7cd4c9e90be42476a2e242571d36cbbca2fbd4c (patch)
treeded61f0cc1b93a96226a849388348feca591cfa5 /src/core/mem_map.h
parent66e1f8ab330aca275db686290d9ece5100821c6c (diff)
added functions to map Heap and Shared memory space
Diffstat (limited to 'src/core/mem_map.h')
-rw-r--r--src/core/mem_map.h27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/core/mem_map.h b/src/core/mem_map.h
index ab1eb260..5346d04e 100644
--- a/src/core/mem_map.h
+++ b/src/core/mem_map.h
@@ -22,6 +22,8 @@ enum {
HEAP_GSP_SIZE = 0x02000000, ///< GSP heap size... TODO: Define correctly?
HEAP_SIZE = FCRAM_SIZE, ///< Application heap size
+ SHARED_MEMORY_VADDR = 0x10000000, ///< Shared memory
+
HEAP_PADDR = HEAP_GSP_SIZE,
HEAP_PADDR_END = (HEAP_PADDR + HEAP_SIZE),
HEAP_VADDR = 0x08000000,
@@ -49,10 +51,11 @@ enum {
////////////////////////////////////////////////////////////////////////////////////////////////////
-/// Represents a block of heap memory mapped by ControlMemory
-struct HeapBlock {
- HeapBlock() : base_address(0), address(0), size(0), operation(0), permissions(0) {
+/// Represents a block of memory mapped by ControlMemory/MapMemoryBlock
+struct MemoryBlock {
+ MemoryBlock() : handle(0), base_address(0), address(0), size(0), operation(0), permissions(0) {
}
+ u32 handle;
u32 base_address;
u32 address;
u32 size;
@@ -99,9 +102,25 @@ void Write32(const u32 addr, const u32 data);
u8* GetPointer(const u32 Address);
/**
+ * Maps a block of memory in shared memory
+ * @param handle Handle to map memory block for
+ * @param addr Address to map memory block to
+ * @param permissions Memory map permissions
+ */
+u32 MapBlock_Shared(u32 handle, u32 addr,u32 permissions) ;
+
+/**
+ * Maps a block of memory on the heap
+ * @param size Size of block in bytes
+ * @param operation Memory map operation type
+ * @param flags Memory allocation flags
+ */
+u32 MapBlock_Heap(u32 size, u32 operation, u32 permissions);
+
+/**
* Maps a block of memory on the GSP heap
* @param size Size of block in bytes
- * @param operation Control memory operation
+ * @param operation Memory map operation type
* @param permissions Control memory permissions
*/
u32 MapBlock_HeapGSP(u32 size, u32 operation, u32 permissions);