aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/defs_darwin_arm64.go
diff options
context:
space:
mode:
authorElias Naur <elias.naur@gmail.com>2018-06-14 10:23:10 +0200
committerKeith Randall <khr@golang.org>2018-06-16 00:58:45 +0000
commitcdffe9b1e3dc54dd52a221e65e577f6c76ad39b8 (patch)
treeaeafe43694301fdf488c627a93086b4f5b18ea27 /src/runtime/defs_darwin_arm64.go
parent5b5473c6bf0b91fef76e21493c70754144ff0214 (diff)
downloadgo-cdffe9b1e3dc54dd52a221e65e577f6c76ad39b8.tar.gz
go-cdffe9b1e3dc54dd52a221e65e577f6c76ad39b8.zip
runtime: move semaphore ops from system calls to libc calls on iOS
Change-Id: I1c7a12497c47dd166cc41230d6e5e005edcbc848 Reviewed-on: https://go-review.googlesource.com/118819 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/runtime/defs_darwin_arm64.go')
-rw-r--r--src/runtime/defs_darwin_arm64.go93
1 files changed, 25 insertions, 68 deletions
diff --git a/src/runtime/defs_darwin_arm64.go b/src/runtime/defs_darwin_arm64.go
index 7ba051c2b3..fb5acaca3d 100644
--- a/src/runtime/defs_darwin_arm64.go
+++ b/src/runtime/defs_darwin_arm64.go
@@ -6,8 +6,9 @@ package runtime
import "unsafe"
const (
- _EINTR = 0x4
- _EFAULT = 0xe
+ _EINTR = 0x4
+ _EFAULT = 0xe
+ _ETIMEDOUT = 0x3c
_PROT_NONE = 0x0
_PROT_READ = 0x1
@@ -21,40 +22,6 @@ const (
_MADV_DONTNEED = 0x4
_MADV_FREE = 0x5
- _MACH_MSG_TYPE_MOVE_RECEIVE = 0x10
- _MACH_MSG_TYPE_MOVE_SEND = 0x11
- _MACH_MSG_TYPE_MOVE_SEND_ONCE = 0x12
- _MACH_MSG_TYPE_COPY_SEND = 0x13
- _MACH_MSG_TYPE_MAKE_SEND = 0x14
- _MACH_MSG_TYPE_MAKE_SEND_ONCE = 0x15
- _MACH_MSG_TYPE_COPY_RECEIVE = 0x16
-
- _MACH_MSG_PORT_DESCRIPTOR = 0x0
- _MACH_MSG_OOL_DESCRIPTOR = 0x1
- _MACH_MSG_OOL_PORTS_DESCRIPTOR = 0x2
- _MACH_MSG_OOL_VOLATILE_DESCRIPTOR = 0x3
-
- _MACH_MSGH_BITS_COMPLEX = 0x80000000
-
- _MACH_SEND_MSG = 0x1
- _MACH_RCV_MSG = 0x2
- _MACH_RCV_LARGE = 0x4
-
- _MACH_SEND_TIMEOUT = 0x10
- _MACH_SEND_INTERRUPT = 0x40
- _MACH_SEND_ALWAYS = 0x10000
- _MACH_SEND_TRAILER = 0x20000
- _MACH_RCV_TIMEOUT = 0x100
- _MACH_RCV_NOTIFY = 0x200
- _MACH_RCV_INTERRUPT = 0x400
- _MACH_RCV_OVERWRITE = 0x1000
-
- _NDR_PROTOCOL_2_0 = 0x0
- _NDR_INT_BIG_ENDIAN = 0x0
- _NDR_INT_LITTLE_ENDIAN = 0x1
- _NDR_FLOAT_IEEE = 0x0
- _NDR_CHAR_ASCII = 0x0
-
_SA_SIGINFO = 0x40
_SA_RESTART = 0x2
_SA_ONSTACK = 0x1
@@ -128,38 +95,6 @@ const (
_FD_CLOEXEC = 0x1
)
-type machbody struct {
- msgh_descriptor_count uint32
-}
-
-type machheader struct {
- msgh_bits uint32
- msgh_size uint32
- msgh_remote_port uint32
- msgh_local_port uint32
- msgh_reserved uint32
- msgh_id int32
-}
-
-type machndr struct {
- mig_vers uint8
- if_vers uint8
- reserved1 uint8
- mig_encoding uint8
- int_rep uint8
- char_rep uint8
- float_rep uint8
- reserved2 uint8
-}
-
-type machport struct {
- name uint32
- pad1 uint32
- pad2 uint16
- disposition uint8
- _type uint8
-}
-
type stackt struct {
ss_sp *byte
ss_size uintptr
@@ -213,6 +148,12 @@ type timespec struct {
tv_nsec int64
}
+//go:nosplit
+func (t *timespec) set_nsec(ns int64) {
+ t.tv_sec = ns / 1000000000
+ t.tv_nsec = ns % 1000000000
+}
+
type exceptionstate64 struct {
far uint64 // virtual fault addr
esr uint32 // exception syndrome
@@ -264,6 +205,22 @@ type pthreadattr struct {
X__sig int64
X__opaque [56]int8
}
+type pthreadmutex struct {
+ X__sig int64
+ X__opaque [56]int8
+}
+type pthreadmutexattr struct {
+ X__sig int64
+ X__opaque [8]int8
+}
+type pthreadcond struct {
+ X__sig int64
+ X__opaque [40]int8
+}
+type pthreadcondattr struct {
+ X__sig int64
+ X__opaque [8]int8
+}
type machTimebaseInfo struct {
numer uint32