...

Source file src/runtime/defs_darwin_arm.go

     1	// Note: cgo can't handle some Darwin/ARM structures, so this file can't
     2	// be auto generated by cgo yet.
     3	// Created based on output of `cgo -cdefs defs_darwin.go` and Darwin/ARM
     4	// specific header (mainly mcontext and ucontext related stuff)
     5	
     6	package runtime
     7	
     8	import "unsafe"
     9	
    10	const (
    11		_EINTR     = 0x4
    12		_EFAULT    = 0xe
    13		_ETIMEDOUT = 0x3c
    14	
    15		_PROT_NONE  = 0x0
    16		_PROT_READ  = 0x1
    17		_PROT_WRITE = 0x2
    18		_PROT_EXEC  = 0x4
    19	
    20		_MAP_ANON    = 0x1000
    21		_MAP_PRIVATE = 0x2
    22		_MAP_FIXED   = 0x10
    23	
    24		_MADV_DONTNEED      = 0x4
    25		_MADV_FREE          = 0x5
    26		_MADV_FREE_REUSABLE = 0x7
    27		_MADV_FREE_REUSE    = 0x8
    28	
    29		_SA_SIGINFO   = 0x40
    30		_SA_RESTART   = 0x2
    31		_SA_ONSTACK   = 0x1
    32		_SA_USERTRAMP = 0x100
    33		_SA_64REGSET  = 0x200
    34	
    35		_SIGHUP    = 0x1
    36		_SIGINT    = 0x2
    37		_SIGQUIT   = 0x3
    38		_SIGILL    = 0x4
    39		_SIGTRAP   = 0x5
    40		_SIGABRT   = 0x6
    41		_SIGEMT    = 0x7
    42		_SIGFPE    = 0x8
    43		_SIGKILL   = 0x9
    44		_SIGBUS    = 0xa
    45		_SIGSEGV   = 0xb
    46		_SIGSYS    = 0xc
    47		_SIGPIPE   = 0xd
    48		_SIGALRM   = 0xe
    49		_SIGTERM   = 0xf
    50		_SIGURG    = 0x10
    51		_SIGSTOP   = 0x11
    52		_SIGTSTP   = 0x12
    53		_SIGCONT   = 0x13
    54		_SIGCHLD   = 0x14
    55		_SIGTTIN   = 0x15
    56		_SIGTTOU   = 0x16
    57		_SIGIO     = 0x17
    58		_SIGXCPU   = 0x18
    59		_SIGXFSZ   = 0x19
    60		_SIGVTALRM = 0x1a
    61		_SIGPROF   = 0x1b
    62		_SIGWINCH  = 0x1c
    63		_SIGINFO   = 0x1d
    64		_SIGUSR1   = 0x1e
    65		_SIGUSR2   = 0x1f
    66	
    67		_FPE_INTDIV = 0x7
    68		_FPE_INTOVF = 0x8
    69		_FPE_FLTDIV = 0x1
    70		_FPE_FLTOVF = 0x2
    71		_FPE_FLTUND = 0x3
    72		_FPE_FLTRES = 0x4
    73		_FPE_FLTINV = 0x5
    74		_FPE_FLTSUB = 0x6
    75	
    76		_BUS_ADRALN = 0x1
    77		_BUS_ADRERR = 0x2
    78		_BUS_OBJERR = 0x3
    79	
    80		_SEGV_MAPERR = 0x1
    81		_SEGV_ACCERR = 0x2
    82	
    83		_ITIMER_REAL    = 0x0
    84		_ITIMER_VIRTUAL = 0x1
    85		_ITIMER_PROF    = 0x2
    86	
    87		_EV_ADD       = 0x1
    88		_EV_DELETE    = 0x2
    89		_EV_CLEAR     = 0x20
    90		_EV_RECEIPT   = 0x40
    91		_EV_ERROR     = 0x4000
    92		_EV_EOF       = 0x8000
    93		_EVFILT_READ  = -0x1
    94		_EVFILT_WRITE = -0x2
    95	
    96		_PTHREAD_CREATE_DETACHED = 0x2
    97	
    98		_F_SETFD    = 0x2
    99		_F_GETFL    = 0x3
   100		_F_SETFL    = 0x4
   101		_FD_CLOEXEC = 0x1
   102	
   103		_O_NONBLOCK = 4
   104	)
   105	
   106	type stackt struct {
   107		ss_sp    *byte
   108		ss_size  uintptr
   109		ss_flags int32
   110	}
   111	
   112	type sigactiont struct {
   113		__sigaction_u [4]byte
   114		sa_tramp      unsafe.Pointer
   115		sa_mask       uint32
   116		sa_flags      int32
   117	}
   118	
   119	type usigactiont struct {
   120		__sigaction_u [4]byte
   121		sa_mask       uint32
   122		sa_flags      int32
   123	}
   124	
   125	type siginfo struct {
   126		si_signo  int32
   127		si_errno  int32
   128		si_code   int32
   129		si_pid    int32
   130		si_uid    uint32
   131		si_status int32
   132		si_addr   uint32
   133		si_value  [4]byte
   134		si_band   int32
   135		__pad     [7]uint32
   136	}
   137	
   138	type timeval struct {
   139		tv_sec  int32
   140		tv_usec int32
   141	}
   142	
   143	func (tv *timeval) set_usec(x int32) {
   144		tv.tv_usec = x
   145	}
   146	
   147	type itimerval struct {
   148		it_interval timeval
   149		it_value    timeval
   150	}
   151	
   152	type timespec struct {
   153		tv_sec  int32
   154		tv_nsec int32
   155	}
   156	
   157	//go:nosplit
   158	func (ts *timespec) setNsec(ns int64) {
   159		ts.tv_sec = timediv(ns, 1e9, &ts.tv_nsec)
   160	}
   161	
   162	type floatstate32 struct {
   163		r     [32]uint32
   164		fpscr uint32
   165	}
   166	
   167	type regs32 struct {
   168		r    [13]uint32 // r0 to r12
   169		sp   uint32     // r13
   170		lr   uint32     // r14
   171		pc   uint32     // r15
   172		cpsr uint32
   173	}
   174	
   175	type exceptionstate32 struct {
   176		trapno     uint32 // NOTE: on 386, the trapno field is split into trapno and cpu
   177		err        uint32
   178		faultvaddr uint32
   179	}
   180	
   181	type mcontext32 struct {
   182		es exceptionstate32
   183		ss regs32
   184		fs floatstate32
   185	}
   186	
   187	type ucontext struct {
   188		uc_onstack  int32
   189		uc_sigmask  uint32
   190		uc_stack    stackt
   191		uc_link     *ucontext
   192		uc_mcsize   uint32
   193		uc_mcontext *mcontext32
   194	}
   195	
   196	type keventt struct {
   197		ident  uint32
   198		filter int16
   199		flags  uint16
   200		fflags uint32
   201		data   int32
   202		udata  *byte
   203	}
   204	
   205	type pthread uintptr
   206	type pthreadattr struct {
   207		X__sig    int32
   208		X__opaque [36]int8
   209	}
   210	type pthreadmutex struct {
   211		X__sig    int32
   212		X__opaque [40]int8
   213	}
   214	type pthreadmutexattr struct {
   215		X__sig    int32
   216		X__opaque [8]int8
   217	}
   218	type pthreadcond struct {
   219		X__sig    int32
   220		X__opaque [24]int8
   221	}
   222	type pthreadcondattr struct {
   223		X__sig    int32
   224		X__opaque [4]int8
   225	}
   226	
   227	type machTimebaseInfo struct {
   228		numer uint32
   229		denom uint32
   230	}
   231	

View as plain text