Black Lives Matter. Support the Equal Justice Initiative.

Source file src/runtime/defs_aix.go

Documentation: runtime

     1  // Copyright 2018 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 ignore
     6  // +build ignore
     7  
     8  /*
     9  Input to cgo -godefs
    10  GOARCH=ppc64 go tool cgo -godefs defs_aix.go > defs_aix_ppc64_tmp.go
    11  
    12  This is only a helper to create defs_aix_ppc64.go
    13  Go runtime functions require the "linux" name of fields (ss_sp, si_addr, etc)
    14  However, AIX structures don't provide such names and must be modified.
    15  
    16  TODO(aix): create a script to automatise defs_aix creation.
    17  
    18  Modifications made:
    19   - sigset replaced by a [4]uint64 array
    20   - add sigset_all variable
    21   - siginfo.si_addr uintptr instead of *byte
    22   - add (*timeval) set_usec
    23   - stackt.ss_sp uintptr instead of *byte
    24   - stackt.ss_size uintptr instead of uint64
    25   - sigcontext.sc_jmpbuf context64 instead of jumbuf
    26   - ucontext.__extctx is a uintptr because we don't need extctx struct
    27   - ucontext.uc_mcontext: replace jumbuf structure by context64 structure
    28   - sigaction.sa_handler represents union field as both are uintptr
    29   - tstate.* replace *byte by uintptr
    30  
    31  
    32  */
    33  
    34  package runtime
    35  
    36  /*
    37  
    38  #include <sys/types.h>
    39  #include <sys/errno.h>
    40  #include <sys/time.h>
    41  #include <sys/signal.h>
    42  #include <sys/mman.h>
    43  #include <sys/thread.h>
    44  #include <sys/resource.h>
    45  
    46  #include <unistd.h>
    47  #include <fcntl.h>
    48  #include <pthread.h>
    49  #include <semaphore.h>
    50  */
    51  import "C"
    52  
    53  const (
    54  	_EPERM     = C.EPERM
    55  	_ENOENT    = C.ENOENT
    56  	_EINTR     = C.EINTR
    57  	_EAGAIN    = C.EAGAIN
    58  	_ENOMEM    = C.ENOMEM
    59  	_EACCES    = C.EACCES
    60  	_EFAULT    = C.EFAULT
    61  	_EINVAL    = C.EINVAL
    62  	_ETIMEDOUT = C.ETIMEDOUT
    63  
    64  	_PROT_NONE  = C.PROT_NONE
    65  	_PROT_READ  = C.PROT_READ
    66  	_PROT_WRITE = C.PROT_WRITE
    67  	_PROT_EXEC  = C.PROT_EXEC
    68  
    69  	_MAP_ANON      = C.MAP_ANONYMOUS
    70  	_MAP_PRIVATE   = C.MAP_PRIVATE
    71  	_MAP_FIXED     = C.MAP_FIXED
    72  	_MADV_DONTNEED = C.MADV_DONTNEED
    73  
    74  	_SIGHUP     = C.SIGHUP
    75  	_SIGINT     = C.SIGINT
    76  	_SIGQUIT    = C.SIGQUIT
    77  	_SIGILL     = C.SIGILL
    78  	_SIGTRAP    = C.SIGTRAP
    79  	_SIGABRT    = C.SIGABRT
    80  	_SIGBUS     = C.SIGBUS
    81  	_SIGFPE     = C.SIGFPE
    82  	_SIGKILL    = C.SIGKILL
    83  	_SIGUSR1    = C.SIGUSR1
    84  	_SIGSEGV    = C.SIGSEGV
    85  	_SIGUSR2    = C.SIGUSR2
    86  	_SIGPIPE    = C.SIGPIPE
    87  	_SIGALRM    = C.SIGALRM
    88  	_SIGCHLD    = C.SIGCHLD
    89  	_SIGCONT    = C.SIGCONT
    90  	_SIGSTOP    = C.SIGSTOP
    91  	_SIGTSTP    = C.SIGTSTP
    92  	_SIGTTIN    = C.SIGTTIN
    93  	_SIGTTOU    = C.SIGTTOU
    94  	_SIGURG     = C.SIGURG
    95  	_SIGXCPU    = C.SIGXCPU
    96  	_SIGXFSZ    = C.SIGXFSZ
    97  	_SIGVTALRM  = C.SIGVTALRM
    98  	_SIGPROF    = C.SIGPROF
    99  	_SIGWINCH   = C.SIGWINCH
   100  	_SIGIO      = C.SIGIO
   101  	_SIGPWR     = C.SIGPWR
   102  	_SIGSYS     = C.SIGSYS
   103  	_SIGTERM    = C.SIGTERM
   104  	_SIGEMT     = C.SIGEMT
   105  	_SIGWAITING = C.SIGWAITING
   106  
   107  	_FPE_INTDIV = C.FPE_INTDIV
   108  	_FPE_INTOVF = C.FPE_INTOVF
   109  	_FPE_FLTDIV = C.FPE_FLTDIV
   110  	_FPE_FLTOVF = C.FPE_FLTOVF
   111  	_FPE_FLTUND = C.FPE_FLTUND
   112  	_FPE_FLTRES = C.FPE_FLTRES
   113  	_FPE_FLTINV = C.FPE_FLTINV
   114  	_FPE_FLTSUB = C.FPE_FLTSUB
   115  
   116  	_BUS_ADRALN = C.BUS_ADRALN
   117  	_BUS_ADRERR = C.BUS_ADRERR
   118  	_BUS_OBJERR = C.BUS_OBJERR
   119  
   120  	_SEGV_MAPERR = C.SEGV_MAPERR
   121  	_SEGV_ACCERR = C.SEGV_ACCERR
   122  
   123  	_ITIMER_REAL    = C.ITIMER_REAL
   124  	_ITIMER_VIRTUAL = C.ITIMER_VIRTUAL
   125  	_ITIMER_PROF    = C.ITIMER_PROF
   126  
   127  	_O_RDONLY   = C.O_RDONLY
   128  	_O_NONBLOCK = C.O_NONBLOCK
   129  
   130  	_SS_DISABLE  = C.SS_DISABLE
   131  	_SI_USER     = C.SI_USER
   132  	_SIG_BLOCK   = C.SIG_BLOCK
   133  	_SIG_UNBLOCK = C.SIG_UNBLOCK
   134  	_SIG_SETMASK = C.SIG_SETMASK
   135  
   136  	_SA_SIGINFO = C.SA_SIGINFO
   137  	_SA_RESTART = C.SA_RESTART
   138  	_SA_ONSTACK = C.SA_ONSTACK
   139  
   140  	_PTHREAD_CREATE_DETACHED = C.PTHREAD_CREATE_DETACHED
   141  
   142  	__SC_PAGE_SIZE        = C._SC_PAGE_SIZE
   143  	__SC_NPROCESSORS_ONLN = C._SC_NPROCESSORS_ONLN
   144  
   145  	_F_SETFD    = C.F_SETFD
   146  	_F_SETFL    = C.F_SETFL
   147  	_F_GETFD    = C.F_GETFD
   148  	_F_GETFL    = C.F_GETFL
   149  	_FD_CLOEXEC = C.FD_CLOEXEC
   150  )
   151  
   152  type sigset C.sigset_t
   153  type siginfo C.siginfo_t
   154  type timespec C.struct_timespec
   155  type timestruc C.struct_timestruc_t
   156  type timeval C.struct_timeval
   157  type itimerval C.struct_itimerval
   158  
   159  type stackt C.stack_t
   160  type sigcontext C.struct_sigcontext
   161  type ucontext C.ucontext_t
   162  type _Ctype_struct___extctx uint64 // ucontext use a pointer to this structure but it shouldn't be used
   163  type jmpbuf C.struct___jmpbuf
   164  type context64 C.struct___context64
   165  type sigactiont C.struct_sigaction
   166  type tstate C.struct_tstate
   167  type rusage C.struct_rusage
   168  
   169  type pthread C.pthread_t
   170  type pthread_attr C.pthread_attr_t
   171  
   172  type semt C.sem_t
   173  

View as plain text