diff options
-rw-r--r-- | alloc.c | 2 | ||||
-rw-r--r-- | dyn_load.c | 2 | ||||
-rw-r--r-- | extra/gc.c | 8 | ||||
-rw-r--r-- | include/gc_config_macros.h | 4 | ||||
-rw-r--r-- | include/private/gc_locks.h | 2 | ||||
-rw-r--r-- | include/private/gc_priv.h | 2 | ||||
-rw-r--r-- | include/private/gcconfig.h | 32 | ||||
-rw-r--r-- | include/private/pthread_stop_world.h | 7 | ||||
-rw-r--r-- | mach_dep.c | 4 | ||||
-rw-r--r-- | misc.c | 8 | ||||
-rw-r--r-- | pthread_stop_world.c | 2 |
11 files changed, 39 insertions, 34 deletions
@@ -21,7 +21,7 @@ #include <stdio.h> #if !defined(MACOS) && !defined(MSWINCE) # include <signal.h> -# if !defined(SN_TARGET_ORBIS) && !defined(SN_TARGET_PSP2) \ +# if !defined(GC_NO_TYPES) && !defined(SN_TARGET_PSP2) \ && !defined(__CC_ARM) # include <sys/types.h> # endif @@ -26,7 +26,7 @@ * But then not much of anything is safe in the presence of dlclose. */ -#if !defined(MACOS) && !defined(SN_TARGET_ORBIS) && !defined(SN_TARGET_PSP2) \ +#if !defined(MACOS) && !defined(GC_NO_TYPES) && !defined(SN_TARGET_PSP2) \ && !defined(_WIN32_WCE) && !defined(__CC_ARM) # include <sys/types.h> #endif @@ -67,8 +67,12 @@ #include "../darwin_stop_world.c" #include "../dyn_load.c" #include "../gc_dlopen.c" -#include "../mach_dep.c" -#include "../pthread_stop_world.c" +#if !defined(PLATFORM_MACH_DEP) +# include "../mach_dep.c" +#endif +#if !defined(PLATFORM_STOP_WORLD) +# include "../pthread_stop_world.c" +#endif #include "../pthread_support.c" #include "../specific.c" #include "../win32_threads.c" diff --git a/include/gc_config_macros.h b/include/gc_config_macros.h index 2e03f1a2..129daecd 100644 --- a/include/gc_config_macros.h +++ b/include/gc_config_macros.h @@ -91,8 +91,8 @@ # define GC_HPUX_THREADS # elif defined(__HAIKU__) # define GC_HAIKU_THREADS -# elif defined(__DragonFly__) || defined(__FreeBSD_kernel__) \ - || (defined(__FreeBSD__) && !defined(SN_TARGET_ORBIS)) +# elif (defined(__DragonFly__) || defined(__FreeBSD_kernel__) \ + || defined(__FreeBSD__)) && !defined(GC_NO_FREEBSD) # define GC_FREEBSD_THREADS # elif defined(__NetBSD__) # define GC_NETBSD_THREADS diff --git a/include/private/gc_locks.h b/include/private/gc_locks.h index 4e2a920d..38a5b099 100644 --- a/include/private/gc_locks.h +++ b/include/private/gc_locks.h @@ -53,7 +53,7 @@ # endif # if (!defined(AO_HAVE_test_and_set_acquire) || defined(GC_RTEMS_PTHREADS) \ - || defined(SN_TARGET_ORBIS) || defined(SN_TARGET_PS3) \ + || defined(SN_TARGET_PS3) \ || defined(GC_WIN32_THREADS) || defined(BASE_ATOMIC_OPS_EMULATED) \ || defined(LINT2)) && defined(GC_PTHREADS) # define USE_PTHREAD_LOCKS diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h index eddf46cf..544a8fe1 100644 --- a/include/private/gc_priv.h +++ b/include/private/gc_priv.h @@ -920,7 +920,7 @@ EXTERN_C_BEGIN # if defined(LARGE_CONFIG) || !defined(SMALL_CONFIG) # ifdef ALPHA # define CPP_LOG_HBLKSIZE 13 -# elif defined(SN_TARGET_ORBIS) || defined(SN_TARGET_PSP2) +# elif defined(SN_TARGET_PSP2) # define CPP_LOG_HBLKSIZE 16 /* page size is set to 64 KB */ # else # define CPP_LOG_HBLKSIZE 12 diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h index 9088982f..f6da9382 100644 --- a/include/private/gcconfig.h +++ b/include/private/gcconfig.h @@ -122,7 +122,7 @@ EXTERN_C_BEGIN /* And one for FreeBSD: */ # if (defined(__FreeBSD__) || defined(__DragonFly__) \ || defined(__FreeBSD_kernel__)) && !defined(FREEBSD) \ - && !defined(SN_TARGET_ORBIS) /* Orbis compiler defines __FreeBSD__ */ + && !defined(GC_NO_FREEBSD) /* Orbis compiler defines __FreeBSD__ */ # define FREEBSD # endif @@ -160,7 +160,7 @@ EXTERN_C_BEGIN # elif !defined(LINUX) && !defined(NETBSD) && !defined(FREEBSD) \ && !defined(OPENBSD) && !defined(DARWIN) && !defined(_WIN32) \ && !defined(__CEGCC__) && !defined(NN_PLATFORM_CTR) \ - && !defined(SN_TARGET_ORBIS) && !defined(SN_TARGET_PSP2) \ + && !defined(GC_NO_NOSYS) && !defined(SN_TARGET_PSP2) \ && !defined(SYMBIAN) # define NOSYS # define mach_type_known @@ -481,8 +481,7 @@ EXTERN_C_BEGIN # define I386 # define mach_type_known # endif -# if (defined(FREEBSD) || defined(SN_TARGET_ORBIS)) \ - && (defined(__amd64__) || defined(__x86_64__)) +# if defined(FREEBSD) && (defined(__amd64__) || defined(__x86_64__)) # define X86_64 # define mach_type_known # endif @@ -2589,12 +2588,15 @@ EXTERN_C_BEGIN # ifndef CACHE_LINE_SIZE # define CACHE_LINE_SIZE 64 # endif -# ifdef SN_TARGET_ORBIS -# define OS_TYPE "SN_TARGET_ORBIS" +# ifdef PLATFORM_GETMEM +# define OS_TYPE "PLATFORM_GETMEM" # define DATASTART (ptr_t)ALIGNMENT # define DATAEND (ptr_t)ALIGNMENT - void *ps4_get_stack_bottom(void); -# define STACKBOTTOM ((ptr_t)ps4_get_stack_bottom()) + EXTERN_C_END +# include <pthread.h> + EXTERN_C_BEGIN + void *platform_get_stack_bottom(void); +# define STACKBOTTOM ((ptr_t)platform_get_stack_bottom()) # endif # ifdef OPENBSD # define OS_TYPE "OPENBSD" @@ -3146,7 +3148,7 @@ EXTERN_C_BEGIN /* The platform does not have a virtual paging system, so it does not */ /* have a large virtual address space that a standard x64 platform has. */ #if defined(USE_MUNMAP) && !defined(MUNMAP_THRESHOLD) \ - && (defined(SN_TARGET_ORBIS) || defined(SN_TARGET_PS3) \ + && (defined(SN_TARGET_PS3) \ || defined(SN_TARGET_PSP2) || defined(MSWIN_XBOX1)) # define MUNMAP_THRESHOLD 2 #endif @@ -3334,7 +3336,7 @@ EXTERN_C_BEGIN #if defined(PCR) || defined(GC_WIN32_THREADS) || defined(GC_PTHREADS) \ || ((defined(NN_PLATFORM_CTR) || defined(NINTENDO_SWITCH) \ - || defined(SN_TARGET_ORBIS) || defined(SN_TARGET_PS3) \ + || defined(SN_TARGET_PS3) \ || defined(SN_TARGET_PSP2)) && defined(GC_THREADS)) # define THREADS #endif @@ -3427,8 +3429,8 @@ EXTERN_C_BEGIN #endif #if defined(CAN_HANDLE_FORK) && !defined(CAN_CALL_ATFORK) \ - && !defined(HURD) && !defined(SN_TARGET_ORBIS) && !defined(HOST_TIZEN) \ - && (!defined(HOST_ANDROID) || __ANDROID_API__ >= 21) + && !defined(GC_NO_CAN_CALL_ATFORK) && !defined(HOST_TIZEN) \ + && !defined(HURD) && (!defined(HOST_ANDROID) || __ANDROID_API__ >= 21) /* Have working pthread_atfork(). */ # define CAN_CALL_ATFORK #endif @@ -3664,9 +3666,9 @@ EXTERN_C_BEGIN SIZET_SAT_ADD(bytes, \ GC_page_size)) \ + GC_page_size-1) -# elif defined(SN_TARGET_ORBIS) - void *ps4_get_mem(size_t bytes); -# define GET_MEM(bytes) (struct hblk*)ps4_get_mem(bytes) +# elif defined(PLATFORM_GETMEM) + void *platform_get_mem(size_t bytes); +# define GET_MEM(bytes) (struct hblk*)platform_get_mem(bytes) # elif defined(SN_TARGET_PS3) void *ps3_get_mem(size_t bytes); # define GET_MEM(bytes) (struct hblk*)ps3_get_mem(bytes) diff --git a/include/private/pthread_stop_world.h b/include/private/pthread_stop_world.h index 4192737e..3229bc44 100644 --- a/include/private/pthread_stop_world.h +++ b/include/private/pthread_stop_world.h @@ -22,7 +22,7 @@ EXTERN_C_BEGIN struct thread_stop_info { # if !defined(GC_OPENBSD_UTHREADS) && !defined(NACL) \ - && !defined(SN_TARGET_ORBIS) && !defined(SN_TARGET_PSP2) + && !defined(PLATFORM_STOP_WORLD) && !defined(SN_TARGET_PSP2) volatile AO_t last_stop_count; /* The value of GC_stop_count when the thread */ /* last successfully handled a suspend signal. */ @@ -44,9 +44,8 @@ struct thread_stop_info { # define NACL_GC_REG_STORAGE_SIZE 20 # endif ptr_t reg_storage[NACL_GC_REG_STORAGE_SIZE]; -# elif defined(SN_TARGET_ORBIS) -# define ORBIS_GC_REG_STORAGE_SIZE 27 - word registers[ORBIS_GC_REG_STORAGE_SIZE]; /* used externally */ +# elif defined(PLATFORM_HAVE_GC_REG_STORAGE_SIZE) + word registers[PLATFORM_GC_REG_STORAGE_SIZE]; /* used externally */ # endif }; @@ -14,7 +14,7 @@ #include "private/gc_priv.h" -#if !defined(SN_TARGET_ORBIS) && !defined(SN_TARGET_PSP2) +#if !defined(PLATFORM_MACH_DEP) && !defined(SN_TARGET_PSP2) #include <stdio.h> @@ -339,4 +339,4 @@ GC_INNER void GC_with_callee_saves_pushed(void (*fn)(ptr_t, void *), GC_noop1(COVERT_DATAFLOW(&dummy)); } -#endif /* !SN_TARGET_ORBIS && !SN_TARGET_PSP2 */ +#endif /* !PLATFORM_MACH_DEP && !SN_TARGET_PSP2 */ @@ -49,7 +49,7 @@ GC_INNER PCR_Th_ML GC_allocate_ml; # elif defined(SN_TARGET_PSP2) GC_INNER WapiMutex GC_allocate_ml_PSP2 = { 0, NULL }; -# elif defined(SN_TARGET_ORBIS) || defined(SN_TARGET_PS3) +# elif defined(GC_DEFN_ALLOCATE_ML) || defined(SN_TARGET_PS3) # include <pthread.h> GC_INNER pthread_mutex_t GC_allocate_ml; # endif @@ -1729,7 +1729,7 @@ GC_API void GC_CALL GC_enable_incremental(void) #else -# if !defined(SN_TARGET_ORBIS) && !defined(SN_TARGET_PSP2) +# if !defined(GC_NO_TYPES) && !defined(SN_TARGET_PSP2) # if !defined(AMIGA) && !defined(MSWIN32) && !defined(MSWIN_XBOX1) \ && !defined(__CC_ARM) # include <unistd.h> @@ -1737,11 +1737,11 @@ GC_API void GC_CALL GC_enable_incremental(void) # if !defined(ECOS) && !defined(NOSYS) # include <errno.h> # endif -# endif /* !SN_TARGET_ORBIS && !SN_TARGET_PSP2 */ +# endif /* !GC_NO_TYPES && !SN_TARGET_PSP2 */ STATIC int GC_write(int fd, const char *buf, size_t len) { -# if defined(ECOS) || defined(SN_TARGET_ORBIS) || defined(SN_TARGET_PSP2) \ +# if defined(ECOS) || defined(PLATFORM_WRITE) || defined(SN_TARGET_PSP2) \ || defined(NOSYS) # ifdef ECOS /* FIXME: This seems to be defined nowhere at present. */ diff --git a/pthread_stop_world.c b/pthread_stop_world.c index 1cee6a0b..420ae97d 100644 --- a/pthread_stop_world.c +++ b/pthread_stop_world.c @@ -19,7 +19,7 @@ #include "private/pthread_support.h" #if defined(GC_PTHREADS) && !defined(GC_WIN32_THREADS) && \ - !defined(GC_DARWIN_THREADS) && !defined(SN_TARGET_ORBIS) \ + !defined(GC_DARWIN_THREADS) && !defined(PLATFORM_STOP_WORLD) \ && !defined(SN_TARGET_PSP2) #ifdef NACL |