LEFT | RIGHT |
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 * basic types | 6 * basic types |
7 */ | 7 */ |
8 typedef signed char int8; | 8 typedef signed char int8; |
9 typedef unsigned char uint8; | 9 typedef unsigned char uint8; |
10 typedef signed short int16; | 10 typedef signed short int16; |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 { | 112 { |
113 true = 1, | 113 true = 1, |
114 false = 0, | 114 false = 0, |
115 }; | 115 }; |
116 | 116 |
117 /* | 117 /* |
118 * structures | 118 * structures |
119 */ | 119 */ |
120 struct Lock | 120 struct Lock |
121 { | 121 { |
| 122 #ifdef __WINDOWS__ |
| 123 M* waitm; // linked list of waiting M's |
| 124 #else |
122 uint32 key; | 125 uint32 key; |
123 #ifdef __WINDOWS__ | |
124 void* event; | |
125 #else | |
126 uint32 sema; // for OS X | 126 uint32 sema; // for OS X |
127 #endif | 127 #endif |
128 }; | 128 }; |
129 struct Usema | 129 struct Usema |
130 { | 130 { |
131 uint32 u; | 131 uint32 u; |
132 uint32 k; | 132 uint32 k; |
133 }; | 133 }; |
134 union Note | 134 union Note |
135 { | 135 { |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 M* alllink; // on allm | 245 M* alllink; // on allm |
246 M* schedlink; | 246 M* schedlink; |
247 uint32 machport; // Return address for Mach IPC (OS X) | 247 uint32 machport; // Return address for Mach IPC (OS X) |
248 MCache *mcache; | 248 MCache *mcache; |
249 FixAlloc *stackalloc; | 249 FixAlloc *stackalloc; |
250 G* lockedg; | 250 G* lockedg; |
251 G* idleg; | 251 G* idleg; |
252 uint32 freglo[16]; // D[i] lsb and F[i] | 252 uint32 freglo[16]; // D[i] lsb and F[i] |
253 uint32 freghi[16]; // D[i] msb and F[i+16] | 253 uint32 freghi[16]; // D[i] msb and F[i+16] |
254 uint32 fflag; // floating point compare flags | 254 uint32 fflag; // floating point compare flags |
| 255 |
255 #ifdef __WINDOWS__ | 256 #ifdef __WINDOWS__ |
256 » void*» hthread;» // thread handle | 257 » void*» thread;»» // thread handle |
257 » void*» hproftimer;» // sigprof timer | 258 » void*» event;» » // event for signalling |
| 259 » M*» nextwaitm;» // next M waiting for lock |
258 #endif | 260 #endif |
259 uintptr end[]; | 261 uintptr end[]; |
260 }; | 262 }; |
261 | 263 |
262 struct Stktop | 264 struct Stktop |
263 { | 265 { |
264 // The offsets of these fields are known to (hard-coded in) libmach. | 266 // The offsets of these fields are known to (hard-coded in) libmach. |
265 uint8* stackguard; | 267 uint8* stackguard; |
266 uint8* stackbase; | 268 uint8* stackbase; |
267 Gobuf gobuf; | 269 Gobuf gobuf; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 int32 frame; // stack frame size | 308 int32 frame; // stack frame size |
307 int32 args; // number of 32-bit in/out args | 309 int32 args; // number of 32-bit in/out args |
308 int32 locals; // number of 32-bit locals | 310 int32 locals; // number of 32-bit locals |
309 }; | 311 }; |
310 | 312 |
311 struct WinCall | 313 struct WinCall |
312 { | 314 { |
313 void (*fn)(void*); | 315 void (*fn)(void*); |
314 uintptr n; // number of parameters | 316 uintptr n; // number of parameters |
315 void* args; // parameters | 317 void* args; // parameters |
316 » uintptr»r;» // return value | 318 » uintptr»r1;» // return values |
| 319 » uintptr»r2; |
317 uintptr err; // error number | 320 uintptr err; // error number |
318 }; | 321 }; |
319 | 322 |
320 #ifdef __WINDOWS__ | 323 #ifdef __WINDOWS__ |
321 enum { | 324 enum { |
322 Windows = 1 | 325 Windows = 1 |
323 }; | 326 }; |
324 #else | 327 #else |
325 enum { | 328 enum { |
326 Windows = 0 | 329 Windows = 0 |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 | 645 |
643 Hchan* runtime·makechan_c(ChanType*, int64); | 646 Hchan* runtime·makechan_c(ChanType*, int64); |
644 void runtime·chansend(ChanType*, Hchan*, byte*, bool*); | 647 void runtime·chansend(ChanType*, Hchan*, byte*, bool*); |
645 void runtime·chanrecv(ChanType*, Hchan*, byte*, bool*, bool*); | 648 void runtime·chanrecv(ChanType*, Hchan*, byte*, bool*, bool*); |
646 int32 runtime·chanlen(Hchan*); | 649 int32 runtime·chanlen(Hchan*); |
647 int32 runtime·chancap(Hchan*); | 650 int32 runtime·chancap(Hchan*); |
648 bool runtime·showframe(Func*); | 651 bool runtime·showframe(Func*); |
649 | 652 |
650 void runtime·ifaceE2I(struct InterfaceType*, Eface, Iface*); | 653 void runtime·ifaceE2I(struct InterfaceType*, Eface, Iface*); |
651 | 654 |
LEFT | RIGHT |