GC_push_one(state.THREAD_FLD(lr));
GC_push_one(state.THREAD_FLD(cpsr));
+# elif defined(AARCH64)
+ lo = (void *)state.__sp;
+# ifndef DARWIN_DONT_PARSE_STACK
+ *phi = GC_FindTopOfStack(state.__sp);
+# endif
+ GC_push_one(state.__x[0]);
+ GC_push_one(state.__x[1]);
+ GC_push_one(state.__x[2]);
+ GC_push_one(state.__x[3]);
+ GC_push_one(state.__x[4]);
+ GC_push_one(state.__x[5]);
+ GC_push_one(state.__x[6]);
+ GC_push_one(state.__x[7]);
+ GC_push_one(state.__x[8]);
+ GC_push_one(state.__x[9]);
+ GC_push_one(state.__x[10]);
+ GC_push_one(state.__x[11]);
+ GC_push_one(state.__x[12]);
+ GC_push_one(state.__x[13]);
+ GC_push_one(state.__x[14]);
+ GC_push_one(state.__x[15]);
+ GC_push_one(state.__x[16]);
+ GC_push_one(state.__x[17]);
+ GC_push_one(state.__x[18]);
+ GC_push_one(state.__x[19]);
+ GC_push_one(state.__x[20]);
+ GC_push_one(state.__x[21]);
+ GC_push_one(state.__x[22]);
+ GC_push_one(state.__x[23]);
+ GC_push_one(state.__x[24]);
+ GC_push_one(state.__x[25]);
+ GC_push_one(state.__x[26]);
+ GC_push_one(state.__x[27]);
+ GC_push_one(state.__x[28]);
+ GC_push_one(state.__fp);
+ GC_push_one(state.__lr);
+ /* GC_push_one(state.__sp); */
+ /* GC_push_one(state.__pc); */
+ /* GC_push_one(state.__cpsr); */
+
# else
# error FIXME for non-x86 || ppc || arm architectures
# endif
# endif
# if defined(__aarch64__)
# define AARCH64
-# if !defined(LINUX)
+# if !defined(LINUX) && !defined(DARWIN)
# define NOSYS
# define mach_type_known
# endif
# define ARM32
# define mach_type_known
# define DARWIN_DONT_PARSE_STACK
+# elif defined(__aarch64__)
+# define AARCH64
+# define mach_type_known
+# define DARWIN_DONT_PARSE_STACK
# endif
# endif
# if defined(__rtems__) && (defined(i386) || defined(__i386__))
extern char _end[];
# define DATAEND ((ptr_t)(&_end))
# endif
+# ifdef DARWIN
+ /* iOS */
+# define OS_TYPE "DARWIN"
+# ifndef GC_DONT_REGISTER_MAIN_STATIC_DATA
+# define DYNAMIC_LOADING
+# endif
+# define DATASTART ((ptr_t) get_etext())
+# define DATAEND ((ptr_t) get_end())
+# define STACKBOTTOM ((ptr_t) 0x16fdfffff)
+# ifndef USE_MMAP
+# define USE_MMAP
+# endif
+# define USE_MMAP_ANON
+# define MPROTECT_VDB
+# include <unistd.h>
+# define GETPAGESIZE() getpagesize()
+ /* FIXME: There seems to be some issues with trylock hanging on */
+ /* darwin. This should be looked into some more. */
+# define NO_PTHREAD_TRYLOCK
+# ifndef NO_DYLD_BIND_FULLY_IMAGE
+# define NO_DYLD_BIND_FULLY_IMAGE
+# endif
+# endif
# ifdef NOSYS
/* __data_start is usually defined in the target linker script. */
extern int __data_start[];