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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 * defined types | 46 * defined types |
47 */ | 47 */ |
48 typedef uint8 bool; | 48 typedef uint8 bool; |
49 typedef uint8 byte; | 49 typedef uint8 byte; |
50 typedef struct Func Func; | 50 typedef struct Func Func; |
51 typedef struct G G; | 51 typedef struct G G; |
52 typedef struct Gobuf Gobuf; | 52 typedef struct Gobuf Gobuf; |
53 typedef struct Lock Lock; | 53 typedef struct Lock Lock; |
54 typedef struct M M; | 54 typedef struct M M; |
55 typedef struct P P; | 55 typedef struct P P; |
56 typedef struct Mem Mem; | |
57 typedef struct Note Note; | 56 typedef struct Note Note; |
58 typedef struct Slice Slice; | 57 typedef struct Slice Slice; |
59 typedef struct Stktop Stktop; | 58 typedef struct Stktop Stktop; |
60 typedef struct String String; | 59 typedef struct String String; |
61 typedef struct FuncVal FuncVal; | 60 typedef struct FuncVal FuncVal; |
62 typedef struct SigTab SigTab; | 61 typedef struct SigTab SigTab; |
63 typedef struct MCache MCache; | 62 typedef struct MCache MCache; |
64 typedef struct FixAlloc FixAlloc; | 63 typedef struct FixAlloc FixAlloc; |
65 typedef struct Iface Iface; | 64 typedef struct Iface Iface; |
66 typedef struct Itab Itab; | 65 typedef struct Itab Itab; |
(...skipping 13 matching lines...) Expand all Loading... |
80 typedef struct SEH SEH; | 79 typedef struct SEH SEH; |
81 typedef struct WinCallbackContext WinCallbackContext; | 80 typedef struct WinCallbackContext WinCallbackContext; |
82 typedef struct Timers Timers; | 81 typedef struct Timers Timers; |
83 typedef struct Timer Timer; | 82 typedef struct Timer Timer; |
84 typedef struct GCStats GCStats; | 83 typedef struct GCStats GCStats; |
85 typedef struct LFNode LFNode; | 84 typedef struct LFNode LFNode; |
86 typedef struct ParFor ParFor; | 85 typedef struct ParFor ParFor; |
87 typedef struct ParForThread ParForThread; | 86 typedef struct ParForThread ParForThread; |
88 typedef struct CgoMal CgoMal; | 87 typedef struct CgoMal CgoMal; |
89 typedef struct PollDesc PollDesc; | 88 typedef struct PollDesc PollDesc; |
| 89 typedef struct DebugVars DebugVars; |
90 | 90 |
91 /* | 91 /* |
92 * Per-CPU declaration. | 92 * Per-CPU declaration. |
93 * | 93 * |
94 * "extern register" is a special storage class implemented by 6c, 8c, etc. | 94 * "extern register" is a special storage class implemented by 6c, 8c, etc. |
95 * On the ARM, it is an actual register; elsewhere it is a slot in thread- | 95 * On the ARM, it is an actual register; elsewhere it is a slot in thread- |
96 * local storage indexed by a segment register. See zasmhdr in | 96 * local storage indexed by a segment register. See zasmhdr in |
97 * src/cmd/dist/buildruntime.c for details, and be aware that the linker may | 97 * src/cmd/dist/buildruntime.c for details, and be aware that the linker may |
98 * make further OS-specific changes to the compiler's output. For example, | 98 * make further OS-specific changes to the compiler's output. For example, |
99 * 6l/linux rewrites 0(GS) as -16(FS). | 99 * 6l/linux rewrites 0(GS) as -16(FS). |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 { | 141 { |
142 PtrSize = sizeof(void*), | 142 PtrSize = sizeof(void*), |
143 }; | 143 }; |
144 enum | 144 enum |
145 { | 145 { |
146 // Per-M stack segment cache size. | 146 // Per-M stack segment cache size. |
147 StackCacheSize = 32, | 147 StackCacheSize = 32, |
148 // Global <-> per-M stack segment cache transfer batch size. | 148 // Global <-> per-M stack segment cache transfer batch size. |
149 StackCacheBatch = 16, | 149 StackCacheBatch = 16, |
150 }; | 150 }; |
151 enum | |
152 { | |
153 // This value is generated by the linker and should be kept in | |
154 // sync with cmd/ld/lib.h | |
155 ArgsSizeUnknown = 0x80000000, | |
156 }; | |
157 /* | 151 /* |
158 * structures | 152 * structures |
159 */ | 153 */ |
160 struct Lock | 154 struct Lock |
161 { | 155 { |
162 // Futex-based impl treats it as uint32 key, | 156 // Futex-based impl treats it as uint32 key, |
163 // while sema-based impl as M* waitm. | 157 // while sema-based impl as M* waitm. |
164 // Used to be a union, but unions break precise GC. | 158 // Used to be a union, but unions break precise GC. |
165 uintptr key; | 159 uintptr key; |
166 }; | 160 }; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 struct GCStats | 215 struct GCStats |
222 { | 216 { |
223 // the struct must consist of only uint64's, | 217 // the struct must consist of only uint64's, |
224 // because it is casted to uint64[]. | 218 // because it is casted to uint64[]. |
225 uint64 nhandoff; | 219 uint64 nhandoff; |
226 uint64 nhandoffcnt; | 220 uint64 nhandoffcnt; |
227 uint64 nprocyield; | 221 uint64 nprocyield; |
228 uint64 nosyield; | 222 uint64 nosyield; |
229 uint64 nsleep; | 223 uint64 nsleep; |
230 }; | 224 }; |
| 225 |
| 226 struct WinCall |
| 227 { |
| 228 void (*fn)(void*); |
| 229 uintptr n; // number of parameters |
| 230 void* args; // parameters |
| 231 uintptr r1; // return values |
| 232 uintptr r2; |
| 233 uintptr err; // error number |
| 234 }; |
| 235 struct SEH |
| 236 { |
| 237 void* prev; |
| 238 void* handler; |
| 239 }; |
| 240 // describes how to handle callback |
| 241 struct WinCallbackContext |
| 242 { |
| 243 void* gobody; // Go function to call |
| 244 uintptr argsize; // callback arguments size (in bytes) |
| 245 uintptr restorestack; // adjust stack on return by (in bytes) (386 onl
y) |
| 246 }; |
| 247 |
231 struct G | 248 struct G |
232 { | 249 { |
233 // stackguard0 can be set to StackPreempt as opposed to stackguard | 250 // stackguard0 can be set to StackPreempt as opposed to stackguard |
234 uintptr stackguard0; // cannot move - also known to linker, libmach,
runtime/cgo | 251 uintptr stackguard0; // cannot move - also known to linker, libmach,
runtime/cgo |
235 uintptr stackbase; // cannot move - also known to libmach, runtime/
cgo | 252 uintptr stackbase; // cannot move - also known to libmach, runtime/
cgo |
236 Defer* defer; | 253 Defer* defer; |
237 Panic* panic; | 254 Panic* panic; |
238 Gobuf sched; | 255 Gobuf sched; |
239 » uintptr»gcstack;» » // if status==Gsyscall, gcstack = stackb
ase to use during gc | 256 » uintptr»syscallstack;» » // if status==Gsyscall, syscallstack = s
tackbase to use during gc |
240 » uintptr»gcsp;» » // if status==Gsyscall, gcsp = sched.sp to use d
uring gc | 257 » uintptr»syscallsp;» » // if status==Gsyscall, syscallsp = sche
d.sp to use during gc |
241 » uintptr»gcpc;» » // if status==Gsyscall, gcpc = sched.pc to use d
uring gc | 258 » uintptr»syscallpc;» » // if status==Gsyscall, syscallpc = sche
d.pc to use during gc |
242 » uintptr»gcguard;» » // if status==Gsyscall, gcguard = stackg
uard to use during gc | 259 » uintptr»syscallguard;» » // if status==Gsyscall, syscallguard = s
tackguard to use during gc |
243 uintptr stackguard; // same as stackguard0, but not set to StackPree
mpt | 260 uintptr stackguard; // same as stackguard0, but not set to StackPree
mpt |
244 uintptr stack0; | 261 uintptr stack0; |
245 G* alllink; // on allg | 262 G* alllink; // on allg |
246 void* param; // passed parameter on wakeup | 263 void* param; // passed parameter on wakeup |
247 int16 status; | 264 int16 status; |
248 int64 goid; | 265 int64 goid; |
249 uint32 selgen; // valid sudog pointer | 266 uint32 selgen; // valid sudog pointer |
250 int8* waitreason; // if status==Gwaiting | 267 int8* waitreason; // if status==Gwaiting |
251 G* schedlink; | 268 G* schedlink; |
252 bool ispanic; | 269 bool ispanic; |
253 bool issystem; // do not output in stack dump | 270 bool issystem; // do not output in stack dump |
254 bool isbackground; // ignore in deadlock detector | 271 bool isbackground; // ignore in deadlock detector |
255 » bool» blockingsyscall;» // hint that the next syscall will block | 272 » bool» preempt;» // preemption signal, duplicates stackguard0 = S
tackPreempt |
256 int8 raceignore; // ignore race detection events | 273 int8 raceignore; // ignore race detection events |
257 M* m; // for debuggers, but offset not hard-coded | 274 M* m; // for debuggers, but offset not hard-coded |
258 M* lockedm; | 275 M* lockedm; |
259 int32 sig; | 276 int32 sig; |
260 int32 writenbuf; | 277 int32 writenbuf; |
261 byte* writebuf; | 278 byte* writebuf; |
262 » DeferChunk» *dchunk; | 279 » DeferChunk*» dchunk; |
263 » DeferChunk» *dchunknext; | 280 » DeferChunk*» dchunknext; |
264 uintptr sigcode0; | 281 uintptr sigcode0; |
265 uintptr sigcode1; | 282 uintptr sigcode1; |
266 uintptr sigpc; | 283 uintptr sigpc; |
267 uintptr gopc; // pc of go statement that created this goroutine | 284 uintptr gopc; // pc of go statement that created this goroutine |
268 uintptr racectx; | 285 uintptr racectx; |
269 uintptr end[]; | 286 uintptr end[]; |
270 }; | 287 }; |
271 struct M | 288 struct M |
272 { | 289 { |
273 // The offsets of these fields are known to (hard-coded in) libmach. | |
274 G* g0; // goroutine with scheduling stack | 290 G* g0; // goroutine with scheduling stack |
275 void (*morepc)(void); | |
276 void* moreargp; // argument pointer for more stack | 291 void* moreargp; // argument pointer for more stack |
277 Gobuf morebuf; // gobuf arg to morestack | 292 Gobuf morebuf; // gobuf arg to morestack |
278 | 293 |
279 // Fields not known to debuggers. | 294 // Fields not known to debuggers. |
280 uint32 moreframesize; // size arguments to morestack | 295 uint32 moreframesize; // size arguments to morestack |
281 uint32 moreargsize; | 296 uint32 moreargsize; |
282 uintptr cret; // return value from C | 297 uintptr cret; // return value from C |
283 uint64 procid; // for debuggers, but offset not hard-coded | 298 uint64 procid; // for debuggers, but offset not hard-coded |
284 G* gsignal; // signal-handling G | 299 G* gsignal; // signal-handling G |
285 uintptr tls[4]; // thread-local storage (for x86 extern register
) | 300 uintptr tls[4]; // thread-local storage (for x86 extern register
) |
286 void (*mstartfn)(void); | 301 void (*mstartfn)(void); |
287 G* curg; // current running goroutine | 302 G* curg; // current running goroutine |
| 303 G* caughtsig; // goroutine running during fatal signal |
288 P* p; // attached P for executing Go code (nil if not
executing Go code) | 304 P* p; // attached P for executing Go code (nil if not
executing Go code) |
289 P* nextp; | 305 P* nextp; |
290 int32 id; | 306 int32 id; |
291 int32 mallocing; | 307 int32 mallocing; |
292 int32 throwing; | 308 int32 throwing; |
293 int32 gcing; | 309 int32 gcing; |
294 int32 locks; | 310 int32 locks; |
295 int32 nomemprof; | 311 int32 nomemprof; |
296 int32 dying; | 312 int32 dying; |
297 int32 profilehz; | 313 int32 profilehz; |
298 int32 helpgc; | 314 int32 helpgc; |
299 bool blockingsyscall; | |
300 bool spinning; | 315 bool spinning; |
301 uint32 fastrand; | 316 uint32 fastrand; |
302 uint64 ncgocall; // number of cgo calls in total | 317 uint64 ncgocall; // number of cgo calls in total |
303 int32 ncgo; // number of cgo calls currently in progress | 318 int32 ncgo; // number of cgo calls currently in progress |
304 CgoMal* cgomal; | 319 CgoMal* cgomal; |
305 Note park; | 320 Note park; |
306 M* alllink; // on allm | 321 M* alllink; // on allm |
307 M* schedlink; | 322 M* schedlink; |
308 uint32 machport; // Return address for Mach IPC (OS X) | 323 uint32 machport; // Return address for Mach IPC (OS X) |
309 » MCache» *mcache; | 324 » MCache*»mcache; |
310 int32 stackinuse; | 325 int32 stackinuse; |
311 uint32 stackcachepos; | 326 uint32 stackcachepos; |
312 uint32 stackcachecnt; | 327 uint32 stackcachecnt; |
313 void* stackcache[StackCacheSize]; | 328 void* stackcache[StackCacheSize]; |
314 G* lockedg; | 329 G* lockedg; |
315 uintptr createstack[32]; // Stack that created this thread. | 330 uintptr createstack[32]; // Stack that created this thread. |
316 uint32 freglo[16]; // D[i] lsb and F[i] | 331 uint32 freglo[16]; // D[i] lsb and F[i] |
317 uint32 freghi[16]; // D[i] msb and F[i+16] | 332 uint32 freghi[16]; // D[i] msb and F[i+16] |
318 uint32 fflag; // floating point compare flags | 333 uint32 fflag; // floating point compare flags |
319 uint32 locked; // tracking for LockOSThread | 334 uint32 locked; // tracking for LockOSThread |
320 M* nextwaitm; // next M waiting for lock | 335 M* nextwaitm; // next M waiting for lock |
321 uintptr waitsema; // semaphore for parking on locks | 336 uintptr waitsema; // semaphore for parking on locks |
322 uint32 waitsemacount; | 337 uint32 waitsemacount; |
323 uint32 waitsemalock; | 338 uint32 waitsemalock; |
324 GCStats gcstats; | 339 GCStats gcstats; |
325 bool racecall; | 340 bool racecall; |
326 bool needextram; | 341 bool needextram; |
327 void* racepc; | |
328 void (*waitunlockf)(Lock*); | 342 void (*waitunlockf)(Lock*); |
329 void* waitlock; | 343 void* waitlock; |
330 | 344 |
331 uintptr settype_buf[1024]; | 345 uintptr settype_buf[1024]; |
332 uintptr settype_bufsize; | 346 uintptr settype_bufsize; |
333 | 347 |
334 #ifdef GOOS_windows | 348 #ifdef GOOS_windows |
335 void* thread; // thread handle | 349 void* thread; // thread handle |
| 350 WinCall wincall; |
336 #endif | 351 #endif |
337 #ifdef GOOS_plan9 | 352 #ifdef GOOS_plan9 |
338 » int8*» » notesig; | 353 » int8*» notesig; |
339 byte* errstr; | 354 byte* errstr; |
340 #endif | 355 #endif |
341 SEH* seh; | 356 SEH* seh; |
342 uintptr end[]; | 357 uintptr end[]; |
343 }; | 358 }; |
344 | 359 |
345 struct P | 360 struct P |
346 { | 361 { |
347 Lock; | 362 Lock; |
348 | 363 |
349 » uint32» status; // one of Pidle/Prunning/... | 364 » int32» id; |
| 365 » uint32» status;»// one of Pidle/Prunning/... |
350 P* link; | 366 P* link; |
351 » uint32» tick; // incremented on every scheduler or system call | 367 » uint32» schedtick;» // incremented on every scheduler call |
| 368 » uint32» syscalltick;» // incremented on every system call |
352 M* m; // back-link to associated M (nil if idle) | 369 M* m; // back-link to associated M (nil if idle) |
353 MCache* mcache; | 370 MCache* mcache; |
354 | 371 |
355 // Queue of runnable goroutines. | 372 // Queue of runnable goroutines. |
356 G** runq; | 373 G** runq; |
357 int32 runqhead; | 374 int32 runqhead; |
358 int32 runqtail; | 375 int32 runqtail; |
359 int32 runqsize; | 376 int32 runqsize; |
360 | 377 |
361 // Available G's (status == Gdead) | 378 // Available G's (status == Gdead) |
362 G* gfree; | 379 G* gfree; |
363 int32 gfreecnt; | 380 int32 gfreecnt; |
364 | 381 |
365 byte pad[64]; | 382 byte pad[64]; |
366 }; | 383 }; |
367 | 384 |
368 // The m->locked word holds a single bit saying whether | 385 // The m->locked word holds two pieces of state counting active calls to LockOST
hread/lockOSThread. |
369 // external calls to LockOSThread are in effect, and then a counter | 386 // The low bit (LockExternal) is a boolean reporting whether any LockOSThread ca
ll is active. |
370 // of the internal nesting depth of lockOSThread / unlockOSThread. | 387 // External locks are not recursive; a second lock is silently ignored. |
| 388 // The upper bits of m->lockedcount record the nesting depth of calls to lockOST
hread |
| 389 // (counting up by LockInternal), popped by unlockOSThread (counting down by Loc
kInternal). |
| 390 // Internal locks can be recursive. For instance, a lock for cgo can occur while
the main |
| 391 // goroutine is holding the lock during the initialization phase. |
371 enum | 392 enum |
372 { | 393 { |
373 LockExternal = 1, | 394 LockExternal = 1, |
374 LockInternal = 2, | 395 LockInternal = 2, |
375 }; | 396 }; |
376 | 397 |
377 struct Stktop | 398 struct Stktop |
378 { | 399 { |
379 // The offsets of these fields are known to (hard-coded in) libmach. | 400 // The offsets of these fields are known to (hard-coded in) libmach. |
380 uintptr stackguard; | 401 uintptr stackguard; |
(...skipping 14 matching lines...) Expand all Loading... |
395 { | 416 { |
396 SigNotify = 1<<0, // let signal.Notify have signal, even if from k
ernel | 417 SigNotify = 1<<0, // let signal.Notify have signal, even if from k
ernel |
397 SigKill = 1<<1, // if signal.Notify doesn't take it, exit quietl
y | 418 SigKill = 1<<1, // if signal.Notify doesn't take it, exit quietl
y |
398 SigThrow = 1<<2, // if signal.Notify doesn't take it, exit loudly | 419 SigThrow = 1<<2, // if signal.Notify doesn't take it, exit loudly |
399 SigPanic = 1<<3, // if the signal is from the kernel, panic | 420 SigPanic = 1<<3, // if the signal is from the kernel, panic |
400 SigDefault = 1<<4, // if the signal isn't explicitly requested, don
't monitor it | 421 SigDefault = 1<<4, // if the signal isn't explicitly requested, don
't monitor it |
401 SigHandling = 1<<5, // our signal handler is registered | 422 SigHandling = 1<<5, // our signal handler is registered |
402 SigIgnored = 1<<6, // the signal was ignored before we registered f
or it | 423 SigIgnored = 1<<6, // the signal was ignored before we registered f
or it |
403 }; | 424 }; |
404 | 425 |
405 // NOTE(rsc): keep in sync with extern.go:/type.Func. | 426 // Layout of in-memory per-function information prepared by linker |
406 // Eventually, the loaded symbol table should be closer to this form. | 427 // See http://golang.org/s/go12symtab. |
| 428 // Keep in sync with linker and with ../../libmach/sym.c |
| 429 // and with package debug/gosym. |
407 struct Func | 430 struct Func |
408 { | 431 { |
409 » String» name; | 432 » uintptr»entry;» // start pc |
410 » String» type;» // go type string | 433 » int32» nameoff;» // function name |
411 » String» src;» // src file name | 434 »······· |
412 » Slice» pcln;» // pc/ln tab for this func | 435 » // TODO: Perhaps remove these fields. |
413 » uintptr»entry;» // entry pc | |
414 » uintptr»pc0;» // starting pc, ln for table | |
415 » int32» ln0; | |
416 » int32» frame;» // stack frame size | |
417 int32 args; // in/out args size | 436 int32 args; // in/out args size |
418 » int32» locals;»// locals size | 437 » int32» frame;» // legacy frame size; use pcsp if possible |
419 » Slice» ptrs;» // pointer map | 438 |
| 439 » int32» pcsp; |
| 440 » int32» pcfile; |
| 441 » int32» pcln; |
| 442 » int32» npcdata; |
| 443 » int32» nfuncdata; |
420 }; | 444 }; |
421 | 445 |
422 // layout of Itab known to compilers | 446 // layout of Itab known to compilers |
423 // allocated in non-garbage-collected memory | 447 // allocated in non-garbage-collected memory |
424 struct Itab | 448 struct Itab |
425 { | 449 { |
426 InterfaceType* inter; | 450 InterfaceType* inter; |
427 Type* type; | 451 Type* type; |
428 Itab* link; | 452 Itab* link; |
429 int32 bad; | 453 int32 bad; |
430 int32 unused; | 454 int32 unused; |
431 void (*fun[])(void); | 455 void (*fun[])(void); |
432 }; | |
433 | |
434 struct WinCall | |
435 { | |
436 void (*fn)(void*); | |
437 uintptr n; // number of parameters | |
438 void* args; // parameters | |
439 uintptr r1; // return values | |
440 uintptr r2; | |
441 uintptr err; // error number | |
442 }; | |
443 struct SEH | |
444 { | |
445 void* prev; | |
446 void* handler; | |
447 }; | |
448 // describes how to handle callback | |
449 struct WinCallbackContext | |
450 { | |
451 void* gobody; // Go function to call | |
452 uintptr argsize; // callback arguments size (in bytes) | |
453 uintptr restorestack; // adjust stack on return by (in bytes) (386 onl
y) | |
454 }; | 456 }; |
455 | 457 |
456 #ifdef GOOS_windows | 458 #ifdef GOOS_windows |
457 enum { | 459 enum { |
458 Windows = 1 | 460 Windows = 1 |
459 }; | 461 }; |
460 #else | 462 #else |
461 enum { | 463 enum { |
462 Windows = 0 | 464 Windows = 0 |
463 }; | 465 }; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 uint64 nosyield; | 520 uint64 nosyield; |
519 uint64 nsleep; | 521 uint64 nsleep; |
520 }; | 522 }; |
521 | 523 |
522 // Track memory allocated by code not written in Go during a cgo call, | 524 // Track memory allocated by code not written in Go during a cgo call, |
523 // so that the garbage collector can see them. | 525 // so that the garbage collector can see them. |
524 struct CgoMal | 526 struct CgoMal |
525 { | 527 { |
526 CgoMal *next; | 528 CgoMal *next; |
527 void *alloc; | 529 void *alloc; |
| 530 }; |
| 531 |
| 532 // Holds variables parsed from GODEBUG env var. |
| 533 struct DebugVars |
| 534 { |
| 535 int32 gctrace; |
| 536 int32 schedtrace; |
| 537 int32 scheddetail; |
528 }; | 538 }; |
529 | 539 |
530 /* | 540 /* |
531 * defined macros | 541 * defined macros |
532 * you need super-gopher-guru privilege | 542 * you need super-gopher-guru privilege |
533 * to add this list. | 543 * to add this list. |
534 */ | 544 */ |
535 #define nelem(x) (sizeof(x)/sizeof((x)[0])) | 545 #define nelem(x) (sizeof(x)/sizeof((x)[0])) |
536 #define nil ((void*)0) | 546 #define nil ((void*)0) |
537 #define offsetof(s,m) (uint32)(&(((s*)0)->m)) | 547 #define offsetof(s,m) (uint32)(&(((s*)0)->m)) |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 * stack traces | 674 * stack traces |
665 */ | 675 */ |
666 typedef struct Stkframe Stkframe; | 676 typedef struct Stkframe Stkframe; |
667 struct Stkframe | 677 struct Stkframe |
668 { | 678 { |
669 Func* fn; // function being run | 679 Func* fn; // function being run |
670 uintptr pc; // program counter within fn | 680 uintptr pc; // program counter within fn |
671 uintptr lr; // program counter at caller aka link register | 681 uintptr lr; // program counter at caller aka link register |
672 uintptr sp; // stack pointer at pc | 682 uintptr sp; // stack pointer at pc |
673 uintptr fp; // stack pointer at caller aka frame pointer | 683 uintptr fp; // stack pointer at caller aka frame pointer |
| 684 byte* varp; // top of local variables |
674 byte* argp; // pointer to function arguments | 685 byte* argp; // pointer to function arguments |
675 uintptr arglen; // number of bytes at argp | 686 uintptr arglen; // number of bytes at argp |
676 » byte*» varp;» // pointer to local variables | 687 }; |
677 » uintptr»varlen;»// number of bytes at varp | 688 |
678 }; | 689 int32» runtime·gentraceback(uintptr, uintptr, uintptr, G*, int32, uintptr*, int
32, void(*)(Stkframe*, void*), void*, bool); |
679 | |
680 int32» runtime·gentraceback(uintptr, uintptr, uintptr, G*, int32, uintptr*, int
32, void(*)(Stkframe*, void*), void*); | |
681 void runtime·traceback(uintptr pc, uintptr sp, uintptr lr, G* gp); | 690 void runtime·traceback(uintptr pc, uintptr sp, uintptr lr, G* gp); |
682 void runtime·tracebackothers(G*); | 691 void runtime·tracebackothers(G*); |
683 bool runtime·haszeroargs(uintptr pc); | 692 bool runtime·haszeroargs(uintptr pc); |
| 693 bool runtime·topofstack(Func*); |
684 | 694 |
685 /* | 695 /* |
686 * external data | 696 * external data |
687 */ | 697 */ |
688 extern String runtime·emptystring; | 698 extern String runtime·emptystring; |
689 extern uintptr runtime·zerobase; | 699 extern uintptr runtime·zerobase; |
690 extern G* runtime·allg; | 700 extern G* runtime·allg; |
691 extern G* runtime·lastg; | 701 extern G* runtime·lastg; |
692 extern M* runtime·allm; | 702 extern M* runtime·allm; |
693 extern P** runtime·allp; | 703 extern P** runtime·allp; |
694 extern int32 runtime·gomaxprocs; | 704 extern int32 runtime·gomaxprocs; |
695 extern uint32 runtime·needextram; | 705 extern uint32 runtime·needextram; |
696 extern bool runtime·singleproc; | |
697 extern uint32 runtime·panicking; | 706 extern uint32 runtime·panicking; |
698 extern uint32 runtime·gcwaiting; // gc is waiting to run | 707 extern uint32 runtime·gcwaiting; // gc is waiting to run |
699 extern int8* runtime·goos; | 708 extern int8* runtime·goos; |
700 extern int32 runtime·ncpu; | 709 extern int32 runtime·ncpu; |
701 extern bool runtime·iscgo; | 710 extern bool runtime·iscgo; |
702 extern bool runtime·islibrary; | 711 extern bool runtime·islibrary; |
703 extern void (*runtime·sysargs)(int32, uint8**); | 712 extern void (*runtime·sysargs)(int32, uint8**); |
704 extern» uint32» runtime·maxstring; | 713 extern» uintptr»runtime·maxstring; |
705 extern uint32 runtime·Hchansize; | 714 extern uint32 runtime·Hchansize; |
706 extern uint32 runtime·cpuid_ecx; | 715 extern uint32 runtime·cpuid_ecx; |
707 extern uint32 runtime·cpuid_edx; | 716 extern uint32 runtime·cpuid_edx; |
| 717 extern DebugVars runtime·debug; |
708 | 718 |
709 /* | 719 /* |
710 * common functions and data | 720 * common functions and data |
711 */ | 721 */ |
712 int32 runtime·strcmp(byte*, byte*); | 722 int32 runtime·strcmp(byte*, byte*); |
713 byte* runtime·strstr(byte*, byte*); | 723 byte* runtime·strstr(byte*, byte*); |
714 int32» runtime·findnull(byte*); | 724 intgo» runtime·findnull(byte*); |
715 int32» runtime·findnullw(uint16*); | 725 intgo» runtime·findnullw(uint16*); |
716 void runtime·dump(byte*, int32); | 726 void runtime·dump(byte*, int32); |
717 int32 runtime·runetochar(byte*, int32); | 727 int32 runtime·runetochar(byte*, int32); |
718 int32 runtime·charntorune(int32*, uint8*, int32); | 728 int32 runtime·charntorune(int32*, uint8*, int32); |
719 | 729 |
720 /* | 730 /* |
721 * very low level c-called | 731 * very low level c-called |
722 */ | 732 */ |
723 #define FLUSH(x) USED(x) | 733 #define FLUSH(x) USED(x) |
724 | 734 |
725 void runtime·gogo(Gobuf*); | 735 void runtime·gogo(Gobuf*); |
(...skipping 23 matching lines...) Expand all Loading... |
749 void runtime·sigenable(uint32 sig); | 759 void runtime·sigenable(uint32 sig); |
750 void runtime·sigdisable(uint32 sig); | 760 void runtime·sigdisable(uint32 sig); |
751 int32 runtime·gotraceback(bool *crash); | 761 int32 runtime·gotraceback(bool *crash); |
752 void runtime·goroutineheader(G*); | 762 void runtime·goroutineheader(G*); |
753 int32 runtime·open(int8*, int32, int32); | 763 int32 runtime·open(int8*, int32, int32); |
754 int32 runtime·read(int32, void*, int32); | 764 int32 runtime·read(int32, void*, int32); |
755 int32 runtime·write(int32, void*, int32); | 765 int32 runtime·write(int32, void*, int32); |
756 int32 runtime·close(int32); | 766 int32 runtime·close(int32); |
757 int32 runtime·mincore(void*, uintptr, byte*); | 767 int32 runtime·mincore(void*, uintptr, byte*); |
758 bool runtime·cas(uint32*, uint32, uint32); | 768 bool runtime·cas(uint32*, uint32, uint32); |
759 bool» runtime·cas64(uint64*, uint64*, uint64); | 769 bool» runtime·cas64(uint64*, uint64, uint64); |
760 bool runtime·casp(void**, void*, void*); | 770 bool runtime·casp(void**, void*, void*); |
761 // Don't confuse with XADD x86 instruction, | 771 // Don't confuse with XADD x86 instruction, |
762 // this one is actually 'addx', that is, add-and-fetch. | 772 // this one is actually 'addx', that is, add-and-fetch. |
763 uint32 runtime·xadd(uint32 volatile*, int32); | 773 uint32 runtime·xadd(uint32 volatile*, int32); |
764 uint64 runtime·xadd64(uint64 volatile*, int64); | 774 uint64 runtime·xadd64(uint64 volatile*, int64); |
765 uint32 runtime·xchg(uint32 volatile*, uint32); | 775 uint32 runtime·xchg(uint32 volatile*, uint32); |
766 uint64 runtime·xchg64(uint64 volatile*, uint64); | 776 uint64 runtime·xchg64(uint64 volatile*, uint64); |
767 uint32 runtime·atomicload(uint32 volatile*); | 777 uint32 runtime·atomicload(uint32 volatile*); |
768 void runtime·atomicstore(uint32 volatile*, uint32); | 778 void runtime·atomicstore(uint32 volatile*, uint32); |
769 void runtime·atomicstore64(uint64 volatile*, uint64); | 779 void runtime·atomicstore64(uint64 volatile*, uint64); |
770 uint64 runtime·atomicload64(uint64 volatile*); | 780 uint64 runtime·atomicload64(uint64 volatile*); |
771 void* runtime·atomicloadp(void* volatile*); | 781 void* runtime·atomicloadp(void* volatile*); |
772 void runtime·atomicstorep(void* volatile*, void*); | 782 void runtime·atomicstorep(void* volatile*, void*); |
773 void runtime·jmpdefer(FuncVal*, void*); | 783 void runtime·jmpdefer(FuncVal*, void*); |
774 void runtime·exit1(int32); | 784 void runtime·exit1(int32); |
775 void runtime·ready(G*); | 785 void runtime·ready(G*); |
776 byte* runtime·getenv(int8*); | 786 byte* runtime·getenv(int8*); |
777 int32 runtime·atoi(byte*); | 787 int32 runtime·atoi(byte*); |
778 void runtime·newosproc(M *mp, void *stk); | 788 void runtime·newosproc(M *mp, void *stk); |
779 void runtime·mstart(void); | 789 void runtime·mstart(void); |
780 G* runtime·malg(int32); | 790 G* runtime·malg(int32); |
781 void runtime·asminit(void); | 791 void runtime·asminit(void); |
782 void runtime·mpreinit(M*); | 792 void runtime·mpreinit(M*); |
783 void runtime·minit(void); | 793 void runtime·minit(void); |
784 void runtime·unminit(void); | 794 void runtime·unminit(void); |
785 void runtime·signalstack(byte*, int32); | 795 void runtime·signalstack(byte*, int32); |
786 void runtime·symtabinit(void); | 796 void runtime·symtabinit(void); |
787 Func* runtime·findfunc(uintptr); | 797 Func* runtime·findfunc(uintptr); |
788 int32» runtime·funcline(Func*, uintptr); | 798 int32» runtime·funcline(Func*, uintptr, String*); |
| 799 int32» runtime·funcarglen(Func*, uintptr); |
| 800 int32» runtime·funcspdelta(Func*, uintptr); |
| 801 int8*» runtime·funcname(Func*); |
789 void* runtime·stackalloc(uint32); | 802 void* runtime·stackalloc(uint32); |
790 void runtime·stackfree(void*, uintptr); | 803 void runtime·stackfree(void*, uintptr); |
791 MCache* runtime·allocmcache(void); | 804 MCache* runtime·allocmcache(void); |
792 void runtime·freemcache(MCache*); | 805 void runtime·freemcache(MCache*); |
793 void runtime·mallocinit(void); | 806 void runtime·mallocinit(void); |
794 void runtime·mprofinit(void); | 807 void runtime·mprofinit(void); |
795 bool runtime·ifaceeq_c(Iface, Iface); | 808 bool runtime·ifaceeq_c(Iface, Iface); |
796 bool runtime·efaceeq_c(Eface, Eface); | 809 bool runtime·efaceeq_c(Eface, Eface); |
797 uintptr runtime·ifacehash(Iface, uintptr); | 810 uintptr runtime·ifacehash(Iface, uintptr); |
798 uintptr runtime·efacehash(Eface, uintptr); | 811 uintptr runtime·efacehash(Eface, uintptr); |
799 void* runtime·malloc(uintptr size); | 812 void* runtime·malloc(uintptr size); |
800 void runtime·free(void *v); | 813 void runtime·free(void *v); |
801 bool runtime·addfinalizer(void*, FuncVal *fn, uintptr); | |
802 void runtime·runpanic(Panic*); | 814 void runtime·runpanic(Panic*); |
803 uintptr runtime·getcallersp(void*); | 815 uintptr runtime·getcallersp(void*); |
804 int32 runtime·mcount(void); | 816 int32 runtime·mcount(void); |
805 int32 runtime·gcount(void); | 817 int32 runtime·gcount(void); |
806 void runtime·mcall(void(*)(G*)); | 818 void runtime·mcall(void(*)(G*)); |
807 uint32 runtime·fastrand1(void); | 819 uint32 runtime·fastrand1(void); |
| 820 void runtime·rewindmorestack(Gobuf*); |
| 821 int32 runtime·timediv(int64, int32, int32*); |
808 | 822 |
809 void runtime·setmg(M*, G*); | 823 void runtime·setmg(M*, G*); |
810 void runtime·newextram(void); | 824 void runtime·newextram(void); |
811 void runtime·exit(int32); | 825 void runtime·exit(int32); |
812 void runtime·breakpoint(void); | 826 void runtime·breakpoint(void); |
813 void runtime·gosched(void); | 827 void runtime·gosched(void); |
| 828 void runtime·gosched0(G*); |
| 829 void runtime·schedtrace(bool); |
814 void runtime·park(void(*)(Lock*), Lock*, int8*); | 830 void runtime·park(void(*)(Lock*), Lock*, int8*); |
815 void runtime·tsleep(int64, int8*); | 831 void runtime·tsleep(int64, int8*); |
816 M* runtime·newm(void); | 832 M* runtime·newm(void); |
817 void runtime·goexit(void); | 833 void runtime·goexit(void); |
818 void runtime·asmcgocall(void (*fn)(void*), void*); | 834 void runtime·asmcgocall(void (*fn)(void*), void*); |
819 void runtime·entersyscall(void); | 835 void runtime·entersyscall(void); |
820 void runtime·entersyscallblock(void); | 836 void runtime·entersyscallblock(void); |
821 void runtime·exitsyscall(void); | 837 void runtime·exitsyscall(void); |
822 G* runtime·newproc1(FuncVal*, byte*, int32, int32, void*); | 838 G* runtime·newproc1(FuncVal*, byte*, int32, int32, void*); |
823 bool runtime·sigsend(int32 sig); | 839 bool runtime·sigsend(int32 sig); |
824 int32 runtime·callers(int32, uintptr*, int32); | 840 int32 runtime·callers(int32, uintptr*, int32); |
825 int64 runtime·nanotime(void); | 841 int64 runtime·nanotime(void); |
826 void runtime·dopanic(int32); | 842 void runtime·dopanic(int32); |
827 void runtime·startpanic(void); | 843 void runtime·startpanic(void); |
| 844 void runtime·freezetheworld(void); |
828 void runtime·unwindstack(G*, byte*); | 845 void runtime·unwindstack(G*, byte*); |
829 void runtime·sigprof(uint8 *pc, uint8 *sp, uint8 *lr, G *gp); | 846 void runtime·sigprof(uint8 *pc, uint8 *sp, uint8 *lr, G *gp); |
830 void runtime·resetcpuprofiler(int32); | 847 void runtime·resetcpuprofiler(int32); |
831 void runtime·setcpuprofilerate(void(*)(uintptr*, int32), int32); | 848 void runtime·setcpuprofilerate(void(*)(uintptr*, int32), int32); |
832 void runtime·usleep(uint32); | 849 void runtime·usleep(uint32); |
833 int64 runtime·cputicks(void); | 850 int64 runtime·cputicks(void); |
834 int64 runtime·tickspersecond(void); | 851 int64 runtime·tickspersecond(void); |
835 void runtime·blockevent(int64, int32); | 852 void runtime·blockevent(int64, int32); |
836 extern int64 runtime·blockprofilerate; | 853 extern int64 runtime·blockprofilerate; |
837 void runtime·addtimer(Timer*); | 854 void runtime·addtimer(Timer*); |
838 bool runtime·deltimer(Timer*); | 855 bool runtime·deltimer(Timer*); |
839 G* runtime·netpoll(bool); | 856 G* runtime·netpoll(bool); |
840 void runtime·netpollinit(void); | 857 void runtime·netpollinit(void); |
841 int32 runtime·netpollopen(uintptr, PollDesc*); | 858 int32 runtime·netpollopen(uintptr, PollDesc*); |
842 int32 runtime·netpollclose(uintptr); | 859 int32 runtime·netpollclose(uintptr); |
843 void runtime·netpollready(G**, PollDesc*, int32); | 860 void runtime·netpollready(G**, PollDesc*, int32); |
| 861 uintptr runtime·netpollfd(PollDesc*); |
844 void runtime·crash(void); | 862 void runtime·crash(void); |
| 863 void runtime·parsedebugvars(void); |
845 void _rt0_go(void); | 864 void _rt0_go(void); |
| 865 void* runtime·funcdata(Func*, int32); |
846 | 866 |
847 #pragma varargck argpos runtime·printf 1 | 867 #pragma varargck argpos runtime·printf 1 |
848 #pragma varargck type "c" int32 | 868 #pragma varargck type "c" int32 |
849 #pragma varargck type "d" int32 | 869 #pragma varargck type "d" int32 |
850 #pragma varargck type "d" uint32 | 870 #pragma varargck type "d" uint32 |
851 #pragma varargck type "D" int64 | 871 #pragma varargck type "D" int64 |
852 #pragma varargck type "D" uint64 | 872 #pragma varargck type "D" uint64 |
853 #pragma varargck type "x" int32 | 873 #pragma varargck type "x" int32 |
854 #pragma varargck type "x" uint32 | 874 #pragma varargck type "x" uint32 |
855 #pragma varargck type "X" int64 | 875 #pragma varargck type "X" int64 |
(...skipping 28 matching lines...) Expand all Loading... |
884 * subsequent noteclear must be called only after | 904 * subsequent noteclear must be called only after |
885 * previous notesleep has returned, e.g. it's disallowed | 905 * previous notesleep has returned, e.g. it's disallowed |
886 * to call noteclear straight after notewakeup. | 906 * to call noteclear straight after notewakeup. |
887 * | 907 * |
888 * notetsleep is like notesleep but wakes up after | 908 * notetsleep is like notesleep but wakes up after |
889 * a given number of nanoseconds even if the event | 909 * a given number of nanoseconds even if the event |
890 * has not yet happened. if a goroutine uses notetsleep to | 910 * has not yet happened. if a goroutine uses notetsleep to |
891 * wake up early, it must wait to call noteclear until it | 911 * wake up early, it must wait to call noteclear until it |
892 * can be sure that no other goroutine is calling | 912 * can be sure that no other goroutine is calling |
893 * notewakeup. | 913 * notewakeup. |
| 914 * |
| 915 * notesleep/notetsleep are generally called on g0, |
| 916 * notetsleepg is similar to notetsleep but is called on user g. |
894 */ | 917 */ |
895 void runtime·noteclear(Note*); | 918 void runtime·noteclear(Note*); |
896 void runtime·notesleep(Note*); | 919 void runtime·notesleep(Note*); |
897 void runtime·notewakeup(Note*); | 920 void runtime·notewakeup(Note*); |
898 bool runtime·notetsleep(Note*, int64); // false - timeout | 921 bool runtime·notetsleep(Note*, int64); // false - timeout |
| 922 bool runtime·notetsleepg(Note*, int64); // false - timeout |
899 | 923 |
900 /* | 924 /* |
901 * low-level synchronization for implementing the above | 925 * low-level synchronization for implementing the above |
902 */ | 926 */ |
903 uintptr runtime·semacreate(void); | 927 uintptr runtime·semacreate(void); |
904 int32 runtime·semasleep(int64); | 928 int32 runtime·semasleep(int64); |
905 void runtime·semawakeup(M*); | 929 void runtime·semawakeup(M*); |
906 // or | 930 // or |
907 void runtime·futexsleep(uint32*, uint32, int64); | 931 void runtime·futexsleep(uint32*, uint32, int64); |
908 void runtime·futexwakeup(uint32*, uint32); | 932 void runtime·futexwakeup(uint32*, uint32); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 void runtime·printint(int64); | 981 void runtime·printint(int64); |
958 void runtime·printiface(Iface); | 982 void runtime·printiface(Iface); |
959 void runtime·printeface(Eface); | 983 void runtime·printeface(Eface); |
960 void runtime·printstring(String); | 984 void runtime·printstring(String); |
961 void runtime·printpc(void*); | 985 void runtime·printpc(void*); |
962 void runtime·printpointer(void*); | 986 void runtime·printpointer(void*); |
963 void runtime·printuint(uint64); | 987 void runtime·printuint(uint64); |
964 void runtime·printhex(uint64); | 988 void runtime·printhex(uint64); |
965 void runtime·printslice(Slice); | 989 void runtime·printslice(Slice); |
966 void runtime·printcomplex(Complex128); | 990 void runtime·printcomplex(Complex128); |
| 991 void runtime·newstackcall(FuncVal*, byte*, uint32); |
967 void reflect·call(FuncVal*, byte*, uint32); | 992 void reflect·call(FuncVal*, byte*, uint32); |
968 void runtime·panic(Eface); | 993 void runtime·panic(Eface); |
969 void runtime·panicindex(void); | 994 void runtime·panicindex(void); |
970 void runtime·panicslice(void); | 995 void runtime·panicslice(void); |
971 | 996 |
972 /* | 997 /* |
973 * runtime c-called (but written in Go) | 998 * runtime c-called (but written in Go) |
974 */ | 999 */ |
975 void runtime·printany(Eface); | 1000 void runtime·printany(Eface); |
976 void runtime·newTypeAssertionError(String*, String*, String*, String*, Eface*
); | 1001 void runtime·newTypeAssertionError(String*, String*, String*, String*, Eface*
); |
(...skipping 16 matching lines...) Expand all Loading... |
993 float64 runtime·NaN(void); | 1018 float64 runtime·NaN(void); |
994 float32 runtime·float32frombits(uint32 i); | 1019 float32 runtime·float32frombits(uint32 i); |
995 uint32 runtime·float32tobits(float32 f); | 1020 uint32 runtime·float32tobits(float32 f); |
996 float64 runtime·float64frombits(uint64 i); | 1021 float64 runtime·float64frombits(uint64 i); |
997 uint64 runtime·float64tobits(float64 f); | 1022 uint64 runtime·float64tobits(float64 f); |
998 float64 runtime·frexp(float64 d, int32 *ep); | 1023 float64 runtime·frexp(float64 d, int32 *ep); |
999 bool runtime·isInf(float64 f, int32 sign); | 1024 bool runtime·isInf(float64 f, int32 sign); |
1000 bool runtime·isNaN(float64 f); | 1025 bool runtime·isNaN(float64 f); |
1001 float64 runtime·ldexp(float64 d, int32 e); | 1026 float64 runtime·ldexp(float64 d, int32 e); |
1002 float64 runtime·modf(float64 d, float64 *ip); | 1027 float64 runtime·modf(float64 d, float64 *ip); |
1003 void» runtime·semacquire(uint32*); | 1028 void» runtime·semacquire(uint32*, bool); |
1004 void runtime·semrelease(uint32*); | 1029 void runtime·semrelease(uint32*); |
1005 int32 runtime·gomaxprocsfunc(int32 n); | 1030 int32 runtime·gomaxprocsfunc(int32 n); |
1006 void runtime·procyield(uint32); | 1031 void runtime·procyield(uint32); |
1007 void runtime·osyield(void); | 1032 void runtime·osyield(void); |
1008 void runtime·lockOSThread(void); | 1033 void runtime·lockOSThread(void); |
1009 void runtime·unlockOSThread(void); | 1034 void runtime·unlockOSThread(void); |
1010 | 1035 |
1011 void runtime·mapassign(MapType*, Hmap*, byte*, byte*); | 1036 void runtime·mapassign(MapType*, Hmap*, byte*, byte*); |
1012 void runtime·mapaccess(MapType*, Hmap*, byte*, byte*, bool*); | 1037 void runtime·mapaccess(MapType*, Hmap*, byte*, byte*, bool*); |
1013 void runtime·mapiternext(struct hash_iter*); | 1038 void runtime·mapiternext(struct hash_iter*); |
1014 bool runtime·mapiterkey(struct hash_iter*, void*); | 1039 bool runtime·mapiterkey(struct hash_iter*, void*); |
1015 Hmap* runtime·makemap_c(MapType*, int64); | 1040 Hmap* runtime·makemap_c(MapType*, int64); |
1016 | 1041 |
1017 Hchan* runtime·makechan_c(ChanType*, int64); | 1042 Hchan* runtime·makechan_c(ChanType*, int64); |
1018 void runtime·chansend(ChanType*, Hchan*, byte*, bool*, void*); | 1043 void runtime·chansend(ChanType*, Hchan*, byte*, bool*, void*); |
1019 void runtime·chanrecv(ChanType*, Hchan*, byte*, bool*, bool*); | 1044 void runtime·chanrecv(ChanType*, Hchan*, byte*, bool*, bool*); |
1020 bool» runtime·showframe(Func*, bool); | 1045 bool» runtime·showframe(Func*, G*); |
| 1046 void» runtime·printcreatedby(G*); |
1021 | 1047 |
1022 void runtime·ifaceE2I(InterfaceType*, Eface, Iface*); | 1048 void runtime·ifaceE2I(InterfaceType*, Eface, Iface*); |
1023 | 1049 bool» runtime·ifaceE2I2(InterfaceType*, Eface, Iface*); |
1024 uintptr runtime·memlimit(void); | 1050 uintptr runtime·memlimit(void); |
1025 | |
1026 // If appropriate, ask the operating system to control whether this | |
1027 // thread should receive profiling signals. This is only necessary on OS X. | |
1028 // An operating system should not deliver a profiling signal to a | |
1029 // thread that is not actually executing (what good is that?), but that's | |
1030 // what OS X prefers to do. When profiling is turned on, we mask | |
1031 // away the profiling signal when threads go to sleep, so that OS X | |
1032 // is forced to deliver the signal to a thread that's actually running. | |
1033 // This is a no-op on other systems. | |
1034 void runtime·setprof(bool); | |
1035 | 1051 |
1036 // float.c | 1052 // float.c |
1037 extern float64 runtime·nan; | 1053 extern float64 runtime·nan; |
1038 extern float64 runtime·posinf; | 1054 extern float64 runtime·posinf; |
1039 extern float64 runtime·neginf; | 1055 extern float64 runtime·neginf; |
1040 extern uint64 ·nan; | 1056 extern uint64 ·nan; |
1041 extern uint64 ·posinf; | 1057 extern uint64 ·posinf; |
1042 extern uint64 ·neginf; | 1058 extern uint64 ·neginf; |
1043 #define ISNAN(f) ((f) != (f)) | 1059 #define ISNAN(f) ((f) != (f)) |
1044 | 1060 |
1045 enum | 1061 enum |
1046 { | 1062 { |
1047 UseSpanType = 1, | 1063 UseSpanType = 1, |
1048 }; | 1064 }; |
LEFT | RIGHT |