Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2168)

Side by Side Diff: src/pkg/runtime/linux/defs.go

Issue 5348052: code review 5348052: runtime, syscall: convert from godefs to cgo (Closed)
Patch Set: diff -r 700ff7ef684f https://go.googlecode.com/hg Created 13 years, 5 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/pkg/runtime/linux/amd64/defs.h ('k') | src/pkg/runtime/linux/defs1.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 /* 5 /*
6 * Input to godefs 6 Input to cgo -cdefs
7 » godefs -f -m64 defs.c >amd64/defs.h
8 » godefs -f -m64 defs1.c >>amd64/defs.h
9 */
10 7
8 GOARCH=amd64 cgo -cdefs defs.go defs1.go >amd64/defs.h
9 */
10
11 package runtime
12
13 /*
11 // Linux glibc and Linux kernel define different and conflicting 14 // Linux glibc and Linux kernel define different and conflicting
12 // definitions for struct sigaction, struct timespec, etc. 15 // definitions for struct sigaction, struct timespec, etc.
13 // We want the kernel ones, which are in the asm/* headers. 16 // We want the kernel ones, which are in the asm/* headers.
14 // But then we'd get conflicts when we include the system 17 // But then we'd get conflicts when we include the system
15 // headers for things like ucontext_t, so that happens in 18 // headers for things like ucontext_t, so that happens in
16 // a separate file, defs1.c. 19 // a separate file, defs1.go.
17 20
18 #include <asm/posix_types.h> 21 #include <asm/posix_types.h>
19 #define size_t __kernel_size_t 22 #define size_t __kernel_size_t
20 #include <asm/signal.h> 23 #include <asm/signal.h>
21 #include <asm/siginfo.h> 24 #include <asm/siginfo.h>
22 #include <asm/mman.h> 25 #include <asm/mman.h>
26 */
27 import "C"
23 28
24 enum { 29 const (
25 » $PROT_NONE = PROT_NONE, 30 » PROT_NONE = C.PROT_NONE
26 » $PROT_READ = PROT_READ, 31 » PROT_READ = C.PROT_READ
27 » $PROT_WRITE = PROT_WRITE, 32 » PROT_WRITE = C.PROT_WRITE
28 » $PROT_EXEC = PROT_EXEC, 33 » PROT_EXEC = C.PROT_EXEC
29 34
30 » $MAP_ANON = MAP_ANONYMOUS, 35 » MAP_ANON = C.MAP_ANONYMOUS
31 » $MAP_PRIVATE = MAP_PRIVATE, 36 » MAP_PRIVATE = C.MAP_PRIVATE
32 » $MAP_FIXED = MAP_FIXED, 37 » MAP_FIXED = C.MAP_FIXED
33 38
34 » $SA_RESTART = SA_RESTART, 39 » SA_RESTART = C.SA_RESTART
35 » $SA_ONSTACK = SA_ONSTACK, 40 » SA_ONSTACK = C.SA_ONSTACK
36 » $SA_RESTORER = SA_RESTORER, 41 » SA_RESTORER = C.SA_RESTORER
37 » $SA_SIGINFO = SA_SIGINFO, 42 » SA_SIGINFO = C.SA_SIGINFO
38 »·······
39 » $SIGHUP = SIGHUP,
40 » $SIGINT = SIGINT,
41 » $SIGQUIT = SIGQUIT,
42 » $SIGILL = SIGILL,
43 » $SIGTRAP = SIGTRAP,
44 » $SIGABRT = SIGABRT,
45 » $SIGBUS = SIGBUS,
46 » $SIGFPE = SIGFPE,
47 » $SIGKILL = SIGKILL,
48 » $SIGUSR1 = SIGUSR1,
49 » $SIGSEGV = SIGSEGV,
50 » $SIGUSR2 = SIGUSR2,
51 » $SIGPIPE = SIGPIPE,
52 » $SIGALRM = SIGALRM,
53 » $SIGSTKFLT = SIGSTKFLT,
54 » $SIGCHLD = SIGCHLD,
55 » $SIGCONT = SIGCONT,
56 » $SIGSTOP = SIGSTOP,
57 » $SIGTSTP = SIGTSTP,
58 » $SIGTTIN = SIGTTIN,
59 » $SIGTTOU = SIGTTOU,
60 » $SIGURG = SIGURG,
61 » $SIGXCPU = SIGXCPU,
62 » $SIGXFSZ = SIGXFSZ,
63 » $SIGVTALRM = SIGVTALRM,
64 » $SIGPROF = SIGPROF,
65 » $SIGWINCH = SIGWINCH,
66 » $SIGIO = SIGIO,
67 » $SIGPWR = SIGPWR,
68 » $SIGSYS = SIGSYS,
69 »·······
70 » $FPE_INTDIV = FPE_INTDIV,
71 » $FPE_INTOVF = FPE_INTOVF,
72 » $FPE_FLTDIV = FPE_FLTDIV,
73 » $FPE_FLTOVF = FPE_FLTOVF,
74 » $FPE_FLTUND = FPE_FLTUND,
75 » $FPE_FLTRES = FPE_FLTRES,
76 » $FPE_FLTINV = FPE_FLTINV,
77 » $FPE_FLTSUB = FPE_FLTSUB,
78 »·······
79 » $BUS_ADRALN = BUS_ADRALN,
80 » $BUS_ADRERR = BUS_ADRERR,
81 » $BUS_OBJERR = BUS_OBJERR,
82 »·······
83 » $SEGV_MAPERR = SEGV_MAPERR,
84 » $SEGV_ACCERR = SEGV_ACCERR,
85 »·······
86 » $ITIMER_REAL = ITIMER_REAL,
87 » $ITIMER_VIRTUAL = ITIMER_VIRTUAL,
88 » $ITIMER_PROF = ITIMER_PROF,
89 };
90 43
91 typedef struct timespec $Timespec; 44 » SIGHUP = C.SIGHUP
92 typedef struct timeval $Timeval; 45 » SIGINT = C.SIGINT
93 typedef struct sigaction $Sigaction; 46 » SIGQUIT = C.SIGQUIT
94 typedef siginfo_t $Siginfo; 47 » SIGILL = C.SIGILL
95 typedef struct itimerval $Itimerval; 48 » SIGTRAP = C.SIGTRAP
49 » SIGABRT = C.SIGABRT
50 » SIGBUS = C.SIGBUS
51 » SIGFPE = C.SIGFPE
52 » SIGKILL = C.SIGKILL
53 » SIGUSR1 = C.SIGUSR1
54 » SIGSEGV = C.SIGSEGV
55 » SIGUSR2 = C.SIGUSR2
56 » SIGPIPE = C.SIGPIPE
57 » SIGALRM = C.SIGALRM
58 » SIGSTKFLT = C.SIGSTKFLT
59 » SIGCHLD = C.SIGCHLD
60 » SIGCONT = C.SIGCONT
61 » SIGSTOP = C.SIGSTOP
62 » SIGTSTP = C.SIGTSTP
63 » SIGTTIN = C.SIGTTIN
64 » SIGTTOU = C.SIGTTOU
65 » SIGURG = C.SIGURG
66 » SIGXCPU = C.SIGXCPU
67 » SIGXFSZ = C.SIGXFSZ
68 » SIGVTALRM = C.SIGVTALRM
69 » SIGPROF = C.SIGPROF
70 » SIGWINCH = C.SIGWINCH
71 » SIGIO = C.SIGIO
72 » SIGPWR = C.SIGPWR
73 » SIGSYS = C.SIGSYS
74
75 » FPE_INTDIV = C.FPE_INTDIV
76 » FPE_INTOVF = C.FPE_INTOVF
77 » FPE_FLTDIV = C.FPE_FLTDIV
78 » FPE_FLTOVF = C.FPE_FLTOVF
79 » FPE_FLTUND = C.FPE_FLTUND
80 » FPE_FLTRES = C.FPE_FLTRES
81 » FPE_FLTINV = C.FPE_FLTINV
82 » FPE_FLTSUB = C.FPE_FLTSUB
83
84 » BUS_ADRALN = C.BUS_ADRALN
85 » BUS_ADRERR = C.BUS_ADRERR
86 » BUS_OBJERR = C.BUS_OBJERR
87
88 » SEGV_MAPERR = C.SEGV_MAPERR
89 » SEGV_ACCERR = C.SEGV_ACCERR
90
91 » ITIMER_REAL = C.ITIMER_REAL
92 » ITIMER_VIRTUAL = C.ITIMER_VIRTUAL
93 » ITIMER_PROF = C.ITIMER_PROF
94 )
95
96 type Timespec C.struct_timespec
97 type Timeval C.struct_timeval
98 type Sigaction C.struct_sigaction
99 type Siginfo C.siginfo_t
100 type Itimerval C.struct_itimerval
OLDNEW
« no previous file with comments | « src/pkg/runtime/linux/amd64/defs.h ('k') | src/pkg/runtime/linux/defs1.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b