From bdb5e29ff19f21a42e85677722e5dba3f9febbb6 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Fri, 20 Aug 2021 14:48:52 -0400 Subject: [PATCH] u3: refactors address layout macros, combines darwin/aarch64 --- pkg/urbit/include/c/portable.h | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/pkg/urbit/include/c/portable.h b/pkg/urbit/include/c/portable.h index 4204769bf..f3edc95b4 100644 --- a/pkg/urbit/include/c/portable.h +++ b/pkg/urbit/include/c/portable.h @@ -104,6 +104,8 @@ # endif /** Address space layout. + *** + *** NB: 2^29 words == 2GB **/ # if defined(U3_OS_linux) # ifdef __LP64__ @@ -115,17 +117,24 @@ # else # define U3_OS_LoomBase 0x36000000 # endif -# define U3_OS_LoomBits 29 // ie, 2^29 words == 2GB -# elif defined(U3_OS_osx) && defined(U3_CPU_aarch64) || defined(U3_OS_mingw) +# define U3_OS_LoomBits 29 +# elif defined(U3_OS_mingw) # define U3_OS_LoomBase 0x28000000000 -# define U3_OS_LoomBits 29 // ie, 2^29 words == 2GB -# elif defined(U3_OS_osx) || defined(U3_OS_bsd) +# define U3_OS_LoomBits 29 +# elif defined(U3_OS_osx) +# ifdef __LP64__ +# define U3_OS_LoomBase 0x28000000000 +# else +# define U3_OS_LoomBase 0x4000000 +# endif +# define U3_OS_LoomBits 29 +# elif defined(U3_OS_bsd) # ifdef __LP64__ # define U3_OS_LoomBase 0x200000000 # else # define U3_OS_LoomBase 0x4000000 # endif -# define U3_OS_LoomBits 29 // ie, 2^29 words == 2GB +# define U3_OS_LoomBits 29 # else # error "port: LoomBase" # endif