Black Lives Matter. Support the Equal Justice Initiative.

Source file src/runtime/defs_linux_mips64x.go

Documentation: runtime

     1  // Copyright 2015 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  //go:build (mips64 || mips64le) && linux
     6  // +build mips64 mips64le
     7  // +build linux
     8  
     9  package runtime
    10  
    11  const (
    12  	_EINTR  = 0x4
    13  	_EAGAIN = 0xb
    14  	_ENOMEM = 0xc
    15  	_ENOSYS = 0x59
    16  
    17  	_PROT_NONE  = 0x0
    18  	_PROT_READ  = 0x1
    19  	_PROT_WRITE = 0x2
    20  	_PROT_EXEC  = 0x4
    21  
    22  	_MAP_ANON    = 0x800
    23  	_MAP_PRIVATE = 0x2
    24  	_MAP_FIXED   = 0x10
    25  
    26  	_MADV_DONTNEED   = 0x4
    27  	_MADV_FREE       = 0x8
    28  	_MADV_HUGEPAGE   = 0xe
    29  	_MADV_NOHUGEPAGE = 0xf
    30  
    31  	_SA_RESTART = 0x10000000
    32  	_SA_ONSTACK = 0x8000000
    33  	_SA_SIGINFO = 0x8
    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  	_SIGUSR1   = 0x10
    50  	_SIGUSR2   = 0x11
    51  	_SIGCHLD   = 0x12
    52  	_SIGPWR    = 0x13
    53  	_SIGWINCH  = 0x14
    54  	_SIGURG    = 0x15
    55  	_SIGIO     = 0x16
    56  	_SIGSTOP   = 0x17
    57  	_SIGTSTP   = 0x18
    58  	_SIGCONT   = 0x19
    59  	_SIGTTIN   = 0x1a
    60  	_SIGTTOU   = 0x1b
    61  	_SIGVTALRM = 0x1c
    62  	_SIGPROF   = 0x1d
    63  	_SIGXCPU   = 0x1e
    64  	_SIGXFSZ   = 0x1f
    65  
    66  	_FPE_INTDIV = 0x1
    67  	_FPE_INTOVF = 0x2
    68  	_FPE_FLTDIV = 0x3
    69  	_FPE_FLTOVF = 0x4
    70  	_FPE_FLTUND = 0x5
    71  	_FPE_FLTRES = 0x6
    72  	_FPE_FLTINV = 0x7
    73  	_FPE_FLTSUB = 0x8
    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  	_EPOLLIN       = 0x1
    87  	_EPOLLOUT      = 0x4
    88  	_EPOLLERR      = 0x8
    89  	_EPOLLHUP      = 0x10
    90  	_EPOLLRDHUP    = 0x2000
    91  	_EPOLLET       = 0x80000000
    92  	_EPOLL_CLOEXEC = 0x80000
    93  	_EPOLL_CTL_ADD = 0x1
    94  	_EPOLL_CTL_DEL = 0x2
    95  	_EPOLL_CTL_MOD = 0x3
    96  )
    97  
    98  //struct Sigset {
    99  //	uint64	sig[1];
   100  //};
   101  //typedef uint64 Sigset;
   102  
   103  type timespec struct {
   104  	tv_sec  int64
   105  	tv_nsec int64
   106  }
   107  
   108  //go:nosplit
   109  func (ts *timespec) setNsec(ns int64) {
   110  	ts.tv_sec = ns / 1e9
   111  	ts.tv_nsec = ns % 1e9
   112  }
   113  
   114  type timeval struct {
   115  	tv_sec  int64
   116  	tv_usec int64
   117  }
   118  
   119  func (tv *timeval) set_usec(x int32) {
   120  	tv.tv_usec = int64(x)
   121  }
   122  
   123  type sigactiont struct {
   124  	sa_flags   uint32
   125  	sa_handler uintptr
   126  	sa_mask    [2]uint64
   127  	// linux header does not have sa_restorer field,
   128  	// but it is used in setsig(). it is no harm to put it here
   129  	sa_restorer uintptr
   130  }
   131  
   132  type siginfo struct {
   133  	si_signo int32
   134  	si_code  int32
   135  	si_errno int32
   136  	__pad0   [1]int32
   137  	// below here is a union; si_addr is the only field we use
   138  	si_addr uint64
   139  }
   140  
   141  type itimerval struct {
   142  	it_interval timeval
   143  	it_value    timeval
   144  }
   145  
   146  type epollevent struct {
   147  	events    uint32
   148  	pad_cgo_0 [4]byte
   149  	data      [8]byte // unaligned uintptr
   150  }
   151  
   152  const (
   153  	_O_RDONLY    = 0x0
   154  	_O_NONBLOCK  = 0x80
   155  	_O_CLOEXEC   = 0x80000
   156  	_SA_RESTORER = 0
   157  )
   158  
   159  type stackt struct {
   160  	ss_sp    *byte
   161  	ss_size  uintptr
   162  	ss_flags int32
   163  }
   164  
   165  type sigcontext struct {
   166  	sc_regs      [32]uint64
   167  	sc_fpregs    [32]uint64
   168  	sc_mdhi      uint64
   169  	sc_hi1       uint64
   170  	sc_hi2       uint64
   171  	sc_hi3       uint64
   172  	sc_mdlo      uint64
   173  	sc_lo1       uint64
   174  	sc_lo2       uint64
   175  	sc_lo3       uint64
   176  	sc_pc        uint64
   177  	sc_fpc_csr   uint32
   178  	sc_used_math uint32
   179  	sc_dsp       uint32
   180  	sc_reserved  uint32
   181  }
   182  
   183  type ucontext struct {
   184  	uc_flags    uint64
   185  	uc_link     *ucontext
   186  	uc_stack    stackt
   187  	uc_mcontext sigcontext
   188  	uc_sigmask  uint64
   189  }
   190  

View as plain text