diff options
Diffstat (limited to 'src/core/memory.h')
| -rw-r--r-- | src/core/memory.h | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/src/core/memory.h b/src/core/memory.h index cad845385..7d60ccdf1 100644 --- a/src/core/memory.h +++ b/src/core/memory.h | |||
| @@ -22,92 +22,93 @@ const int PAGE_BITS = 12; | |||
| 22 | /// Physical memory regions as seen from the ARM11 | 22 | /// Physical memory regions as seen from the ARM11 |
| 23 | enum : PAddr { | 23 | enum : PAddr { |
| 24 | /// IO register area | 24 | /// IO register area |
| 25 | IO_AREA_PADDR = 0x10100000, | 25 | IO_AREA_PADDR = 0x10100000, |
| 26 | IO_AREA_SIZE = 0x01000000, ///< IO area size (16MB) | 26 | IO_AREA_SIZE = 0x01000000, ///< IO area size (16MB) |
| 27 | IO_AREA_PADDR_END = IO_AREA_PADDR + IO_AREA_SIZE, | 27 | IO_AREA_PADDR_END = IO_AREA_PADDR + IO_AREA_SIZE, |
| 28 | 28 | ||
| 29 | /// MPCore internal memory region | 29 | /// MPCore internal memory region |
| 30 | MPCORE_RAM_PADDR = 0x17E00000, | 30 | MPCORE_RAM_PADDR = 0x17E00000, |
| 31 | MPCORE_RAM_SIZE = 0x00002000, ///< MPCore internal memory size (8KB) | 31 | MPCORE_RAM_SIZE = 0x00002000, ///< MPCore internal memory size (8KB) |
| 32 | MPCORE_RAM_PADDR_END = MPCORE_RAM_PADDR + MPCORE_RAM_SIZE, | 32 | MPCORE_RAM_PADDR_END = MPCORE_RAM_PADDR + MPCORE_RAM_SIZE, |
| 33 | 33 | ||
| 34 | /// Video memory | 34 | /// Video memory |
| 35 | VRAM_PADDR = 0x18000000, | 35 | VRAM_PADDR = 0x18000000, |
| 36 | VRAM_SIZE = 0x00600000, ///< VRAM size (6MB) | 36 | VRAM_SIZE = 0x00600000, ///< VRAM size (6MB) |
| 37 | VRAM_PADDR_END = VRAM_PADDR + VRAM_SIZE, | 37 | VRAM_PADDR_END = VRAM_PADDR + VRAM_SIZE, |
| 38 | 38 | ||
| 39 | /// DSP memory | 39 | /// DSP memory |
| 40 | DSP_RAM_PADDR = 0x1FF00000, | 40 | DSP_RAM_PADDR = 0x1FF00000, |
| 41 | DSP_RAM_SIZE = 0x00080000, ///< DSP memory size (512KB) | 41 | DSP_RAM_SIZE = 0x00080000, ///< DSP memory size (512KB) |
| 42 | DSP_RAM_PADDR_END = DSP_RAM_PADDR + DSP_RAM_SIZE, | 42 | DSP_RAM_PADDR_END = DSP_RAM_PADDR + DSP_RAM_SIZE, |
| 43 | 43 | ||
| 44 | /// AXI WRAM | 44 | /// AXI WRAM |
| 45 | AXI_WRAM_PADDR = 0x1FF80000, | 45 | AXI_WRAM_PADDR = 0x1FF80000, |
| 46 | AXI_WRAM_SIZE = 0x00080000, ///< AXI WRAM size (512KB) | 46 | AXI_WRAM_SIZE = 0x00080000, ///< AXI WRAM size (512KB) |
| 47 | AXI_WRAM_PADDR_END = AXI_WRAM_PADDR + AXI_WRAM_SIZE, | 47 | AXI_WRAM_PADDR_END = AXI_WRAM_PADDR + AXI_WRAM_SIZE, |
| 48 | 48 | ||
| 49 | /// Main FCRAM | 49 | /// Main FCRAM |
| 50 | FCRAM_PADDR = 0x20000000, | 50 | FCRAM_PADDR = 0x20000000, |
| 51 | FCRAM_SIZE = 0x08000000, ///< FCRAM size (128MB) | 51 | FCRAM_SIZE = 0x08000000, ///< FCRAM size (128MB) |
| 52 | FCRAM_PADDR_END = FCRAM_PADDR + FCRAM_SIZE, | 52 | FCRAM_PADDR_END = FCRAM_PADDR + FCRAM_SIZE, |
| 53 | }; | 53 | }; |
| 54 | 54 | ||
| 55 | /// Virtual user-space memory regions | 55 | /// Virtual user-space memory regions |
| 56 | enum : VAddr { | 56 | enum : VAddr { |
| 57 | /// Where the application text, data and bss reside. | 57 | /// Where the application text, data and bss reside. |
| 58 | PROCESS_IMAGE_VADDR = 0x00100000, | 58 | PROCESS_IMAGE_VADDR = 0x00100000, |
| 59 | PROCESS_IMAGE_MAX_SIZE = 0x03F00000, | 59 | PROCESS_IMAGE_MAX_SIZE = 0x03F00000, |
| 60 | PROCESS_IMAGE_VADDR_END = PROCESS_IMAGE_VADDR + PROCESS_IMAGE_MAX_SIZE, | 60 | PROCESS_IMAGE_VADDR_END = PROCESS_IMAGE_VADDR + PROCESS_IMAGE_MAX_SIZE, |
| 61 | 61 | ||
| 62 | /// Area where IPC buffers are mapped onto. | 62 | /// Area where IPC buffers are mapped onto. |
| 63 | IPC_MAPPING_VADDR = 0x04000000, | 63 | IPC_MAPPING_VADDR = 0x04000000, |
| 64 | IPC_MAPPING_SIZE = 0x04000000, | 64 | IPC_MAPPING_SIZE = 0x04000000, |
| 65 | IPC_MAPPING_VADDR_END = IPC_MAPPING_VADDR + IPC_MAPPING_SIZE, | 65 | IPC_MAPPING_VADDR_END = IPC_MAPPING_VADDR + IPC_MAPPING_SIZE, |
| 66 | 66 | ||
| 67 | /// Application heap (includes stack). | 67 | /// Application heap (includes stack). |
| 68 | HEAP_VADDR = 0x08000000, | 68 | HEAP_VADDR = 0x08000000, |
| 69 | HEAP_SIZE = 0x08000000, | 69 | HEAP_SIZE = 0x08000000, |
| 70 | HEAP_VADDR_END = HEAP_VADDR + HEAP_SIZE, | 70 | HEAP_VADDR_END = HEAP_VADDR + HEAP_SIZE, |
| 71 | 71 | ||
| 72 | /// Area where shared memory buffers are mapped onto. | 72 | /// Area where shared memory buffers are mapped onto. |
| 73 | SHARED_MEMORY_VADDR = 0x10000000, | 73 | SHARED_MEMORY_VADDR = 0x10000000, |
| 74 | SHARED_MEMORY_SIZE = 0x04000000, | 74 | SHARED_MEMORY_SIZE = 0x04000000, |
| 75 | SHARED_MEMORY_VADDR_END = SHARED_MEMORY_VADDR + SHARED_MEMORY_SIZE, | 75 | SHARED_MEMORY_VADDR_END = SHARED_MEMORY_VADDR + SHARED_MEMORY_SIZE, |
| 76 | 76 | ||
| 77 | /// Maps 1:1 to an offset in FCRAM. Used for HW allocations that need to be linear in physical memory. | 77 | /// Maps 1:1 to an offset in FCRAM. Used for HW allocations that need to be linear in physical |
| 78 | LINEAR_HEAP_VADDR = 0x14000000, | 78 | /// memory. |
| 79 | LINEAR_HEAP_SIZE = 0x08000000, | 79 | LINEAR_HEAP_VADDR = 0x14000000, |
| 80 | LINEAR_HEAP_SIZE = 0x08000000, | ||
| 80 | LINEAR_HEAP_VADDR_END = LINEAR_HEAP_VADDR + LINEAR_HEAP_SIZE, | 81 | LINEAR_HEAP_VADDR_END = LINEAR_HEAP_VADDR + LINEAR_HEAP_SIZE, |
| 81 | 82 | ||
| 82 | /// Maps 1:1 to the IO register area. | 83 | /// Maps 1:1 to the IO register area. |
| 83 | IO_AREA_VADDR = 0x1EC00000, | 84 | IO_AREA_VADDR = 0x1EC00000, |
| 84 | IO_AREA_VADDR_END = IO_AREA_VADDR + IO_AREA_SIZE, | 85 | IO_AREA_VADDR_END = IO_AREA_VADDR + IO_AREA_SIZE, |
| 85 | 86 | ||
| 86 | /// Maps 1:1 to VRAM. | 87 | /// Maps 1:1 to VRAM. |
| 87 | VRAM_VADDR = 0x1F000000, | 88 | VRAM_VADDR = 0x1F000000, |
| 88 | VRAM_VADDR_END = VRAM_VADDR + VRAM_SIZE, | 89 | VRAM_VADDR_END = VRAM_VADDR + VRAM_SIZE, |
| 89 | 90 | ||
| 90 | /// Maps 1:1 to DSP memory. | 91 | /// Maps 1:1 to DSP memory. |
| 91 | DSP_RAM_VADDR = 0x1FF00000, | 92 | DSP_RAM_VADDR = 0x1FF00000, |
| 92 | DSP_RAM_VADDR_END = DSP_RAM_VADDR + DSP_RAM_SIZE, | 93 | DSP_RAM_VADDR_END = DSP_RAM_VADDR + DSP_RAM_SIZE, |
| 93 | 94 | ||
| 94 | /// Read-only page containing kernel and system configuration values. | 95 | /// Read-only page containing kernel and system configuration values. |
| 95 | CONFIG_MEMORY_VADDR = 0x1FF80000, | 96 | CONFIG_MEMORY_VADDR = 0x1FF80000, |
| 96 | CONFIG_MEMORY_SIZE = 0x00001000, | 97 | CONFIG_MEMORY_SIZE = 0x00001000, |
| 97 | CONFIG_MEMORY_VADDR_END = CONFIG_MEMORY_VADDR + CONFIG_MEMORY_SIZE, | 98 | CONFIG_MEMORY_VADDR_END = CONFIG_MEMORY_VADDR + CONFIG_MEMORY_SIZE, |
| 98 | 99 | ||
| 99 | /// Usually read-only page containing mostly values read from hardware. | 100 | /// Usually read-only page containing mostly values read from hardware. |
| 100 | SHARED_PAGE_VADDR = 0x1FF81000, | 101 | SHARED_PAGE_VADDR = 0x1FF81000, |
| 101 | SHARED_PAGE_SIZE = 0x00001000, | 102 | SHARED_PAGE_SIZE = 0x00001000, |
| 102 | SHARED_PAGE_VADDR_END = SHARED_PAGE_VADDR + SHARED_PAGE_SIZE, | 103 | SHARED_PAGE_VADDR_END = SHARED_PAGE_VADDR + SHARED_PAGE_SIZE, |
| 103 | 104 | ||
| 104 | /// Area where TLS (Thread-Local Storage) buffers are allocated. | 105 | /// Area where TLS (Thread-Local Storage) buffers are allocated. |
| 105 | TLS_AREA_VADDR = 0x1FF82000, | 106 | TLS_AREA_VADDR = 0x1FF82000, |
| 106 | TLS_ENTRY_SIZE = 0x200, | 107 | TLS_ENTRY_SIZE = 0x200, |
| 107 | 108 | ||
| 108 | /// Equivalent to LINEAR_HEAP_VADDR, but expanded to cover the extra memory in the New 3DS. | 109 | /// Equivalent to LINEAR_HEAP_VADDR, but expanded to cover the extra memory in the New 3DS. |
| 109 | NEW_LINEAR_HEAP_VADDR = 0x30000000, | 110 | NEW_LINEAR_HEAP_VADDR = 0x30000000, |
| 110 | NEW_LINEAR_HEAP_SIZE = 0x10000000, | 111 | NEW_LINEAR_HEAP_SIZE = 0x10000000, |
| 111 | NEW_LINEAR_HEAP_VADDR_END = NEW_LINEAR_HEAP_VADDR + NEW_LINEAR_HEAP_SIZE, | 112 | NEW_LINEAR_HEAP_VADDR_END = NEW_LINEAR_HEAP_VADDR + NEW_LINEAR_HEAP_SIZE, |
| 112 | }; | 113 | }; |
| 113 | 114 | ||
| @@ -166,5 +167,4 @@ void RasterizerFlushRegion(PAddr start, u32 size); | |||
| 166 | * Flushes and invalidates any externally cached rasterizer resources touching the given region. | 167 | * Flushes and invalidates any externally cached rasterizer resources touching the given region. |
| 167 | */ | 168 | */ |
| 168 | void RasterizerFlushAndInvalidateRegion(PAddr start, u32 size); | 169 | void RasterizerFlushAndInvalidateRegion(PAddr start, u32 size); |
| 169 | |||
| 170 | } | 170 | } |