Source file src/runtime/defs_linux_ppc64.go

     1  // created by cgo -cdefs and then converted to Go
     2  // cgo -cdefs defs_linux.go defs3_linux.go
     3  
     4  package runtime
     5  
     6  import "unsafe"
     7  
     8  const (
     9  	_EINTR  = 0x4
    10  	_EAGAIN = 0xb
    11  	_ENOMEM = 0xc
    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  	_SI_KERNEL = 0x80
    32  	_SI_TIMER  = -0x2
    33  
    34  	_SIGHUP    = 0x1
    35  	_SIGINT    = 0x2
    36  	_SIGQUIT   = 0x3
    37  	_SIGILL    = 0x4
    38  	_SIGTRAP   = 0x5
    39  	_SIGABRT   = 0x6
    40  	_SIGBUS    = 0x7
    41  	_SIGFPE    = 0x8
    42  	_SIGKILL   = 0x9
    43  	_SIGUSR1   = 0xa
    44  	_SIGSEGV   = 0xb
    45  	_SIGUSR2   = 0xc
    46  	_SIGPIPE   = 0xd
    47  	_SIGALRM   = 0xe
    48  	_SIGSTKFLT = 0x10
    49  	_SIGCHLD   = 0x11
    50  	_SIGCONT   = 0x12
    51  	_SIGSTOP   = 0x13
    52  	_SIGTSTP   = 0x14
    53  	_SIGTTIN   = 0x15
    54  	_SIGTTOU   = 0x16
    55  	_SIGURG    = 0x17
    56  	_SIGXCPU   = 0x18
    57  	_SIGXFSZ   = 0x19
    58  	_SIGVTALRM = 0x1a
    59  	_SIGPROF   = 0x1b
    60  	_SIGWINCH  = 0x1c
    61  	_SIGIO     = 0x1d
    62  	_SIGPWR    = 0x1e
    63  	_SIGSYS    = 0x1f
    64  
    65  	_SIGRTMIN = 0x20
    66  
    67  	_FPE_INTDIV = 0x1
    68  	_FPE_INTOVF = 0x2
    69  	_FPE_FLTDIV = 0x3
    70  	_FPE_FLTOVF = 0x4
    71  	_FPE_FLTUND = 0x5
    72  	_FPE_FLTRES = 0x6
    73  	_FPE_FLTINV = 0x7
    74  	_FPE_FLTSUB = 0x8
    75  
    76  	_BUS_ADRALN = 0x1
    77  	_BUS_ADRERR = 0x2
    78  	_BUS_OBJERR = 0x3
    79  
    80  	_SEGV_MAPERR = 0x1
    81  	_SEGV_ACCERR = 0x2
    82  
    83  	_ITIMER_REAL    = 0x0
    84  	_ITIMER_VIRTUAL = 0x1
    85  	_ITIMER_PROF    = 0x2
    86  
    87  	_CLOCK_THREAD_CPUTIME_ID = 0x3
    88  
    89  	_SIGEV_THREAD_ID = 0x4
    90  
    91  	_EPOLLIN       = 0x1
    92  	_EPOLLOUT      = 0x4
    93  	_EPOLLERR      = 0x8
    94  	_EPOLLHUP      = 0x10
    95  	_EPOLLRDHUP    = 0x2000
    96  	_EPOLLET       = 0x80000000
    97  	_EPOLL_CLOEXEC = 0x80000
    98  	_EPOLL_CTL_ADD = 0x1
    99  	_EPOLL_CTL_DEL = 0x2
   100  	_EPOLL_CTL_MOD = 0x3
   101  )
   102  
   103  //struct Sigset {
   104  //	uint64	sig[1];
   105  //};
   106  //typedef uint64 Sigset;
   107  
   108  type timespec struct {
   109  	tv_sec  int64
   110  	tv_nsec int64
   111  }
   112  
   113  //go:nosplit
   114  func (ts *timespec) setNsec(ns int64) {
   115  	ts.tv_sec = ns / 1e9
   116  	ts.tv_nsec = ns % 1e9
   117  }
   118  
   119  type timeval struct {
   120  	tv_sec  int64
   121  	tv_usec int64
   122  }
   123  
   124  func (tv *timeval) set_usec(x int32) {
   125  	tv.tv_usec = int64(x)
   126  }
   127  
   128  type sigactiont struct {
   129  	sa_handler  uintptr
   130  	sa_flags    uint64
   131  	sa_restorer uintptr
   132  	sa_mask     uint64
   133  }
   134  
   135  type siginfoFields struct {
   136  	si_signo int32
   137  	si_errno int32
   138  	si_code  int32
   139  	// below here is a union; si_addr is the only field we use
   140  	si_addr uint64
   141  }
   142  
   143  type siginfo struct {
   144  	siginfoFields
   145  
   146  	// Pad struct to the max size in the kernel.
   147  	_ [_si_max_size - unsafe.Sizeof(siginfoFields{})]byte
   148  }
   149  
   150  type itimerspec struct {
   151  	it_interval timespec
   152  	it_value    timespec
   153  }
   154  
   155  type itimerval struct {
   156  	it_interval timeval
   157  	it_value    timeval
   158  }
   159  
   160  type sigeventFields struct {
   161  	value  uintptr
   162  	signo  int32
   163  	notify int32
   164  	// below here is a union; sigev_notify_thread_id is the only field we use
   165  	sigev_notify_thread_id int32
   166  }
   167  
   168  type sigevent struct {
   169  	sigeventFields
   170  
   171  	// Pad struct to the max size in the kernel.
   172  	_ [_sigev_max_size - unsafe.Sizeof(sigeventFields{})]byte
   173  }
   174  
   175  type epollevent struct {
   176  	events    uint32
   177  	pad_cgo_0 [4]byte
   178  	data      [8]byte // unaligned uintptr
   179  }
   180  
   181  // created by cgo -cdefs and then converted to Go
   182  // cgo -cdefs defs_linux.go defs3_linux.go
   183  
   184  const (
   185  	_O_RDONLY    = 0x0
   186  	_O_NONBLOCK  = 0x800
   187  	_O_CLOEXEC   = 0x80000
   188  	_SA_RESTORER = 0
   189  )
   190  
   191  type ptregs struct {
   192  	gpr       [32]uint64
   193  	nip       uint64
   194  	msr       uint64
   195  	orig_gpr3 uint64
   196  	ctr       uint64
   197  	link      uint64
   198  	xer       uint64
   199  	ccr       uint64
   200  	softe     uint64
   201  	trap      uint64
   202  	dar       uint64
   203  	dsisr     uint64
   204  	result    uint64
   205  }
   206  
   207  type vreg struct {
   208  	u [4]uint32
   209  }
   210  
   211  type stackt struct {
   212  	ss_sp     *byte
   213  	ss_flags  int32
   214  	pad_cgo_0 [4]byte
   215  	ss_size   uintptr
   216  }
   217  
   218  type sigcontext struct {
   219  	_unused     [4]uint64
   220  	signal      int32
   221  	_pad0       int32
   222  	handler     uint64
   223  	oldmask     uint64
   224  	regs        *ptregs
   225  	gp_regs     [48]uint64
   226  	fp_regs     [33]float64
   227  	v_regs      *vreg
   228  	vmx_reserve [101]int64
   229  }
   230  
   231  type ucontext struct {
   232  	uc_flags    uint64
   233  	uc_link     *ucontext
   234  	uc_stack    stackt
   235  	uc_sigmask  uint64
   236  	__unused    [15]uint64
   237  	uc_mcontext sigcontext
   238  }
   239  

View as plain text