config: automatically determine BIT48
authorBrian Norris <banorris@uci.edu>
Tue, 17 Jul 2012 05:26:25 +0000 (22:26 -0700)
committerBrian Norris <banorris@uci.edu>
Tue, 17 Jul 2012 05:41:05 +0000 (22:41 -0700)
GCC says we can use _LP64, and LLVM (clang) imitates, so this can be
automatically redefined for 32-bit/64-bit architectures.

Also, add config.h to Makefile so it triggers a rebuild. This is still a blunt
mechanism, but it's fine for now.

Makefile
config.h

index a6ec00b972c7458bff7118dcd78075a7a59ae6f1..206d76db4419c32caef12be31da911e313f2759e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -10,7 +10,7 @@ USER_H=libthreads.h libatomic.h
 
 MODEL_CC=libthreads.cc schedule.cc libatomic.cc model.cc threads.cc librace.cc action.cc nodestack.cc clockvector.cc main.cc snapshot-interface.cc cyclegraph.cc datarace.cc
 MODEL_O=libthreads.o schedule.o libatomic.o model.o threads.o librace.o action.o nodestack.o clockvector.o main.o snapshot-interface.o cyclegraph.o datarace.o
-MODEL_H=libthreads.h schedule.h common.h libatomic.h model.h threads.h librace.h action.h nodestack.h clockvector.h snapshot-interface.h cyclegraph.h hashtable.h datarace.h
+MODEL_H=libthreads.h schedule.h common.h libatomic.h model.h threads.h librace.h action.h nodestack.h clockvector.h snapshot-interface.h cyclegraph.h hashtable.h datarace.h config.h
 
 SHMEM_CC=snapshot.cc malloc.c mymemory.cc
 SHMEM_O=snapshot.o malloc.o mymemory.o
index ed305311a2b9e2306f46e88743f0cf6cd8da1f24..62bc92b5a170e49693b47acaf62531d534133b1a 100644 (file)
--- a/config.h
+++ b/config.h
@@ -7,6 +7,14 @@
 
 /** Do we have a 48 bit virtual address (64 bit machine) or 32 bit addresses.
  * Set to 1 for 48-bit, 0 for 32-bit. */
+#ifndef BIT48
+
+#ifdef _LP64
 #define BIT48 1
+#else
+#define BIT48 0
+#endif
+
+#endif /* BIT48 */
 
 #endif