From: David Lichteblau Date: Thu, 8 Nov 2012 16:04:03 +0000 (+0100) Subject: New types uword_t, sword_t X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=e26e24ac5b2c744fc5104f7123c5ddcf884dca02;p=sbcl.git New types uword_t, sword_t First commit in a series of changes for LLP64 platform support. We have been using `(un)signed long' assuming that it is an integer of the same size as a pointer. On Windows x64 this assumption does not hold, and `(un)signed long long' is required for the same purpose. Code will be updated to use our own types uword_t, sword_t instead, which are defined to be synonyms of uintptr_t and intptr_t, respectively. Note that uword_t is also synonymous with our older type pointer_sized_uint_t, and technically (albeit not conceptually) the same as lispobj. Thanks to Anton Kovalenko. --- diff --git a/src/runtime/gc.h b/src/runtime/gc.h index ff6797d..3b0aea0 100644 --- a/src/runtime/gc.h +++ b/src/runtime/gc.h @@ -17,10 +17,11 @@ #define _GC_H_ #include "sbcl.h" +#include #define PAGE_BYTES BACKEND_PAGE_BYTES -typedef signed long page_index_t; +typedef intptr_t page_index_t; #define PAGE_INDEX_FMT "ld" typedef signed char generation_index_t; diff --git a/src/runtime/runtime.h b/src/runtime/runtime.h index 072f5e4..4d7ab2e 100644 --- a/src/runtime/runtime.h +++ b/src/runtime/runtime.h @@ -205,7 +205,7 @@ typedef unsigned int u32; typedef signed int s32; /* this is an integral type the same length as a machine pointer */ -typedef unsigned long pointer_sized_uint_t ; +typedef uintptr_t pointer_sized_uint_t; #include @@ -215,12 +215,15 @@ typedef pthread_t os_thread_t; typedef pid_t os_thread_t; #endif +typedef uintptr_t uword_t; +typedef intptr_t sword_t; + /* FIXME: we do things this way because of the alpha32 port. once alpha64 has arrived, all this nastiness can go away */ #if 64 == N_WORD_BITS #define LOW_WORD(c) ((pointer_sized_uint_t)c) #define OBJ_FMTX "lx" -typedef unsigned long lispobj; +typedef uintptr_t lispobj; #else #define OBJ_FMTX "x" #define LOW_WORD(c) ((long)(c) & 0xFFFFFFFFL) diff --git a/src/runtime/win32-os.h b/src/runtime/win32-os.h index acc8b10..7f50155 100644 --- a/src/runtime/win32-os.h +++ b/src/runtime/win32-os.h @@ -37,10 +37,6 @@ typedef sem_t os_sem_t; typedef void *siginfo_t; #endif -/* Note: This typedef will moved to runtime.h when AMD64 changes are being - * merged. */ -typedef unsigned long uword_t; - typedef LPVOID os_vm_address_t; typedef uword_t os_vm_size_t; typedef intptr_t os_vm_offset_t;