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

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