github.com/x04/go/src@v0.0.0-20200202162449-3d481ceb3525/runtime/defs_linux_s390x.go (about)

     1  // Copyright 2016 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  package runtime
     6  
     7  const (
     8  	_EINTR	= 0x4
     9  	_EAGAIN	= 0xb
    10  	_ENOMEM	= 0xc
    11  	_ENOSYS	= 0x26
    12  
    13  	_PROT_NONE	= 0x0
    14  	_PROT_READ	= 0x1
    15  	_PROT_WRITE	= 0x2
    16  	_PROT_EXEC	= 0x4
    17  
    18  	_MAP_ANON	= 0x20
    19  	_MAP_PRIVATE	= 0x2
    20  	_MAP_FIXED	= 0x10
    21  
    22  	_MADV_DONTNEED		= 0x4
    23  	_MADV_FREE		= 0x8
    24  	_MADV_HUGEPAGE		= 0xe
    25  	_MADV_NOHUGEPAGE	= 0xf
    26  
    27  	_SA_RESTART	= 0x10000000
    28  	_SA_ONSTACK	= 0x8000000
    29  	_SA_SIGINFO	= 0x4
    30  
    31  	_SIGHUP		= 0x1
    32  	_SIGINT		= 0x2
    33  	_SIGQUIT	= 0x3
    34  	_SIGILL		= 0x4
    35  	_SIGTRAP	= 0x5
    36  	_SIGABRT	= 0x6
    37  	_SIGBUS		= 0x7
    38  	_SIGFPE		= 0x8
    39  	_SIGKILL	= 0x9
    40  	_SIGUSR1	= 0xa
    41  	_SIGSEGV	= 0xb
    42  	_SIGUSR2	= 0xc
    43  	_SIGPIPE	= 0xd
    44  	_SIGALRM	= 0xe
    45  	_SIGSTKFLT	= 0x10
    46  	_SIGCHLD	= 0x11
    47  	_SIGCONT	= 0x12
    48  	_SIGSTOP	= 0x13
    49  	_SIGTSTP	= 0x14
    50  	_SIGTTIN	= 0x15
    51  	_SIGTTOU	= 0x16
    52  	_SIGURG		= 0x17
    53  	_SIGXCPU	= 0x18
    54  	_SIGXFSZ	= 0x19
    55  	_SIGVTALRM	= 0x1a
    56  	_SIGPROF	= 0x1b
    57  	_SIGWINCH	= 0x1c
    58  	_SIGIO		= 0x1d
    59  	_SIGPWR		= 0x1e
    60  	_SIGSYS		= 0x1f
    61  
    62  	_FPE_INTDIV	= 0x1
    63  	_FPE_INTOVF	= 0x2
    64  	_FPE_FLTDIV	= 0x3
    65  	_FPE_FLTOVF	= 0x4
    66  	_FPE_FLTUND	= 0x5
    67  	_FPE_FLTRES	= 0x6
    68  	_FPE_FLTINV	= 0x7
    69  	_FPE_FLTSUB	= 0x8
    70  
    71  	_BUS_ADRALN	= 0x1
    72  	_BUS_ADRERR	= 0x2
    73  	_BUS_OBJERR	= 0x3
    74  
    75  	_SEGV_MAPERR	= 0x1
    76  	_SEGV_ACCERR	= 0x2
    77  
    78  	_ITIMER_REAL	= 0x0
    79  	_ITIMER_VIRTUAL	= 0x1
    80  	_ITIMER_PROF	= 0x2
    81  
    82  	_EPOLLIN	= 0x1
    83  	_EPOLLOUT	= 0x4
    84  	_EPOLLERR	= 0x8
    85  	_EPOLLHUP	= 0x10
    86  	_EPOLLRDHUP	= 0x2000
    87  	_EPOLLET	= 0x80000000
    88  	_EPOLL_CLOEXEC	= 0x80000
    89  	_EPOLL_CTL_ADD	= 0x1
    90  	_EPOLL_CTL_DEL	= 0x2
    91  	_EPOLL_CTL_MOD	= 0x3
    92  )
    93  
    94  type timespec struct {
    95  	tv_sec	int64
    96  	tv_nsec	int64
    97  }
    98  
    99  //go:nosplit
   100  func (ts *timespec) setNsec(ns int64) {
   101  	ts.tv_sec = ns / 1e9
   102  	ts.tv_nsec = ns % 1e9
   103  }
   104  
   105  type timeval struct {
   106  	tv_sec	int64
   107  	tv_usec	int64
   108  }
   109  
   110  func (tv *timeval) set_usec(x int32) {
   111  	tv.tv_usec = int64(x)
   112  }
   113  
   114  type sigactiont struct {
   115  	sa_handler	uintptr
   116  	sa_flags	uint64
   117  	sa_restorer	uintptr
   118  	sa_mask		uint64
   119  }
   120  
   121  type siginfo struct {
   122  	si_signo	int32
   123  	si_errno	int32
   124  	si_code		int32
   125  	// below here is a union; si_addr is the only field we use
   126  	si_addr	uint64
   127  }
   128  
   129  type itimerval struct {
   130  	it_interval	timeval
   131  	it_value	timeval
   132  }
   133  
   134  type epollevent struct {
   135  	events		uint32
   136  	pad_cgo_0	[4]byte
   137  	data		[8]byte	// unaligned uintptr
   138  }
   139  
   140  const (
   141  	_O_RDONLY	= 0x0
   142  	_O_NONBLOCK	= 0x800
   143  	_O_CLOEXEC	= 0x80000
   144  	_SA_RESTORER	= 0
   145  )
   146  
   147  type stackt struct {
   148  	ss_sp		*byte
   149  	ss_flags	int32
   150  	ss_size		uintptr
   151  }
   152  
   153  type sigcontext struct {
   154  	psw_mask	uint64
   155  	psw_addr	uint64
   156  	gregs		[16]uint64
   157  	aregs		[16]uint32
   158  	fpc		uint32
   159  	fpregs		[16]uint64
   160  }
   161  
   162  type ucontext struct {
   163  	uc_flags	uint64
   164  	uc_link		*ucontext
   165  	uc_stack	stackt
   166  	uc_mcontext	sigcontext
   167  	uc_sigmask	uint64
   168  }