Protect the first 64kb of virtual memory with no access permissions by default.

This commit is contained in:
Dr. Chat 2016-08-03 18:46:15 -05:00
parent 83f7cc27d1
commit 92859f5a28
1 changed files with 2 additions and 3 deletions

View File

@ -24,8 +24,7 @@
// TODO(benvanik): move xbox.h out
#include "xenia/xbox.h"
DEFINE_bool(protect_zero, false,
"Protect the zero page from reads and writes.");
DEFINE_bool(protect_zero, true, "Protect the zero page from reads and writes.");
DEFINE_bool(protect_on_release, false,
"Protect released memory to prevent accesses.");
@ -172,7 +171,7 @@ bool Memory::Initialize() {
heaps_.vE0000000.Initialize(virtual_membase_, 0xE0000000, 0x1FD00000, 4096,
&heaps_.physical);
// Take the first page at 0 so we can check for writes.
// Protect the first 64kb of memory.
heaps_.v00000000.AllocFixed(
0x00000000, 64 * 1024, 64 * 1024,
kMemoryAllocationReserve | kMemoryAllocationCommit,