github.com/twelsh-aw/go/src@v0.0.0-20230516233729-a56fe86a7c81/runtime/defs_darwin_amd64.go (about)

     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_SETFD    = 0x2
    98  	_F_GETFL    = 0x3
    99  	_F_SETFL    = 0x4
   100  	_FD_CLOEXEC = 0x1
   101  
   102  	_O_WRONLY   = 0x1
   103  	_O_NONBLOCK = 0x4
   104  	_O_CREAT    = 0x200
   105  	_O_TRUNC    = 0x400
   106  )
   107  
   108  type stackt struct {
   109  	ss_sp     *byte
   110  	ss_size   uintptr
   111  	ss_flags  int32
   112  	pad_cgo_0 [4]byte
   113  }
   114  
   115  type sigactiont struct {
   116  	__sigaction_u [8]byte
   117  	sa_tramp      unsafe.Pointer
   118  	sa_mask       uint32
   119  	sa_flags      int32
   120  }
   121  
   122  type usigactiont struct {
   123  	__sigaction_u [8]byte
   124  	sa_mask       uint32
   125  	sa_flags      int32
   126  }
   127  
   128  type siginfo struct {
   129  	si_signo  int32
   130  	si_errno  int32
   131  	si_code   int32
   132  	si_pid    int32
   133  	si_uid    uint32
   134  	si_status int32
   135  	si_addr   uint64
   136  	si_value  [8]byte
   137  	si_band   int64
   138  	__pad     [7]uint64
   139  }
   140  
   141  type timeval struct {
   142  	tv_sec    int64
   143  	tv_usec   int32
   144  	pad_cgo_0 [4]byte
   145  }
   146  
   147  func (tv *timeval) set_usec(x int32) {
   148  	tv.tv_usec = x
   149  }
   150  
   151  type itimerval struct {
   152  	it_interval timeval
   153  	it_value    timeval
   154  }
   155  
   156  type timespec struct {
   157  	tv_sec  int64
   158  	tv_nsec int64
   159  }
   160  
   161  //go:nosplit
   162  func (ts *timespec) setNsec(ns int64) {
   163  	ts.tv_sec = ns / 1e9
   164  	ts.tv_nsec = ns % 1e9
   165  }
   166  
   167  type fpcontrol struct {
   168  	pad_cgo_0 [2]byte
   169  }
   170  
   171  type fpstatus struct {
   172  	pad_cgo_0 [2]byte
   173  }
   174  
   175  type regmmst struct {
   176  	mmst_reg  [10]int8
   177  	mmst_rsrv [6]int8
   178  }
   179  
   180  type regxmm struct {
   181  	xmm_reg [16]int8
   182  }
   183  
   184  type regs64 struct {
   185  	rax    uint64
   186  	rbx    uint64
   187  	rcx    uint64
   188  	rdx    uint64
   189  	rdi    uint64
   190  	rsi    uint64
   191  	rbp    uint64
   192  	rsp    uint64
   193  	r8     uint64
   194  	r9     uint64
   195  	r10    uint64
   196  	r11    uint64
   197  	r12    uint64
   198  	r13    uint64
   199  	r14    uint64
   200  	r15    uint64
   201  	rip    uint64
   202  	rflags uint64
   203  	cs     uint64
   204  	fs     uint64
   205  	gs     uint64
   206  }
   207  
   208  type floatstate64 struct {
   209  	fpu_reserved  [2]int32
   210  	fpu_fcw       fpcontrol
   211  	fpu_fsw       fpstatus
   212  	fpu_ftw       uint8
   213  	fpu_rsrv1     uint8
   214  	fpu_fop       uint16
   215  	fpu_ip        uint32
   216  	fpu_cs        uint16
   217  	fpu_rsrv2     uint16
   218  	fpu_dp        uint32
   219  	fpu_ds        uint16
   220  	fpu_rsrv3     uint16
   221  	fpu_mxcsr     uint32
   222  	fpu_mxcsrmask uint32
   223  	fpu_stmm0     regmmst
   224  	fpu_stmm1     regmmst
   225  	fpu_stmm2     regmmst
   226  	fpu_stmm3     regmmst
   227  	fpu_stmm4     regmmst
   228  	fpu_stmm5     regmmst
   229  	fpu_stmm6     regmmst
   230  	fpu_stmm7     regmmst
   231  	fpu_xmm0      regxmm
   232  	fpu_xmm1      regxmm
   233  	fpu_xmm2      regxmm
   234  	fpu_xmm3      regxmm
   235  	fpu_xmm4      regxmm
   236  	fpu_xmm5      regxmm
   237  	fpu_xmm6      regxmm
   238  	fpu_xmm7      regxmm
   239  	fpu_xmm8      regxmm
   240  	fpu_xmm9      regxmm
   241  	fpu_xmm10     regxmm
   242  	fpu_xmm11     regxmm
   243  	fpu_xmm12     regxmm
   244  	fpu_xmm13     regxmm
   245  	fpu_xmm14     regxmm
   246  	fpu_xmm15     regxmm
   247  	fpu_rsrv4     [96]int8
   248  	fpu_reserved1 int32
   249  }
   250  
   251  type exceptionstate64 struct {
   252  	trapno     uint16
   253  	cpu        uint16
   254  	err        uint32
   255  	faultvaddr uint64
   256  }
   257  
   258  type mcontext64 struct {
   259  	es        exceptionstate64
   260  	ss        regs64
   261  	fs        floatstate64
   262  	pad_cgo_0 [4]byte
   263  }
   264  
   265  type regs32 struct {
   266  	eax    uint32
   267  	ebx    uint32
   268  	ecx    uint32
   269  	edx    uint32
   270  	edi    uint32
   271  	esi    uint32
   272  	ebp    uint32
   273  	esp    uint32
   274  	ss     uint32
   275  	eflags uint32
   276  	eip    uint32
   277  	cs     uint32
   278  	ds     uint32
   279  	es     uint32
   280  	fs     uint32
   281  	gs     uint32
   282  }
   283  
   284  type floatstate32 struct {
   285  	fpu_reserved  [2]int32
   286  	fpu_fcw       fpcontrol
   287  	fpu_fsw       fpstatus
   288  	fpu_ftw       uint8
   289  	fpu_rsrv1     uint8
   290  	fpu_fop       uint16
   291  	fpu_ip        uint32
   292  	fpu_cs        uint16
   293  	fpu_rsrv2     uint16
   294  	fpu_dp        uint32
   295  	fpu_ds        uint16
   296  	fpu_rsrv3     uint16
   297  	fpu_mxcsr     uint32
   298  	fpu_mxcsrmask uint32
   299  	fpu_stmm0     regmmst
   300  	fpu_stmm1     regmmst
   301  	fpu_stmm2     regmmst
   302  	fpu_stmm3     regmmst
   303  	fpu_stmm4     regmmst
   304  	fpu_stmm5     regmmst
   305  	fpu_stmm6     regmmst
   306  	fpu_stmm7     regmmst
   307  	fpu_xmm0      regxmm
   308  	fpu_xmm1      regxmm
   309  	fpu_xmm2      regxmm
   310  	fpu_xmm3      regxmm
   311  	fpu_xmm4      regxmm
   312  	fpu_xmm5      regxmm
   313  	fpu_xmm6      regxmm
   314  	fpu_xmm7      regxmm
   315  	fpu_rsrv4     [224]int8
   316  	fpu_reserved1 int32
   317  }
   318  
   319  type exceptionstate32 struct {
   320  	trapno     uint16
   321  	cpu        uint16
   322  	err        uint32
   323  	faultvaddr uint32
   324  }
   325  
   326  type mcontext32 struct {
   327  	es exceptionstate32
   328  	ss regs32
   329  	fs floatstate32
   330  }
   331  
   332  type ucontext struct {
   333  	uc_onstack  int32
   334  	uc_sigmask  uint32
   335  	uc_stack    stackt
   336  	uc_link     *ucontext
   337  	uc_mcsize   uint64
   338  	uc_mcontext *mcontext64
   339  }
   340  
   341  type keventt struct {
   342  	ident  uint64
   343  	filter int16
   344  	flags  uint16
   345  	fflags uint32
   346  	data   int64
   347  	udata  *byte
   348  }
   349  
   350  type pthread uintptr
   351  type pthreadattr struct {
   352  	X__sig    int64
   353  	X__opaque [56]int8
   354  }
   355  type pthreadmutex struct {
   356  	X__sig    int64
   357  	X__opaque [56]int8
   358  }
   359  type pthreadmutexattr struct {
   360  	X__sig    int64
   361  	X__opaque [8]int8
   362  }
   363  type pthreadcond struct {
   364  	X__sig    int64
   365  	X__opaque [40]int8
   366  }
   367  type pthreadcondattr struct {
   368  	X__sig    int64
   369  	X__opaque [8]int8
   370  }
   371  
   372  type machTimebaseInfo struct {
   373  	numer uint32
   374  	denom uint32
   375  }