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

Side by Side Diff: src/pkg/runtime/darwin/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, 4 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/darwin/amd64/signal.c ('k') | src/pkg/runtime/freebsd/defs.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.
7 *
8 » godefs -f -m64 defs.c >amd64/defs.h
9 » godefs -f -m32 defs.c >386/defs.h
10 */
11 7
8 GOARCH=amd64 cgo -cdefs defs.go >amd64/defs.h
9 GOARCH=386 cgo -cdefs defs.go >386/defs.h
10 */
11
12 package runtime
13
14 /*
12 #define __DARWIN_UNIX03 0 15 #define __DARWIN_UNIX03 0
13
14 #include <mach/mach.h> 16 #include <mach/mach.h>
15 #include <mach/message.h> 17 #include <mach/message.h>
16 #include <sys/types.h> 18 #include <sys/types.h>
17 #include <sys/time.h> 19 #include <sys/time.h>
18 #include <signal.h> 20 #include <signal.h>
19 #include <sys/mman.h> 21 #include <sys/mman.h>
22 */
23 import "C"
20 24
21 enum { 25 const (
22 » $PROT_NONE = PROT_NONE, 26 » PROT_NONE = C.PROT_NONE
23 » $PROT_READ = PROT_READ, 27 » PROT_READ = C.PROT_READ
24 » $PROT_WRITE = PROT_WRITE, 28 » PROT_WRITE = C.PROT_WRITE
25 » $PROT_EXEC = PROT_EXEC, 29 » PROT_EXEC = C.PROT_EXEC
26 30
27 » $MAP_ANON = MAP_ANON, 31 » MAP_ANON = C.MAP_ANON
28 » $MAP_PRIVATE = MAP_PRIVATE, 32 » MAP_PRIVATE = C.MAP_PRIVATE
29 » $MAP_FIXED = MAP_FIXED, 33 » MAP_FIXED = C.MAP_FIXED
30 34
31 » $MACH_MSG_TYPE_MOVE_RECEIVE = MACH_MSG_TYPE_MOVE_RECEIVE, 35 » MACH_MSG_TYPE_MOVE_RECEIVE = C.MACH_MSG_TYPE_MOVE_RECEIVE
32 » $MACH_MSG_TYPE_MOVE_SEND = MACH_MSG_TYPE_MOVE_SEND, 36 » MACH_MSG_TYPE_MOVE_SEND = C.MACH_MSG_TYPE_MOVE_SEND
33 » $MACH_MSG_TYPE_MOVE_SEND_ONCE = MACH_MSG_TYPE_MOVE_SEND_ONCE, 37 » MACH_MSG_TYPE_MOVE_SEND_ONCE = C.MACH_MSG_TYPE_MOVE_SEND_ONCE
34 » $MACH_MSG_TYPE_COPY_SEND = MACH_MSG_TYPE_COPY_SEND, 38 » MACH_MSG_TYPE_COPY_SEND = C.MACH_MSG_TYPE_COPY_SEND
35 » $MACH_MSG_TYPE_MAKE_SEND = MACH_MSG_TYPE_MAKE_SEND, 39 » MACH_MSG_TYPE_MAKE_SEND = C.MACH_MSG_TYPE_MAKE_SEND
36 » $MACH_MSG_TYPE_MAKE_SEND_ONCE = MACH_MSG_TYPE_MAKE_SEND_ONCE, 40 » MACH_MSG_TYPE_MAKE_SEND_ONCE = C.MACH_MSG_TYPE_MAKE_SEND_ONCE
37 » $MACH_MSG_TYPE_COPY_RECEIVE = MACH_MSG_TYPE_COPY_RECEIVE, 41 » MACH_MSG_TYPE_COPY_RECEIVE = C.MACH_MSG_TYPE_COPY_RECEIVE
38 42
39 » $MACH_MSG_PORT_DESCRIPTOR = MACH_MSG_PORT_DESCRIPTOR, 43 » MACH_MSG_PORT_DESCRIPTOR = C.MACH_MSG_PORT_DESCRIPTOR
40 » $MACH_MSG_OOL_DESCRIPTOR = MACH_MSG_OOL_DESCRIPTOR, 44 » MACH_MSG_OOL_DESCRIPTOR = C.MACH_MSG_OOL_DESCRIPTOR
41 » $MACH_MSG_OOL_PORTS_DESCRIPTOR = MACH_MSG_OOL_PORTS_DESCRIPTOR, 45 » MACH_MSG_OOL_PORTS_DESCRIPTOR = C.MACH_MSG_OOL_PORTS_DESCRIPTOR
42 » $MACH_MSG_OOL_VOLATILE_DESCRIPTOR = MACH_MSG_OOL_VOLATILE_DESCRIPTOR, 46 » MACH_MSG_OOL_VOLATILE_DESCRIPTOR = C.MACH_MSG_OOL_VOLATILE_DESCRIPTOR
43 47
44 » $MACH_MSGH_BITS_COMPLEX = MACH_MSGH_BITS_COMPLEX, 48 » MACH_MSGH_BITS_COMPLEX = C.MACH_MSGH_BITS_COMPLEX
45 49
46 » $MACH_SEND_MSG = MACH_SEND_MSG, 50 » MACH_SEND_MSG = C.MACH_SEND_MSG
47 » $MACH_RCV_MSG = MACH_RCV_MSG, 51 » MACH_RCV_MSG = C.MACH_RCV_MSG
48 » $MACH_RCV_LARGE = MACH_RCV_LARGE, 52 » MACH_RCV_LARGE = C.MACH_RCV_LARGE
49 53
50 » $MACH_SEND_TIMEOUT = MACH_SEND_TIMEOUT, 54 » MACH_SEND_TIMEOUT = C.MACH_SEND_TIMEOUT
51 » $MACH_SEND_INTERRUPT = MACH_SEND_INTERRUPT, 55 » MACH_SEND_INTERRUPT = C.MACH_SEND_INTERRUPT
52 » $MACH_SEND_CANCEL = MACH_SEND_CANCEL, 56 » MACH_SEND_CANCEL = C.MACH_SEND_CANCEL
53 » $MACH_SEND_ALWAYS = MACH_SEND_ALWAYS, 57 » MACH_SEND_ALWAYS = C.MACH_SEND_ALWAYS
54 » $MACH_SEND_TRAILER = MACH_SEND_TRAILER, 58 » MACH_SEND_TRAILER = C.MACH_SEND_TRAILER
55 » $MACH_RCV_TIMEOUT = MACH_RCV_TIMEOUT, 59 » MACH_RCV_TIMEOUT = C.MACH_RCV_TIMEOUT
56 » $MACH_RCV_NOTIFY = MACH_RCV_NOTIFY, 60 » MACH_RCV_NOTIFY = C.MACH_RCV_NOTIFY
57 » $MACH_RCV_INTERRUPT = MACH_RCV_INTERRUPT, 61 » MACH_RCV_INTERRUPT = C.MACH_RCV_INTERRUPT
58 » $MACH_RCV_OVERWRITE = MACH_RCV_OVERWRITE, 62 » MACH_RCV_OVERWRITE = C.MACH_RCV_OVERWRITE
59 63
60 » $NDR_PROTOCOL_2_0 = NDR_PROTOCOL_2_0, 64 » NDR_PROTOCOL_2_0 = C.NDR_PROTOCOL_2_0
61 » $NDR_INT_BIG_ENDIAN = NDR_INT_BIG_ENDIAN, 65 » NDR_INT_BIG_ENDIAN = C.NDR_INT_BIG_ENDIAN
62 » $NDR_INT_LITTLE_ENDIAN = NDR_INT_LITTLE_ENDIAN, 66 » NDR_INT_LITTLE_ENDIAN = C.NDR_INT_LITTLE_ENDIAN
63 » $NDR_FLOAT_IEEE = NDR_FLOAT_IEEE, 67 » NDR_FLOAT_IEEE = C.NDR_FLOAT_IEEE
64 » $NDR_CHAR_ASCII = NDR_CHAR_ASCII, 68 » NDR_CHAR_ASCII = C.NDR_CHAR_ASCII
65 69
66 » $SA_SIGINFO = SA_SIGINFO, 70 » SA_SIGINFO = C.SA_SIGINFO
67 » $SA_RESTART = SA_RESTART, 71 » SA_RESTART = C.SA_RESTART
68 » $SA_ONSTACK = SA_ONSTACK, 72 » SA_ONSTACK = C.SA_ONSTACK
69 » $SA_USERTRAMP = SA_USERTRAMP, 73 » SA_USERTRAMP = C.SA_USERTRAMP
70 » $SA_64REGSET = SA_64REGSET, 74 » SA_64REGSET = C.SA_64REGSET
71 »·······
72 » $SIGHUP = SIGHUP,
73 » $SIGINT = SIGINT,
74 » $SIGQUIT = SIGQUIT,
75 » $SIGILL = SIGILL,
76 » $SIGTRAP = SIGTRAP,
77 » $SIGABRT = SIGABRT,
78 » $SIGEMT = SIGEMT,
79 » $SIGFPE = SIGFPE,
80 » $SIGKILL = SIGKILL,
81 » $SIGBUS = SIGBUS,
82 » $SIGSEGV = SIGSEGV,
83 » $SIGSYS = SIGSYS,
84 » $SIGPIPE = SIGPIPE,
85 » $SIGALRM = SIGALRM,
86 » $SIGTERM = SIGTERM,
87 » $SIGURG = SIGURG,
88 » $SIGSTOP = SIGSTOP,
89 » $SIGTSTP = SIGTSTP,
90 » $SIGCONT = SIGCONT,
91 » $SIGCHLD = SIGCHLD,
92 » $SIGTTIN = SIGTTIN,
93 » $SIGTTOU = SIGTTOU,
94 » $SIGIO = SIGIO,
95 » $SIGXCPU = SIGXCPU,
96 » $SIGXFSZ = SIGXFSZ,
97 » $SIGVTALRM = SIGVTALRM,
98 » $SIGPROF = SIGPROF,
99 » $SIGWINCH = SIGWINCH,
100 » $SIGINFO = SIGINFO,
101 » $SIGUSR1 = SIGUSR1,
102 » $SIGUSR2 = SIGUSR2,
103 »·······
104 » $FPE_INTDIV = FPE_INTDIV,
105 » $FPE_INTOVF = FPE_INTOVF,
106 » $FPE_FLTDIV = FPE_FLTDIV,
107 » $FPE_FLTOVF = FPE_FLTOVF,
108 » $FPE_FLTUND = FPE_FLTUND,
109 » $FPE_FLTRES = FPE_FLTRES,
110 » $FPE_FLTINV = FPE_FLTINV,
111 » $FPE_FLTSUB = FPE_FLTSUB,
112 »·······
113 » $BUS_ADRALN = BUS_ADRALN,
114 » $BUS_ADRERR = BUS_ADRERR,
115 » $BUS_OBJERR = BUS_OBJERR,
116 »·······
117 » $SEGV_MAPERR = SEGV_MAPERR,
118 » $SEGV_ACCERR = SEGV_ACCERR,
119 »·······
120 » $ITIMER_REAL = ITIMER_REAL,
121 » $ITIMER_VIRTUAL = ITIMER_VIRTUAL,
122 » $ITIMER_PROF = ITIMER_PROF,
123 };
124 75
125 typedef mach_msg_body_t»$MachBody; 76 » SIGHUP = C.SIGHUP
126 typedef mach_msg_header_t» $MachHeader; 77 » SIGINT = C.SIGINT
127 typedef NDR_record_t» » $MachNDR; 78 » SIGQUIT = C.SIGQUIT
128 typedef mach_msg_port_descriptor_t» $MachPort; 79 » SIGILL = C.SIGILL
80 » SIGTRAP = C.SIGTRAP
81 » SIGABRT = C.SIGABRT
82 » SIGEMT = C.SIGEMT
83 » SIGFPE = C.SIGFPE
84 » SIGKILL = C.SIGKILL
85 » SIGBUS = C.SIGBUS
86 » SIGSEGV = C.SIGSEGV
87 » SIGSYS = C.SIGSYS
88 » SIGPIPE = C.SIGPIPE
89 » SIGALRM = C.SIGALRM
90 » SIGTERM = C.SIGTERM
91 » SIGURG = C.SIGURG
92 » SIGSTOP = C.SIGSTOP
93 » SIGTSTP = C.SIGTSTP
94 » SIGCONT = C.SIGCONT
95 » SIGCHLD = C.SIGCHLD
96 » SIGTTIN = C.SIGTTIN
97 » SIGTTOU = C.SIGTTOU
98 » SIGIO = C.SIGIO
99 » SIGXCPU = C.SIGXCPU
100 » SIGXFSZ = C.SIGXFSZ
101 » SIGVTALRM = C.SIGVTALRM
102 » SIGPROF = C.SIGPROF
103 » SIGWINCH = C.SIGWINCH
104 » SIGINFO = C.SIGINFO
105 » SIGUSR1 = C.SIGUSR1
106 » SIGUSR2 = C.SIGUSR2
129 107
130 typedef stack_t»$StackT; 108 » FPE_INTDIV = C.FPE_INTDIV
131 typedef union __sigaction_u» $Sighandler; 109 » FPE_INTOVF = C.FPE_INTOVF
110 » FPE_FLTDIV = C.FPE_FLTDIV
111 » FPE_FLTOVF = C.FPE_FLTOVF
112 » FPE_FLTUND = C.FPE_FLTUND
113 » FPE_FLTRES = C.FPE_FLTRES
114 » FPE_FLTINV = C.FPE_FLTINV
115 » FPE_FLTSUB = C.FPE_FLTSUB
132 116
133 typedef struct __sigaction» $Sigaction;» // used in syscalls 117 » BUS_ADRALN = C.BUS_ADRALN
134 // typedef struct sigaction» $Sigaction;» // used by the C library 118 » BUS_ADRERR = C.BUS_ADRERR
135 typedef union sigval $Sigval; 119 » BUS_OBJERR = C.BUS_OBJERR
136 typedef siginfo_t $Siginfo;
137 typedef struct timeval» $Timeval;
138 typedef struct itimerval» $Itimerval;
139 120
140 typedef struct fp_control $FPControl; 121 » SEGV_MAPERR = C.SEGV_MAPERR
141 typedef struct fp_status $FPStatus; 122 » SEGV_ACCERR = C.SEGV_ACCERR
142 typedef struct mmst_reg $RegMMST;
143 typedef struct xmm_reg $RegXMM;
144 123
145 #ifdef __LP64__ 124 » ITIMER_REAL = C.ITIMER_REAL
146 // amd64 125 » ITIMER_VIRTUAL = C.ITIMER_VIRTUAL
147 typedef x86_thread_state64_t» $Regs; 126 » ITIMER_PROF = C.ITIMER_PROF
148 typedef x86_float_state64_t $FloatState; 127 )
149 typedef x86_exception_state64_t $ExceptionState;
150 typedef struct mcontext64 $Mcontext;
151 #else
152 // 386
153 typedef x86_thread_state32_t» $Regs;
154 typedef x86_float_state32_t $FloatState;
155 typedef x86_exception_state32_t $ExceptionState;
156 typedef struct mcontext32 $Mcontext;
157 #endif
158 128
159 typedef ucontext_t» $Ucontext; 129 type MachBody C.mach_msg_body_t
130 type MachHeader C.mach_msg_header_t
131 type MachNDR C.NDR_record_t
132 type MachPort C.mach_msg_port_descriptor_t
133
134 type StackT C.struct_sigaltstack
135 type Sighandler C.union___sigaction_u
136
137 type Sigaction C.struct___sigaction // used in syscalls
138 // type Sigaction C.struct_sigaction» // used by the C library
139 type Sigval C.union_sigval
140 type Siginfo C.siginfo_t
141 type Timeval C.struct_timeval
142 type Itimerval C.struct_itimerval
143
144 type FPControl C.struct_fp_control
145 type FPStatus C.struct_fp_status
146 type RegMMST C.struct_mmst_reg
147 type RegXMM C.struct_xmm_reg
148
149 type Regs64 C.struct_x86_thread_state64
150 type FloatState64 C.struct_x86_float_state64
151 type ExceptionState64 C.struct_x86_exception_state64
152 type Mcontext64 C.struct_mcontext64
153
154 type Regs32 C.struct_i386_thread_state
155 type FloatState32 C.struct_i386_float_state
156 type ExceptionState32 C.struct_i386_exception_state
157 type Mcontext32 C.struct_mcontext32
158
159 type Ucontext C.struct_ucontext
OLDNEW
« no previous file with comments | « src/pkg/runtime/darwin/amd64/signal.c ('k') | src/pkg/runtime/freebsd/defs.go » ('j') | no next file with comments »

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