Reworking the memory system to not commit 3gb and to properly alloc data.

Now only 512MB is committed on startup. Loaded XEXs are placed into their
required addresses in the 0x8... range. Kernel structures are allocated
from the normal heap like other data. There should no longer be any magical
pointers.
This commit is contained in:
Ben Vanik
2013-05-29 21:00:55 -07:00
parent 61f7f6d28e
commit 6950b21424
5 changed files with 188 additions and 58 deletions

View File

@@ -740,6 +740,16 @@ XECLEANUP:
int xe_xex2_read_image(xe_xex2_ref xex, const uint8_t *xex_addr,
const size_t xex_length, xe_memory_ref memory) {
const xe_xex2_header_t *header = &xex->header;
// Allocate in-place the XEX memory.
uint32_t alloc_result =
xe_memory_heap_alloc(memory, header->exe_address, xex_length, 0);
if (!alloc_result) {
XELOGE("Unable to allocate XEX memory at %.8X-%.8X.",
header->exe_address, xex_length);
return 2;
}
switch (header->file_format_info.compression_type) {
case XEX_COMPRESSION_NONE:
return xe_xex2_read_image_uncompressed(