From: Julian Seward Date: Thu, 28 Apr 2005 10:32:02 +0000 (+0000) Subject: Define N_PRIMARY_MAP to actually generate a 64-bit constant on 64-bit X-Git-Tag: svn/VALGRIND_3_0_0~738 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e014d5790ab780d24387496ac16c95c5d8a573bb;p=thirdparty%2Fvalgrind.git Define N_PRIMARY_MAP to actually generate a 64-bit constant on 64-bit platforms, otherwise the address-masking operations to establish alignment and primary-mappability are wrong on 64-bit platforms. Also set the size of fast-mapped address space on 64-bit platforms to 16G. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3580 --- diff --git a/memcheck/mc_main.c b/memcheck/mc_main.c index 35b66755f2..a33571c6e3 100644 --- a/memcheck/mc_main.c +++ b/memcheck/mc_main.c @@ -115,10 +115,23 @@ typedef enum { /* --------------- Basic configuration --------------- */ /* Only change this. N_PRIMARY_MAP *must* be a power of 2. */ -#define N_PRIMARY_BITS 16 + +#if VEX_HOST_WORDSIZE == 4 + +/* cover the entire address space */ +# define N_PRIMARY_BITS 16 + +#else + +/* Just handle the first 16G fast and the rest via auxiliary + primaries. */ +# define N_PRIMARY_BITS 18 + +#endif + /* Do not change this. */ -#define N_PRIMARY_MAP (1 << N_PRIMARY_BITS) +#define N_PRIMARY_MAP (1ULL << N_PRIMARY_BITS) /* Do not change this. */ #define MAX_PRIMARY_ADDRESS (Addr)((((Addr)65536) * N_PRIMARY_MAP)-1)