...

Source file src/runtime/defs2_linux.go

     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		MADV_FREE       = C.MADV_FREE
    63		MADV_HUGEPAGE   = C.MADV_HUGEPAGE
    64		MADV_NOHUGEPAGE = C.MADV_HNOUGEPAGE
    65	
    66		SA_RESTART  = C.SA_RESTART
    67		SA_ONSTACK  = C.SA_ONSTACK
    68		SA_RESTORER = C.SA_RESTORER
    69		SA_SIGINFO  = C.SA_SIGINFO
    70	
    71		SIGHUP    = C.SIGHUP
    72		SIGINT    = C.SIGINT
    73		SIGQUIT   = C.SIGQUIT
    74		SIGILL    = C.SIGILL
    75		SIGTRAP   = C.SIGTRAP
    76		SIGABRT   = C.SIGABRT
    77		SIGBUS    = C.SIGBUS
    78		SIGFPE    = C.SIGFPE
    79		SIGKILL   = C.SIGKILL
    80		SIGUSR1   = C.SIGUSR1
    81		SIGSEGV   = C.SIGSEGV
    82		SIGUSR2   = C.SIGUSR2
    83		SIGPIPE   = C.SIGPIPE
    84		SIGALRM   = C.SIGALRM
    85		SIGSTKFLT = C.SIGSTKFLT
    86		SIGCHLD   = C.SIGCHLD
    87		SIGCONT   = C.SIGCONT
    88		SIGSTOP   = C.SIGSTOP
    89		SIGTSTP   = C.SIGTSTP
    90		SIGTTIN   = C.SIGTTIN
    91		SIGTTOU   = C.SIGTTOU
    92		SIGURG    = C.SIGURG
    93		SIGXCPU   = C.SIGXCPU
    94		SIGXFSZ   = C.SIGXFSZ
    95		SIGVTALRM = C.SIGVTALRM
    96		SIGPROF   = C.SIGPROF
    97		SIGWINCH  = C.SIGWINCH
    98		SIGIO     = C.SIGIO
    99		SIGPWR    = C.SIGPWR
   100		SIGSYS    = C.SIGSYS
   101	
   102		FPE_INTDIV = C.FPE_INTDIV
   103		FPE_INTOVF = C.FPE_INTOVF
   104		FPE_FLTDIV = C.FPE_FLTDIV
   105		FPE_FLTOVF = C.FPE_FLTOVF
   106		FPE_FLTUND = C.FPE_FLTUND
   107		FPE_FLTRES = C.FPE_FLTRES
   108		FPE_FLTINV = C.FPE_FLTINV
   109		FPE_FLTSUB = C.FPE_FLTSUB
   110	
   111		BUS_ADRALN = C.BUS_ADRALN
   112		BUS_ADRERR = C.BUS_ADRERR
   113		BUS_OBJERR = C.BUS_OBJERR
   114	
   115		SEGV_MAPERR = C.SEGV_MAPERR
   116		SEGV_ACCERR = C.SEGV_ACCERR
   117	
   118		ITIMER_REAL    = C.ITIMER_REAL
   119		ITIMER_VIRTUAL = C.ITIMER_VIRTUAL
   120		ITIMER_PROF    = C.ITIMER_PROF
   121	
   122		O_RDONLY  = C.O_RDONLY
   123		O_CLOEXEC = C.O_CLOEXEC
   124	
   125		EPOLLIN       = C.POLLIN
   126		EPOLLOUT      = C.POLLOUT
   127		EPOLLERR      = C.POLLERR
   128		EPOLLHUP      = C.POLLHUP
   129		EPOLLRDHUP    = C.POLLRDHUP
   130		EPOLLET       = C.EPOLLET
   131		EPOLL_CLOEXEC = C.EPOLL_CLOEXEC
   132		EPOLL_CTL_ADD = C.EPOLL_CTL_ADD
   133		EPOLL_CTL_DEL = C.EPOLL_CTL_DEL
   134		EPOLL_CTL_MOD = C.EPOLL_CTL_MOD
   135	)
   136	
   137	type Fpreg C.struct__fpreg
   138	type Fpxreg C.struct__fpxreg
   139	type Xmmreg C.struct__xmmreg
   140	type Fpstate C.struct__fpstate
   141	type Timespec C.struct_timespec
   142	type Timeval C.struct_timeval
   143	type Sigaction C.struct_kernel_sigaction
   144	type Siginfo C.siginfo_t
   145	type StackT C.stack_t
   146	type Sigcontext C.struct_sigcontext
   147	type Ucontext C.struct_ucontext
   148	type Itimerval C.struct_itimerval
   149	type EpollEvent C.struct_epoll_event
   150	

View as plain text