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.
10 GOARCH=386 go tool cgo -cdefs defs2_linux.go >defs_linux_386.h
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
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
22 #define size_t __kernel_size_t
24 #include <asm/signal.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>
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.
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;
52 PROT_NONE = C.PROT_NONE
53 PROT_READ = C.PROT_READ
54 PROT_WRITE = C.PROT_WRITE
55 PROT_EXEC = C.PROT_EXEC
57 MAP_ANON = C.MAP_ANONYMOUS
58 MAP_PRIVATE = C.MAP_PRIVATE
59 MAP_FIXED = C.MAP_FIXED
61 MADV_DONTNEED = C.MADV_DONTNEED
62 MADV_FREE = C.MADV_FREE
63 MADV_HUGEPAGE = C.MADV_HUGEPAGE
64 MADV_NOHUGEPAGE = C.MADV_NOHUGEPAGE
66 SA_RESTART = C.SA_RESTART
67 SA_ONSTACK = C.SA_ONSTACK
68 SA_RESTORER = C.SA_RESTORER
69 SA_SIGINFO = C.SA_SIGINFO
85 SIGSTKFLT = C.SIGSTKFLT
95 SIGVTALRM = C.SIGVTALRM
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
111 BUS_ADRALN = C.BUS_ADRALN
112 BUS_ADRERR = C.BUS_ADRERR
113 BUS_OBJERR = C.BUS_OBJERR
115 SEGV_MAPERR = C.SEGV_MAPERR
116 SEGV_ACCERR = C.SEGV_ACCERR
118 ITIMER_REAL = C.ITIMER_REAL
119 ITIMER_VIRTUAL = C.ITIMER_VIRTUAL
120 ITIMER_PROF = C.ITIMER_PROF
122 O_RDONLY = C.O_RDONLY
123 O_CLOEXEC = C.O_CLOEXEC
126 type Fpreg C.struct__fpreg
127 type Fpxreg C.struct__fpxreg
128 type Xmmreg C.struct__xmmreg
129 type Fpstate C.struct__fpstate
130 type Timespec C.struct_timespec
131 type Timeval C.struct_timeval
132 type Sigaction C.struct_kernel_sigaction
133 type Siginfo C.siginfo_t
134 type StackT C.stack_t
135 type Sigcontext C.struct_sigcontext
136 type Ucontext C.struct_ucontext
137 type Itimerval C.struct_itimerval
138 type EpollEvent C.struct_epoll_event