github.com/flyinox/gosm@v0.0.0-20171117061539-16768cb62077/src/runtime/defs2_linux.go (about)

     1  // Copyright 2009 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 -cdefs
     9  
    10  GOARCH=386 go tool cgo -cdefs defs2_linux.go >defs_linux_386.h
    11  
    12  The asm header tricks we have to use for Linux on amd64
    13  (see defs.c and defs1.c) don't work here, so this is yet another
    14  file.  Sigh.
    15  */
    16  
    17  package runtime
    18  
    19  /*
    20  #cgo CFLAGS: -I/tmp/linux/arch/x86/include -I/tmp/linux/include -D_LOOSE_KERNEL_NAMES -D__ARCH_SI_UID_T=__kernel_uid32_t
    21  
    22  #define size_t __kernel_size_t
    23  #define pid_t int
    24  #include <asm/signal.h>
    25  #include <asm/mman.h>
    26  #include <asm/sigcontext.h>
    27  #include <asm/ucontext.h>
    28  #include <asm/siginfo.h>
    29  #include <asm-generic/errno.h>
    30  #include <asm-generic/fcntl.h>
    31  #include <asm-generic/poll.h>
    32  #include <linux/eventpoll.h>
    33  
    34  // This is the sigaction structure from the Linux 2.1.68 kernel which
    35  //   is used with the rt_sigaction system call. For 386 this is not
    36  //   defined in any public header file.
    37  
    38  struct kernel_sigaction {
    39  	__sighandler_t k_sa_handler;
    40  	unsigned long sa_flags;
    41  	void (*sa_restorer) (void);
    42  	unsigned long long sa_mask;
    43  };
    44  */
    45  import "C"
    46  
    47  const (
    48  	EINTR  = C.EINTR
    49  	EAGAIN = C.EAGAIN
    50  	ENOMEM = C.ENOMEM
    51  
    52  	PROT_NONE  = C.PROT_NONE
    53  	PROT_READ  = C.PROT_READ
    54  	PROT_WRITE = C.PROT_WRITE
    55  	PROT_EXEC  = C.PROT_EXEC
    56  
    57  	MAP_ANON    = C.MAP_ANONYMOUS
    58  	MAP_PRIVATE = C.MAP_PRIVATE
    59  	MAP_FIXED   = C.MAP_FIXED
    60  
    61  	MADV_DONTNEED = C.MADV_DONTNEED
    62  
    63  	SA_RESTART  = C.SA_RESTART
    64  	SA_ONSTACK  = C.SA_ONSTACK
    65  	SA_RESTORER = C.SA_RESTORER
    66  	SA_SIGINFO  = C.SA_SIGINFO
    67  
    68  	SIGHUP    = C.SIGHUP
    69  	SIGINT    = C.SIGINT
    70  	SIGQUIT   = C.SIGQUIT
    71  	SIGILL    = C.SIGILL
    72  	SIGTRAP   = C.SIGTRAP
    73  	SIGABRT   = C.SIGABRT
    74  	SIGBUS    = C.SIGBUS
    75  	SIGFPE    = C.SIGFPE
    76  	SIGKILL   = C.SIGKILL
    77  	SIGUSR1   = C.SIGUSR1
    78  	SIGSEGV   = C.SIGSEGV
    79  	SIGUSR2   = C.SIGUSR2
    80  	SIGPIPE   = C.SIGPIPE
    81  	SIGALRM   = C.SIGALRM
    82  	SIGSTKFLT = C.SIGSTKFLT
    83  	SIGCHLD   = C.SIGCHLD
    84  	SIGCONT   = C.SIGCONT
    85  	SIGSTOP   = C.SIGSTOP
    86  	SIGTSTP   = C.SIGTSTP
    87  	SIGTTIN   = C.SIGTTIN
    88  	SIGTTOU   = C.SIGTTOU
    89  	SIGURG    = C.SIGURG
    90  	SIGXCPU   = C.SIGXCPU
    91  	SIGXFSZ   = C.SIGXFSZ
    92  	SIGVTALRM = C.SIGVTALRM
    93  	SIGPROF   = C.SIGPROF
    94  	SIGWINCH  = C.SIGWINCH
    95  	SIGIO     = C.SIGIO
    96  	SIGPWR    = C.SIGPWR
    97  	SIGSYS    = C.SIGSYS
    98  
    99  	FPE_INTDIV = C.FPE_INTDIV
   100  	FPE_INTOVF = C.FPE_INTOVF
   101  	FPE_FLTDIV = C.FPE_FLTDIV
   102  	FPE_FLTOVF = C.FPE_FLTOVF
   103  	FPE_FLTUND = C.FPE_FLTUND
   104  	FPE_FLTRES = C.FPE_FLTRES
   105  	FPE_FLTINV = C.FPE_FLTINV
   106  	FPE_FLTSUB = C.FPE_FLTSUB
   107  
   108  	BUS_ADRALN = C.BUS_ADRALN
   109  	BUS_ADRERR = C.BUS_ADRERR
   110  	BUS_OBJERR = C.BUS_OBJERR
   111  
   112  	SEGV_MAPERR = C.SEGV_MAPERR
   113  	SEGV_ACCERR = C.SEGV_ACCERR
   114  
   115  	ITIMER_REAL    = C.ITIMER_REAL
   116  	ITIMER_VIRTUAL = C.ITIMER_VIRTUAL
   117  	ITIMER_PROF    = C.ITIMER_PROF
   118  
   119  	O_RDONLY  = C.O_RDONLY
   120  	O_CLOEXEC = C.O_CLOEXEC
   121  
   122  	EPOLLIN       = C.POLLIN
   123  	EPOLLOUT      = C.POLLOUT
   124  	EPOLLERR      = C.POLLERR
   125  	EPOLLHUP      = C.POLLHUP
   126  	EPOLLRDHUP    = C.POLLRDHUP
   127  	EPOLLET       = C.EPOLLET
   128  	EPOLL_CLOEXEC = C.EPOLL_CLOEXEC
   129  	EPOLL_CTL_ADD = C.EPOLL_CTL_ADD
   130  	EPOLL_CTL_DEL = C.EPOLL_CTL_DEL
   131  	EPOLL_CTL_MOD = C.EPOLL_CTL_MOD
   132  )
   133  
   134  type Fpreg C.struct__fpreg
   135  type Fpxreg C.struct__fpxreg
   136  type Xmmreg C.struct__xmmreg
   137  type Fpstate C.struct__fpstate
   138  type Timespec C.struct_timespec
   139  type Timeval C.struct_timeval
   140  type Sigaction C.struct_kernel_sigaction
   141  type Siginfo C.siginfo_t
   142  type StackT C.stack_t
   143  type Sigcontext C.struct_sigcontext
   144  type Ucontext C.struct_ucontext
   145  type Itimerval C.struct_itimerval
   146  type EpollEvent C.struct_epoll_event