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:
authortimcannell <timcannell@unity3d.com>2020-02-29 20:14:18 +0300
committertimcannell <timcannell@unity3d.com>2020-02-29 20:14:18 +0300
commit366aaf6534e19778492c91aa5c3f4c6e5e1fa59e (patch)
tree369768eac29cfed58de90cfad853ab225aefd99f
parent6a86542bd437ef46d683a3edc17ea078a02ef99e (diff)
fix platform issues
-rw-r--r--include/gc_config_macros.h5
-rw-r--r--include/private/pthread_stop_world.h5
-rw-r--r--include/private/pthread_stop_world.h.bak62
3 files changed, 67 insertions, 5 deletions
diff --git a/include/gc_config_macros.h b/include/gc_config_macros.h
index 5a05253d..448d1f64 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) \
@@ -91,8 +92,8 @@
# define GC_HAIKU_THREADS
# elif defined(__OpenBSD__)
# define GC_OPENBSD_THREADS
-# elif defined(__DragonFly__) || defined(__FreeBSD_kernel__) \
- || (defined(__FreeBSD__) && !defined(GC_NO_FREEBSD_THREADS))
+# elif ( defined(__DragonFly__) || defined(__FreeBSD_kernel__) \
+ || defined(__FreeBSD__) ) && !defined(GC_NO_FREEBSD_THREADS)
# define GC_FREEBSD_THREADS
# elif defined(__NetBSD__)
# define GC_NETBSD_THREADS
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/include/private/pthread_stop_world.h.bak b/include/private/pthread_stop_world.h.bak
new file mode 100644
index 00000000..780c0d9a
--- /dev/null
+++ b/include/private/pthread_stop_world.h.bak
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 1994 by Xerox Corporation. All rights reserved.
+ * Copyright (c) 1996 by Silicon Graphics. All rights reserved.
+ * Copyright (c) 1998 by Fergus Henderson. All rights reserved.
+ * Copyright (c) 2000-2009 by Hewlett-Packard Development Company.
+ * All rights reserved.
+ *
+ * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
+ * OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
+ *
+ * Permission is hereby granted to use or copy this program
+ * for any purpose, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ */
+
+#ifndef GC_PTHREAD_STOP_WORLD_H
+#define GC_PTHREAD_STOP_WORLD_H
+
+EXTERN_C_BEGIN
+
+struct thread_stop_info {
+# if !defined(GC_OPENBSD_UTHREADS) && !defined(NACL)
+# ifdef GC_ATOMIC_OPS_H
+ volatile AO_t last_stop_count;
+# else
+ word last_stop_count;
+# endif
+ /* The value of GC_stop_count when the thread */
+ /* last successfully handled a suspend signal. */
+# endif
+
+ ptr_t stack_ptr; /* Valid only when stopped. */
+
+# ifdef NACL
+ /* Grab NACL_GC_REG_STORAGE_SIZE pointers off the stack when */
+ /* going into a syscall. 20 is more than we need, but it's an */
+ /* overestimate in case the instrumented function uses any callee */
+ /* saved registers, they may be pushed to the stack much earlier. */
+ /* Also, on amd64 'push' puts 8 bytes on the stack even though */
+ /* our pointers are 4 bytes. */
+# ifdef ARM32
+ /* Space for r4-r8, r10-r12, r14. */
+# define NACL_GC_REG_STORAGE_SIZE 9
+# else
+# define NACL_GC_REG_STORAGE_SIZE 20
+# endif
+ 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];
+#endif
+};
+
+GC_INNER void GC_stop_init(void);
+
+EXTERN_C_END
+
+#endif