...
Run Format

Source file src/runtime/defs_darwin_arm.go

Documentation: runtime

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

View as plain text