+ movq $0x0, %rdx // zero out third argument
+
+ UNIX_SYSCALL_NONAME(gettimeofday,0,cerror_nocancel)
+ /*
+ * <rdar://problem/26410029>
+ * If rax is 0, we're on a new kernel and timeval was written by the kernel.
+ * Otherwise, rax:rdx contains the timeval and we marshal into timeval.
+ */
+ cmp $0, %rax
+ je 2f
+ movq %rax, (%rdi)
+ movl %edx, 8(%rdi)
+ xorl %eax, %eax
+2:
+ ret
+
+#elif defined(__arm__)
+
+__SYSCALL2(___gettimeofday_with_mach, gettimeofday, 3, cerror_nocancel)
+
+.text
+.align 2
+.globl ___gettimeofday
+___gettimeofday:
+ mov r2, #0x0
+ SYSCALL_NONAME(gettimeofday, 3, cerror_nocancel)
+ bx lr
+
+#elif defined(__arm64__)
+
+__SYSCALL2(___gettimeofday_with_mach, gettimeofday, 3, cerror_nocancel)
+
+.text
+.align 2
+.globl ___gettimeofday
+___gettimeofday:
+ movz x2, #0x0
+ SYSCALL_NONAME(gettimeofday, 3, cerror_nocancel)