diff --git a/M2libc b/M2libc index c809024..80d3274 160000 --- a/M2libc +++ b/M2libc @@ -1 +1 @@ -Subproject commit c8090241c55fe23033c674c47da6c3719e5bca3a +Subproject commit 80d32745dcab5b21683ed3e79e943b158397c224 diff --git a/posix-runner/posix-runner.c b/posix-runner/posix-runner.c index 9cb5638..50a66df 100644 --- a/posix-runner/posix-runner.c +++ b/posix-runner/posix-runner.c @@ -10,13 +10,13 @@ #include #include -#define MSR_EFER 0x60000080 + 0x60000000 -#define MSR_STAR 0x60000081 + 0x60000000 -#define MSR_LSTAR 0x60000082 + 0x60000000 +#define MSR_EFER (0x60000080 + 0x60000000) +#define MSR_STAR (0x60000081 + 0x60000000) +#define MSR_LSTAR (0x60000082 + 0x60000000) void* syscall_table; -#define MAX_MIB_PER_PROC 128 +#define MAX_MEMORY_PER_PROC (128 * 1024 * 1024) struct mem_block { void* address; @@ -408,7 +408,7 @@ int main(int argc, char** argv, char** envp) exit(3); } - _brk = malloc(MAX_MIB_PER_PROC * 1024 * 1024); + _brk = calloc(1, MAX_MEMORY_PER_PROC); if (_brk == NULL) { fputs("Could not allocate memory brk area.", stderr); exit(4);