...

Source file src/runtime/defs_aix.go

     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 an 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 "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	
   128		_SS_DISABLE  = C.SS_DISABLE
   129		_SI_USER     = C.SI_USER
   130		_SIG_BLOCK   = C.SIG_BLOCK
   131		_SIG_UNBLOCK = C.SIG_UNBLOCK
   132		_SIG_SETMASK = C.SIG_SETMASK
   133	
   134		_SA_SIGINFO = C.SA_SIGINFO
   135		_SA_RESTART = C.SA_RESTART
   136		_SA_ONSTACK = C.SA_ONSTACK
   137	
   138		_PTHREAD_CREATE_DETACHED = C.PTHREAD_CREATE_DETACHED
   139	
   140		__SC_PAGE_SIZE        = C._SC_PAGE_SIZE
   141		__SC_NPROCESSORS_ONLN = C._SC_NPROCESSORS_ONLN
   142	
   143		_F_SETFD    = C.F_SETFD
   144		_F_SETFL    = C.F_SETFL
   145		_F_GETFD    = C.F_GETFD
   146		_F_GETFL    = C.F_GETFL
   147		_FD_CLOEXEC = C.FD_CLOEXEC
   148	)
   149	
   150	type sigset C.sigset_t
   151	type siginfo C.siginfo_t
   152	type timespec C.struct_timespec
   153	type timestruc C.struct_timestruc_t
   154	type timeval C.struct_timeval
   155	type itimerval C.struct_itimerval
   156	
   157	type stackt C.stack_t
   158	type sigcontext C.struct_sigcontext
   159	type ucontext C.ucontext_t
   160	type _Ctype_struct___extctx uint64 // ucontext use a pointer to this structure but it shouldn't be used
   161	type jmpbuf C.struct___jmpbuf
   162	type context64 C.struct___context64
   163	type sigactiont C.struct_sigaction
   164	type tstate C.struct_tstate
   165	type rusage C.struct_rusage
   166	
   167	type pthread C.pthread_t
   168	type pthread_attr C.pthread_attr_t
   169	
   170	type semt C.sem_t
   171	

View as plain text