Black Lives Matter. Support the Equal Justice Initiative.

Source file src/runtime/defs2_linux.go

Documentation: runtime

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

View as plain text