Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Unity-Technologies/bdwgc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Cannell <timcannell@unity3d.com>2020-05-28 11:49:34 +0300
committerGitHub <noreply@github.com>2020-05-28 11:49:34 +0300
commitb3a0b72cb3d3c01e62ac7757624e3f862dd970d1 (patch)
treec8093310ecffcbda320070a65f45cbfbb800467e
parent44c4c0a38e0d954e9653185fd4e76ceb71e95828 (diff)
parent59cf806e5e96424e972853a3ee2b22d916caefb5 (diff)
Merge pull request #56 from Unity-Technologies/fix-nda-platforms
Fix nda platforms
-rw-r--r--allchblk.c10
-rw-r--r--alloc.c2
-rw-r--r--dyn_load.c2
-rw-r--r--extra/gc.c4
-rw-r--r--include/gc_config_macros.h7
-rw-r--r--include/private/gc_locks.h2
-rw-r--r--include/private/gc_priv.h2
-rw-r--r--include/private/gcconfig.h28
-rw-r--r--include/private/pthread_stop_world.h5
-rw-r--r--mach_dep.c2
-rw-r--r--misc.c6
11 files changed, 39 insertions, 31 deletions
diff --git a/allchblk.c b/allchblk.c
index 4684ca9f..76b80ac1 100644
--- a/allchblk.c
+++ b/allchblk.c
@@ -411,10 +411,12 @@ GC_INNER void GC_unmap_old(void)
* have a virtual paging system, so it does not have a large virtual address
* space that a standard x64 platform has.
*/
-#if defined(SN_TARGET_PS3) || defined(SN_TARGET_PSP2) || defined(SN_TARGET_ORBIS) || defined(_XBOX_ONE)
-# define UNMAP_THRESHOLD 2
-#else
-# define UNMAP_THRESHOLD 6
+#if !defined(UNMAP_THRESHOLD)
+ #if defined(SN_TARGET_PS3) || defined(SN_TARGET_PSP2) || defined(_XBOX_ONE)
+ # define UNMAP_THRESHOLD 2
+ #else
+ # define UNMAP_THRESHOLD 6
+ #endif
#endif
for (i = 0; i <= N_HBLK_FLS; ++i) {
diff --git a/alloc.c b/alloc.c
index e125e29b..c3562bae 100644
--- a/alloc.c
+++ b/alloc.c
@@ -20,7 +20,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
diff --git a/dyn_load.c b/dyn_load.c
index 6692321c..00ff3f85 100644
--- a/dyn_load.c
+++ b/dyn_load.c
@@ -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
diff --git a/extra/gc.c b/extra/gc.c
index 9a394dca..4eeaf1ea 100644
--- a/extra/gc.c
+++ b/extra/gc.c
@@ -70,8 +70,12 @@
#include "../darwin_stop_world.c"
#include "../dyn_load.c"
#include "../gc_dlopen.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 a043db8d..668f69b0 100644
--- a/include/gc_config_macros.h
+++ b/include/gc_config_macros.h
@@ -70,6 +70,7 @@
# define GC_WIN32_THREADS
#endif
+
#if defined(GC_AIX_THREADS) || defined(GC_DARWIN_THREADS) \
|| defined(GC_DGUX386_THREADS) || defined(GC_FREEBSD_THREADS) \
|| defined(GC_HPUX_THREADS) \
@@ -77,7 +78,7 @@
|| defined(GC_NETBSD_THREADS) || defined(GC_OPENBSD_THREADS) \
|| defined(GC_OSF1_THREADS) || defined(GC_SOLARIS_THREADS) \
|| defined(GC_WIN32_THREADS) || defined(GC_RTEMS_PTHREADS) \
- || defined(SN_TARGET_ORBIS) || defined(SN_TARGET_PSP2)
+ || defined(SN_TARGET_PSP2)
# ifndef GC_THREADS
# define GC_THREADS
# endif
@@ -91,8 +92,8 @@
# define GC_HAIKU_THREADS
# elif defined(__OpenBSD__)
# define GC_OPENBSD_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 3c104192..f4d3e3f3 100644
--- a/include/private/gc_locks.h
+++ b/include/private/gc_locks.h
@@ -48,7 +48,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(LINT2)) && defined(GC_PTHREADS)
# define USE_PTHREAD_LOCKS
# undef USE_SPIN_LOCK
diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h
index 2bd85e3d..9945f1a4 100644
--- a/include/private/gc_priv.h
+++ b/include/private/gc_priv.h
@@ -849,7 +849,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 64K */
# else
# define CPP_LOG_HBLKSIZE 12
diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h
index 7982ce39..cbe3ae9e 100644
--- a/include/private/gcconfig.h
+++ b/include/private/gcconfig.h
@@ -130,7 +130,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)
# define FREEBSD
# endif
@@ -168,7 +168,7 @@ EXTERN_C_BEGIN
&& !defined(OPENBSD) && !defined(DARWIN) && !defined(_WIN32) \
&& !defined(__CEGCC__) && !defined(NN_PLATFORM_CTR) \
&& !defined(NN_BUILD_TARGET_PLATFORM_NX) \
- && !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,7 +481,7 @@ EXTERN_C_BEGIN
# define I386
# define mach_type_known
# endif
-# if (defined(FREEBSD) || defined(SN_TARGET_ORBIS)) \
+# if (defined(FREEBSD)) \
&& (defined(__amd64__) || defined(__x86_64__))
# define X86_64
# define mach_type_known
@@ -2565,14 +2565,14 @@ EXTERN_C_BEGIN
# ifndef CACHE_LINE_SIZE
# define CACHE_LINE_SIZE 64
# endif
-# ifdef SN_TARGET_ORBIS
+# ifdef PLATFORM_GETMEM
# define DATASTART (ptr_t)ALIGNMENT
# define DATAEND (ptr_t)ALIGNMENT
EXTERN_C_END
# include <pthread.h>
EXTERN_C_BEGIN
- void *ps4_get_stack_bottom(void);
-# define STACKBOTTOM ((ptr_t)ps4_get_stack_bottom())
+ void *platform_get_stack_bottom(void);
+# define STACKBOTTOM ((ptr_t)platform_get_stack_bottom())
# endif
# ifdef OPENBSD
# define OS_TYPE "OPENBSD"
@@ -3082,7 +3082,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
@@ -3250,9 +3250,11 @@ 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)
-# define THREADS
+ #if !defined(THREADS)
+ # define THREADS
+ #endif
#endif
#if defined(PARALLEL_MARK) && !defined(THREADS) && !defined(CPPCHECK)
@@ -3339,7 +3341,7 @@ EXTERN_C_BEGIN
#endif
#if defined(CAN_HANDLE_FORK) && !defined(CAN_CALL_ATFORK) \
- && !defined(HURD) && !defined(SN_TARGET_ORBIS) && !defined(HOST_TIZEN) \
+ && !defined(HURD) && !defined(GC_NO_CAN_CALL_ATFORK) && !defined(HOST_TIZEN) \
&& (!defined(HOST_ANDROID) || __ANDROID_API__ >= 21)
/* Have working pthread_atfork(). */
# define CAN_CALL_ATFORK
@@ -3574,9 +3576,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 780c0d9a..fd5d9031 100644
--- a/include/private/pthread_stop_world.h
+++ b/include/private/pthread_stop_world.h
@@ -49,9 +49,8 @@ struct thread_stop_info {
ptr_t reg_storage[NACL_GC_REG_STORAGE_SIZE];
# endif
-#if defined(SN_TARGET_ORBIS)
-# define ORBIS_GC_REG_STORAGE_SIZE 27
- __uint64_t registers[ORBIS_GC_REG_STORAGE_SIZE];
+#if defined(PLATFORM_GC_REG_STORAGE_SIZE)
+ __uint64_t registers[PLATFORM_GC_REG_STORAGE_SIZE];
#endif
};
diff --git a/mach_dep.c b/mach_dep.c
index 1267bbcd..9014c4de 100644
--- a/mach_dep.c
+++ b/mach_dep.c
@@ -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>
diff --git a/misc.c b/misc.c
index e59d78d0..f312352b 100644
--- a/misc.c
+++ b/misc.c
@@ -58,7 +58,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_PTHREAD_MUTEX) || defined(SN_TARGET_PS3)
# include <pthread.h>
GC_INNER pthread_mutex_t GC_allocate_ml;
# endif
@@ -1732,14 +1732,14 @@ GC_API void GC_CALL GC_enable_incremental(void)
# define WRITE(level, buf, len) switch_log_write(buf, len)
#else
-# if !defined(AMIGA) && !defined(MSWIN_XBOX1) && !defined(SN_TARGET_ORBIS) \
+# if !defined(AMIGA) && !defined(MSWIN_XBOX1) && !defined(GC_NO_TYPES) \
&& !defined(SN_TARGET_PSP2) && !defined(__CC_ARM)
# include <unistd.h>
# endif
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. */