summaryrefslogtreecommitdiff
path: root/src/core/memory.h
diff options
context:
space:
mode:
authorGravatar Lioncash2018-09-24 20:01:45 -0400
committerGravatar Lioncash2018-09-24 22:16:03 -0400
commit83377113bfe7791483a1b67e06dd0f51620c04ec (patch)
treed766a2d2f20d247e8663c1a76d5c41fcf7f643d4 /src/core/memory.h
parentsvc: Report correct memory-related values within some of the cases in svcGetI... (diff)
downloadyuzu-83377113bfe7791483a1b67e06dd0f51620c04ec.tar.gz
yuzu-83377113bfe7791483a1b67e06dd0f51620c04ec.tar.xz
yuzu-83377113bfe7791483a1b67e06dd0f51620c04ec.zip
memory: Dehardcode the use of fixed memory range constants
The locations of these can actually vary depending on the address space layout, so we shouldn't be using these when determining where to map memory or be using them as offsets for calculations. This keeps all the memory ranges flexible and malleable based off of the virtual memory manager instance state.
Diffstat (limited to 'src/core/memory.h')
-rw-r--r--src/core/memory.h31
1 files changed, 1 insertions, 30 deletions
diff --git a/src/core/memory.h b/src/core/memory.h
index 739e5be94..1acf5ce8c 100644
--- a/src/core/memory.h
+++ b/src/core/memory.h
@@ -93,11 +93,6 @@ struct PageTable {
93 93
94/// Virtual user-space memory regions 94/// Virtual user-space memory regions
95enum : VAddr { 95enum : VAddr {
96 /// Where the application text, data and bss reside.
97 PROCESS_IMAGE_VADDR = 0x08000000,
98 PROCESS_IMAGE_MAX_SIZE = 0x08000000,
99 PROCESS_IMAGE_VADDR_END = PROCESS_IMAGE_VADDR + PROCESS_IMAGE_MAX_SIZE,
100
101 /// Read-only page containing kernel and system configuration values. 96 /// Read-only page containing kernel and system configuration values.
102 CONFIG_MEMORY_VADDR = 0x1FF80000, 97 CONFIG_MEMORY_VADDR = 0x1FF80000,
103 CONFIG_MEMORY_SIZE = 0x00001000, 98 CONFIG_MEMORY_SIZE = 0x00001000,
@@ -108,36 +103,12 @@ enum : VAddr {
108 SHARED_PAGE_SIZE = 0x00001000, 103 SHARED_PAGE_SIZE = 0x00001000,
109 SHARED_PAGE_VADDR_END = SHARED_PAGE_VADDR + SHARED_PAGE_SIZE, 104 SHARED_PAGE_VADDR_END = SHARED_PAGE_VADDR + SHARED_PAGE_SIZE,
110 105
111 /// Area where TLS (Thread-Local Storage) buffers are allocated. 106 /// TLS (Thread-Local Storage) related.
112 TLS_AREA_VADDR = 0x40000000,
113 TLS_ENTRY_SIZE = 0x200, 107 TLS_ENTRY_SIZE = 0x200,
114 TLS_AREA_SIZE = 0x10000000,
115 TLS_AREA_VADDR_END = TLS_AREA_VADDR + TLS_AREA_SIZE,
116 108
117 /// Application stack 109 /// Application stack
118 STACK_AREA_VADDR = TLS_AREA_VADDR_END,
119 STACK_AREA_SIZE = 0x10000000,
120 STACK_AREA_VADDR_END = STACK_AREA_VADDR + STACK_AREA_SIZE,
121 DEFAULT_STACK_SIZE = 0x100000, 110 DEFAULT_STACK_SIZE = 0x100000,
122 111
123 /// Application heap
124 /// Size is confirmed to be a static value on fw 3.0.0
125 HEAP_VADDR = 0x108000000,
126 HEAP_SIZE = 0x180000000,
127 HEAP_VADDR_END = HEAP_VADDR + HEAP_SIZE,
128
129 /// New map region
130 /// Size is confirmed to be a static value on fw 3.0.0
131 NEW_MAP_REGION_VADDR = HEAP_VADDR_END,
132 NEW_MAP_REGION_SIZE = 0x80000000,
133 NEW_MAP_REGION_VADDR_END = NEW_MAP_REGION_VADDR + NEW_MAP_REGION_SIZE,
134
135 /// Map region
136 /// Size is confirmed to be a static value on fw 3.0.0
137 MAP_REGION_VADDR = NEW_MAP_REGION_VADDR_END,
138 MAP_REGION_SIZE = 0x1000000000,
139 MAP_REGION_VADDR_END = MAP_REGION_VADDR + MAP_REGION_SIZE,
140
141 /// Kernel Virtual Address Range 112 /// Kernel Virtual Address Range
142 KERNEL_REGION_VADDR = 0xFFFFFF8000000000, 113 KERNEL_REGION_VADDR = 0xFFFFFF8000000000,
143 KERNEL_REGION_SIZE = 0x7FFFE00000, 114 KERNEL_REGION_SIZE = 0x7FFFE00000,