github.com/mtsmfm/go/src@v0.0.0-20221020090648-44bdcb9f8fde/runtime/defs_freebsd_riscv64.go (about)

     1  // created by cgo -cdefs and then converted to Go
     2  // cgo -cdefs defs_freebsd.go
     3  
     4  package runtime
     5  
     6  import "unsafe"
     7  
     8  const (
     9  	_NBBY            = 0x8
    10  	_CTL_MAXNAME     = 0x18
    11  	_CPU_LEVEL_WHICH = 0x3
    12  	_CPU_WHICH_PID   = 0x2
    13  )
    14  
    15  const (
    16  	_EINTR     = 0x4
    17  	_EFAULT    = 0xe
    18  	_EAGAIN    = 0x23
    19  	_ETIMEDOUT = 0x3c
    20  
    21  	_O_NONBLOCK = 0x4
    22  	_O_CLOEXEC  = 0x100000
    23  
    24  	_PROT_NONE  = 0x0
    25  	_PROT_READ  = 0x1
    26  	_PROT_WRITE = 0x2
    27  	_PROT_EXEC  = 0x4
    28  
    29  	_MAP_ANON    = 0x1000
    30  	_MAP_SHARED  = 0x1
    31  	_MAP_PRIVATE = 0x2
    32  	_MAP_FIXED   = 0x10
    33  
    34  	_MADV_DONTNEED = 0x4
    35  	_MADV_FREE     = 0x5
    36  
    37  	_SA_SIGINFO = 0x40
    38  	_SA_RESTART = 0x2
    39  	_SA_ONSTACK = 0x1
    40  
    41  	_CLOCK_MONOTONIC = 0x4
    42  	_CLOCK_REALTIME  = 0x0
    43  
    44  	_UMTX_OP_WAIT_UINT         = 0xb
    45  	_UMTX_OP_WAIT_UINT_PRIVATE = 0xf
    46  	_UMTX_OP_WAKE              = 0x3
    47  	_UMTX_OP_WAKE_PRIVATE      = 0x10
    48  
    49  	_SIGHUP    = 0x1
    50  	_SIGINT    = 0x2
    51  	_SIGQUIT   = 0x3
    52  	_SIGILL    = 0x4
    53  	_SIGTRAP   = 0x5
    54  	_SIGABRT   = 0x6
    55  	_SIGEMT    = 0x7
    56  	_SIGFPE    = 0x8
    57  	_SIGKILL   = 0x9
    58  	_SIGBUS    = 0xa
    59  	_SIGSEGV   = 0xb
    60  	_SIGSYS    = 0xc
    61  	_SIGPIPE   = 0xd
    62  	_SIGALRM   = 0xe
    63  	_SIGTERM   = 0xf
    64  	_SIGURG    = 0x10
    65  	_SIGSTOP   = 0x11
    66  	_SIGTSTP   = 0x12
    67  	_SIGCONT   = 0x13
    68  	_SIGCHLD   = 0x14
    69  	_SIGTTIN   = 0x15
    70  	_SIGTTOU   = 0x16
    71  	_SIGIO     = 0x17
    72  	_SIGXCPU   = 0x18
    73  	_SIGXFSZ   = 0x19
    74  	_SIGVTALRM = 0x1a
    75  	_SIGPROF   = 0x1b
    76  	_SIGWINCH  = 0x1c
    77  	_SIGINFO   = 0x1d
    78  	_SIGUSR1   = 0x1e
    79  	_SIGUSR2   = 0x1f
    80  
    81  	_FPE_INTDIV = 0x2
    82  	_FPE_INTOVF = 0x1
    83  	_FPE_FLTDIV = 0x3
    84  	_FPE_FLTOVF = 0x4
    85  	_FPE_FLTUND = 0x5
    86  	_FPE_FLTRES = 0x6
    87  	_FPE_FLTINV = 0x7
    88  	_FPE_FLTSUB = 0x8
    89  
    90  	_BUS_ADRALN = 0x1
    91  	_BUS_ADRERR = 0x2
    92  	_BUS_OBJERR = 0x3
    93  
    94  	_SEGV_MAPERR = 0x1
    95  	_SEGV_ACCERR = 0x2
    96  
    97  	_ITIMER_REAL    = 0x0
    98  	_ITIMER_VIRTUAL = 0x1
    99  	_ITIMER_PROF    = 0x2
   100  
   101  	_EV_ADD       = 0x1
   102  	_EV_DELETE    = 0x2
   103  	_EV_CLEAR     = 0x20
   104  	_EV_RECEIPT   = 0x40
   105  	_EV_ERROR     = 0x4000
   106  	_EV_EOF       = 0x8000
   107  	_EVFILT_READ  = -0x1
   108  	_EVFILT_WRITE = -0x2
   109  )
   110  
   111  type rtprio struct {
   112  	_type uint16
   113  	prio  uint16
   114  }
   115  
   116  type thrparam struct {
   117  	start_func uintptr
   118  	arg        unsafe.Pointer
   119  	stack_base uintptr
   120  	stack_size uintptr
   121  	tls_base   unsafe.Pointer
   122  	tls_size   uintptr
   123  	child_tid  unsafe.Pointer // *int64
   124  	parent_tid *int64
   125  	flags      int32
   126  	pad_cgo_0  [4]byte
   127  	rtp        *rtprio
   128  	spare      [3]uintptr
   129  }
   130  
   131  type thread int64 // long
   132  
   133  type sigset struct {
   134  	__bits [4]uint32
   135  }
   136  
   137  type stackt struct {
   138  	ss_sp     uintptr
   139  	ss_size   uintptr
   140  	ss_flags  int32
   141  	pad_cgo_0 [4]byte
   142  }
   143  
   144  type siginfo struct {
   145  	si_signo  int32
   146  	si_errno  int32
   147  	si_code   int32
   148  	si_pid    int32
   149  	si_uid    uint32
   150  	si_status int32
   151  	si_addr   uint64
   152  	si_value  [8]byte
   153  	_reason   [40]byte
   154  }
   155  
   156  type gpregs struct {
   157  	gp_ra      uint64
   158  	gp_sp      uint64
   159  	gp_gp      uint64
   160  	gp_tp      uint64
   161  	gp_t       [7]uint64
   162  	gp_s       [12]uint64
   163  	gp_a       [8]uint64
   164  	gp_sepc    uint64
   165  	gp_sstatus uint64
   166  }
   167  
   168  type fpregs struct {
   169  	fp_x     [64]uint64 // actually __uint64_t fp_x[32][2]
   170  	fp_fcsr  uint64
   171  	fp_flags int32
   172  	pad      int32
   173  }
   174  
   175  type mcontext struct {
   176  	mc_gpregs gpregs
   177  	mc_fpregs fpregs
   178  	mc_flags  int32
   179  	mc_pad    int32
   180  	mc_spare  [8]uint64
   181  }
   182  
   183  type ucontext struct {
   184  	uc_sigmask  sigset
   185  	uc_mcontext mcontext
   186  	uc_link     *ucontext
   187  	uc_stack    stackt
   188  	uc_flags    int32
   189  	__spare__   [4]int32
   190  	pad_cgo_0   [12]byte
   191  }
   192  
   193  type timespec struct {
   194  	tv_sec  int64
   195  	tv_nsec int64
   196  }
   197  
   198  //go:nosplit
   199  func (ts *timespec) setNsec(ns int64) {
   200  	ts.tv_sec = ns / 1e9
   201  	ts.tv_nsec = ns % 1e9
   202  }
   203  
   204  type timeval struct {
   205  	tv_sec  int64
   206  	tv_usec int64
   207  }
   208  
   209  func (tv *timeval) set_usec(x int32) {
   210  	tv.tv_usec = int64(x)
   211  }
   212  
   213  type itimerval struct {
   214  	it_interval timeval
   215  	it_value    timeval
   216  }
   217  
   218  type umtx_time struct {
   219  	_timeout timespec
   220  	_flags   uint32
   221  	_clockid uint32
   222  }
   223  
   224  type keventt struct {
   225  	ident  uint64
   226  	filter int16
   227  	flags  uint16
   228  	fflags uint32
   229  	data   int64
   230  	udata  *byte
   231  	ext    [4]uint64
   232  }
   233  
   234  type bintime struct {
   235  	sec  int64
   236  	frac uint64
   237  }
   238  
   239  type vdsoTimehands struct {
   240  	algo         uint32
   241  	gen          uint32
   242  	scale        uint64
   243  	offset_count uint32
   244  	counter_mask uint32
   245  	offset       bintime
   246  	boottime     bintime
   247  	physical     uint32
   248  	res          [7]uint32
   249  }
   250  
   251  type vdsoTimekeep struct {
   252  	ver       uint32
   253  	enabled   uint32
   254  	current   uint32
   255  	pad_cgo_0 [4]byte
   256  }
   257  
   258  const (
   259  	_VDSO_TK_VER_CURR = 0x1
   260  
   261  	vdsoTimehandsSize = 0x58
   262  	vdsoTimekeepSize  = 0x10
   263  )