Source file src/runtime/defs_darwin_amd64.go

     1  // created by cgo -cdefs and then converted to Go
     2  // cgo -cdefs defs_darwin.go
     3  
     4  package runtime
     5  
     6  import "unsafe"
     7  
     8  const (
     9  	_EINTR     = 0x4
    10  	_EFAULT    = 0xe
    11  	_EAGAIN    = 0x23
    12  	_ETIMEDOUT = 0x3c
    13  
    14  	_PROT_NONE  = 0x0
    15  	_PROT_READ  = 0x1
    16  	_PROT_WRITE = 0x2
    17  	_PROT_EXEC  = 0x4
    18  
    19  	_MAP_ANON    = 0x1000
    20  	_MAP_PRIVATE = 0x2
    21  	_MAP_FIXED   = 0x10
    22  
    23  	_MADV_DONTNEED      = 0x4
    24  	_MADV_FREE          = 0x5
    25  	_MADV_FREE_REUSABLE = 0x7
    26  	_MADV_FREE_REUSE    = 0x8
    27  
    28  	_SA_SIGINFO   = 0x40
    29  	_SA_RESTART   = 0x2
    30  	_SA_ONSTACK   = 0x1
    31  	_SA_USERTRAMP = 0x100
    32  	_SA_64REGSET  = 0x200
    33  
    34  	_SIGHUP    = 0x1
    35  	_SIGINT    = 0x2
    36  	_SIGQUIT   = 0x3
    37  	_SIGILL    = 0x4
    38  	_SIGTRAP   = 0x5
    39  	_SIGABRT   = 0x6
    40  	_SIGEMT    = 0x7
    41  	_SIGFPE    = 0x8
    42  	_SIGKILL   = 0x9
    43  	_SIGBUS    = 0xa
    44  	_SIGSEGV   = 0xb
    45  	_SIGSYS    = 0xc
    46  	_SIGPIPE   = 0xd
    47  	_SIGALRM   = 0xe
    48  	_SIGTERM   = 0xf
    49  	_SIGURG    = 0x10
    50  	_SIGSTOP   = 0x11
    51  	_SIGTSTP   = 0x12
    52  	_SIGCONT   = 0x13
    53  	_SIGCHLD   = 0x14
    54  	_SIGTTIN   = 0x15
    55  	_SIGTTOU   = 0x16
    56  	_SIGIO     = 0x17
    57  	_SIGXCPU   = 0x18
    58  	_SIGXFSZ   = 0x19
    59  	_SIGVTALRM = 0x1a
    60  	_SIGPROF   = 0x1b
    61  	_SIGWINCH  = 0x1c
    62  	_SIGINFO   = 0x1d
    63  	_SIGUSR1   = 0x1e
    64  	_SIGUSR2   = 0x1f
    65  
    66  	_FPE_INTDIV = 0x7
    67  	_FPE_INTOVF = 0x8
    68  	_FPE_FLTDIV = 0x1
    69  	_FPE_FLTOVF = 0x2
    70  	_FPE_FLTUND = 0x3
    71  	_FPE_FLTRES = 0x4
    72  	_FPE_FLTINV = 0x5
    73  	_FPE_FLTSUB = 0x6
    74  
    75  	_BUS_ADRALN = 0x1
    76  	_BUS_ADRERR = 0x2
    77  	_BUS_OBJERR = 0x3
    78  
    79  	_SEGV_MAPERR = 0x1
    80  	_SEGV_ACCERR = 0x2
    81  
    82  	_ITIMER_REAL    = 0x0
    83  	_ITIMER_VIRTUAL = 0x1
    84  	_ITIMER_PROF    = 0x2
    85  
    86  	_EV_ADD       = 0x1
    87  	_EV_DELETE    = 0x2
    88  	_EV_CLEAR     = 0x20
    89  	_EV_RECEIPT   = 0x40
    90  	_EV_ERROR     = 0x4000
    91  	_EV_EOF       = 0x8000
    92  	_EVFILT_READ  = -0x1
    93  	_EVFILT_WRITE = -0x2
    94  
    95  	_PTHREAD_CREATE_DETACHED = 0x2
    96  
    97  	_F_GETFL = 0x3
    98  	_F_SETFL = 0x4
    99  
   100  	_O_WRONLY   = 0x1
   101  	_O_NONBLOCK = 0x4
   102  	_O_CREAT    = 0x200
   103  	_O_TRUNC    = 0x400
   104  )
   105  
   106  type stackt struct {
   107  	ss_sp     *byte
   108  	ss_size   uintptr
   109  	ss_flags  int32
   110  	pad_cgo_0 [4]byte
   111  }
   112  
   113  type sigactiont struct {
   114  	__sigaction_u [8]byte
   115  	sa_tramp      unsafe.Pointer
   116  	sa_mask       uint32
   117  	sa_flags      int32
   118  }
   119  
   120  type usigactiont struct {
   121  	__sigaction_u [8]byte
   122  	sa_mask       uint32
   123  	sa_flags      int32
   124  }
   125  
   126  type siginfo struct {
   127  	si_signo  int32
   128  	si_errno  int32
   129  	si_code   int32
   130  	si_pid    int32
   131  	si_uid    uint32
   132  	si_status int32
   133  	si_addr   uint64
   134  	si_value  [8]byte
   135  	si_band   int64
   136  	__pad     [7]uint64
   137  }
   138  
   139  type timeval struct {
   140  	tv_sec    int64
   141  	tv_usec   int32
   142  	pad_cgo_0 [4]byte
   143  }
   144  
   145  func (tv *timeval) set_usec(x int32) {
   146  	tv.tv_usec = x
   147  }
   148  
   149  type itimerval struct {
   150  	it_interval timeval
   151  	it_value    timeval
   152  }
   153  
   154  type timespec struct {
   155  	tv_sec  int64
   156  	tv_nsec int64
   157  }
   158  
   159  //go:nosplit
   160  func (ts *timespec) setNsec(ns int64) {
   161  	ts.tv_sec = ns / 1e9
   162  	ts.tv_nsec = ns % 1e9
   163  }
   164  
   165  type fpcontrol struct {
   166  	pad_cgo_0 [2]byte
   167  }
   168  
   169  type fpstatus struct {
   170  	pad_cgo_0 [2]byte
   171  }
   172  
   173  type regmmst struct {
   174  	mmst_reg  [10]int8
   175  	mmst_rsrv [6]int8
   176  }
   177  
   178  type regxmm struct {
   179  	xmm_reg [16]int8
   180  }
   181  
   182  type regs64 struct {
   183  	rax    uint64
   184  	rbx    uint64
   185  	rcx    uint64
   186  	rdx    uint64
   187  	rdi    uint64
   188  	rsi    uint64
   189  	rbp    uint64
   190  	rsp    uint64
   191  	r8     uint64
   192  	r9     uint64
   193  	r10    uint64
   194  	r11    uint64
   195  	r12    uint64
   196  	r13    uint64
   197  	r14    uint64
   198  	r15    uint64
   199  	rip    uint64
   200  	rflags uint64
   201  	cs     uint64
   202  	fs     uint64
   203  	gs     uint64
   204  }
   205  
   206  type floatstate64 struct {
   207  	fpu_reserved  [2]int32
   208  	fpu_fcw       fpcontrol
   209  	fpu_fsw       fpstatus
   210  	fpu_ftw       uint8
   211  	fpu_rsrv1     uint8
   212  	fpu_fop       uint16
   213  	fpu_ip        uint32
   214  	fpu_cs        uint16
   215  	fpu_rsrv2     uint16
   216  	fpu_dp        uint32
   217  	fpu_ds        uint16
   218  	fpu_rsrv3     uint16
   219  	fpu_mxcsr     uint32
   220  	fpu_mxcsrmask uint32
   221  	fpu_stmm0     regmmst
   222  	fpu_stmm1     regmmst
   223  	fpu_stmm2     regmmst
   224  	fpu_stmm3     regmmst
   225  	fpu_stmm4     regmmst
   226  	fpu_stmm5     regmmst
   227  	fpu_stmm6     regmmst
   228  	fpu_stmm7     regmmst
   229  	fpu_xmm0      regxmm
   230  	fpu_xmm1      regxmm
   231  	fpu_xmm2      regxmm
   232  	fpu_xmm3      regxmm
   233  	fpu_xmm4      regxmm
   234  	fpu_xmm5      regxmm
   235  	fpu_xmm6      regxmm
   236  	fpu_xmm7      regxmm
   237  	fpu_xmm8      regxmm
   238  	fpu_xmm9      regxmm
   239  	fpu_xmm10     regxmm
   240  	fpu_xmm11     regxmm
   241  	fpu_xmm12     regxmm
   242  	fpu_xmm13     regxmm
   243  	fpu_xmm14     regxmm
   244  	fpu_xmm15     regxmm
   245  	fpu_rsrv4     [96]int8
   246  	fpu_reserved1 int32
   247  }
   248  
   249  type exceptionstate64 struct {
   250  	trapno     uint16
   251  	cpu        uint16
   252  	err        uint32
   253  	faultvaddr uint64
   254  }
   255  
   256  type mcontext64 struct {
   257  	es        exceptionstate64
   258  	ss        regs64
   259  	fs        floatstate64
   260  	pad_cgo_0 [4]byte
   261  }
   262  
   263  type regs32 struct {
   264  	eax    uint32
   265  	ebx    uint32
   266  	ecx    uint32
   267  	edx    uint32
   268  	edi    uint32
   269  	esi    uint32
   270  	ebp    uint32
   271  	esp    uint32
   272  	ss     uint32
   273  	eflags uint32
   274  	eip    uint32
   275  	cs     uint32
   276  	ds     uint32
   277  	es     uint32
   278  	fs     uint32
   279  	gs     uint32
   280  }
   281  
   282  type floatstate32 struct {
   283  	fpu_reserved  [2]int32
   284  	fpu_fcw       fpcontrol
   285  	fpu_fsw       fpstatus
   286  	fpu_ftw       uint8
   287  	fpu_rsrv1     uint8
   288  	fpu_fop       uint16
   289  	fpu_ip        uint32
   290  	fpu_cs        uint16
   291  	fpu_rsrv2     uint16
   292  	fpu_dp        uint32
   293  	fpu_ds        uint16
   294  	fpu_rsrv3     uint16
   295  	fpu_mxcsr     uint32
   296  	fpu_mxcsrmask uint32
   297  	fpu_stmm0     regmmst
   298  	fpu_stmm1     regmmst
   299  	fpu_stmm2     regmmst
   300  	fpu_stmm3     regmmst
   301  	fpu_stmm4     regmmst
   302  	fpu_stmm5     regmmst
   303  	fpu_stmm6     regmmst
   304  	fpu_stmm7     regmmst
   305  	fpu_xmm0      regxmm
   306  	fpu_xmm1      regxmm
   307  	fpu_xmm2      regxmm
   308  	fpu_xmm3      regxmm
   309  	fpu_xmm4      regxmm
   310  	fpu_xmm5      regxmm
   311  	fpu_xmm6      regxmm
   312  	fpu_xmm7      regxmm
   313  	fpu_rsrv4     [224]int8
   314  	fpu_reserved1 int32
   315  }
   316  
   317  type exceptionstate32 struct {
   318  	trapno     uint16
   319  	cpu        uint16
   320  	err        uint32
   321  	faultvaddr uint32
   322  }
   323  
   324  type mcontext32 struct {
   325  	es exceptionstate32
   326  	ss regs32
   327  	fs floatstate32
   328  }
   329  
   330  type ucontext struct {
   331  	uc_onstack  int32
   332  	uc_sigmask  uint32
   333  	uc_stack    stackt
   334  	uc_link     *ucontext
   335  	uc_mcsize   uint64
   336  	uc_mcontext *mcontext64
   337  }
   338  
   339  type keventt struct {
   340  	ident  uint64
   341  	filter int16
   342  	flags  uint16
   343  	fflags uint32
   344  	data   int64
   345  	udata  *byte
   346  }
   347  
   348  type pthread uintptr
   349  type pthreadattr struct {
   350  	X__sig    int64
   351  	X__opaque [56]int8
   352  }
   353  type pthreadmutex struct {
   354  	X__sig    int64
   355  	X__opaque [56]int8
   356  }
   357  type pthreadmutexattr struct {
   358  	X__sig    int64
   359  	X__opaque [8]int8
   360  }
   361  type pthreadcond struct {
   362  	X__sig    int64
   363  	X__opaque [40]int8
   364  }
   365  type pthreadcondattr struct {
   366  	X__sig    int64
   367  	X__opaque [8]int8
   368  }
   369  
   370  type machTimebaseInfo struct {
   371  	numer uint32
   372  	denom uint32
   373  }
   374  

View as plain text