From ff8e196057df17d834e895352aba521bd4a545fb Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Mon, 27 Jun 2011 15:57:53 -0700 Subject: [PATCH] Builds and runs on Mac OS 10.6.7 --- riscv/sim.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/riscv/sim.cc b/riscv/sim.cc index 85d0995..65125e4 100644 --- a/riscv/sim.cc +++ b/riscv/sim.cc @@ -6,6 +6,10 @@ #include #include +#ifdef __linux__ +# define mmap mmap64 +#endif + sim_t::sim_t(int _nprocs, htif_t* _htif) : htif(_htif), procs(_nprocs), @@ -19,12 +23,12 @@ sim_t::sim_t(int _nprocs, htif_t* _htif) memsz0 = memsz0/quantum*quantum; memsz = memsz0; - mem = (char*)mmap64(NULL, memsz, PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0); + mem = (char*)mmap(NULL, memsz, PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0); if(mem == MAP_FAILED) { while(mem == MAP_FAILED && (memsz = memsz*10/11/quantum*quantum)) - mem = (char*)mmap64(NULL, memsz, PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0); + mem = (char*)mmap(NULL, memsz, PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0); assert(mem != MAP_FAILED); fprintf(stderr, "warning: only got %lu bytes of target mem (wanted %lu)\n", (unsigned long)memsz, (unsigned long)memsz0); -- 2.30.2