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 #include "runtime.h" | 5 #include "runtime.h" |
6 #include "arch_GOARCH.h" | 6 #include "arch_GOARCH.h" |
7 #include "../../cmd/ld/textflag.h" | 7 #include "../../cmd/ld/textflag.h" |
8 | 8 |
9 enum { | 9 enum { |
10 maxround = sizeof(uintptr), | 10 maxround = sizeof(uintptr), |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 void | 80 void |
81 runtime·args(int32 c, uint8 **v) | 81 runtime·args(int32 c, uint8 **v) |
82 { | 82 { |
83 argc = c; | 83 argc = c; |
84 argv = v; | 84 argv = v; |
85 if(runtime·sysargs != nil) | 85 if(runtime·sysargs != nil) |
86 runtime·sysargs(c, v); | 86 runtime·sysargs(c, v); |
87 } | 87 } |
88 | 88 |
89 int32 runtime·isplan9; | 89 int32 runtime·isplan9; |
90 int32 runtime·issunos; | 90 int32 runtime·issolaris; |
91 int32 runtime·iswindows; | 91 int32 runtime·iswindows; |
92 | 92 |
93 // Information about what cpu features are available. | 93 // Information about what cpu features are available. |
94 // Set on startup in asm_{x86/amd64}.s. | 94 // Set on startup in asm_{x86/amd64}.s. |
95 uint32 runtime·cpuid_ecx; | 95 uint32 runtime·cpuid_ecx; |
96 uint32 runtime·cpuid_edx; | 96 uint32 runtime·cpuid_edx; |
97 | 97 |
98 void | 98 void |
99 runtime·goargs(void) | 99 runtime·goargs(void) |
100 { | 100 { |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 res = runtime·tickspersecond(); | 381 res = runtime·tickspersecond(); |
382 FLUSH(&res); | 382 FLUSH(&res); |
383 } | 383 } |
384 | 384 |
385 DebugVars runtime·debug; | 385 DebugVars runtime·debug; |
386 | 386 |
387 static struct { | 387 static struct { |
388 int8* name; | 388 int8* name; |
389 int32* value; | 389 int32* value; |
390 } dbgvar[] = { | 390 } dbgvar[] = { |
| 391 {"allocfreetrace", &runtime·debug.allocfreetrace}, |
| 392 {"efence", &runtime·debug.efence}, |
391 {"gctrace", &runtime·debug.gctrace}, | 393 {"gctrace", &runtime·debug.gctrace}, |
| 394 {"scheddetail", &runtime·debug.scheddetail}, |
392 {"schedtrace", &runtime·debug.schedtrace}, | 395 {"schedtrace", &runtime·debug.schedtrace}, |
393 {"scheddetail", &runtime·debug.scheddetail}, | |
394 }; | 396 }; |
395 | 397 |
396 void | 398 void |
397 runtime·parsedebugvars(void) | 399 runtime·parsedebugvars(void) |
398 { | 400 { |
399 byte *p; | 401 byte *p; |
400 intgo i, n; | 402 intgo i, n; |
401 | 403 |
402 p = runtime·getenv("GODEBUG"); | 404 p = runtime·getenv("GODEBUG"); |
403 if(p == nil) | 405 if(p == nil) |
(...skipping 30 matching lines...) Expand all Loading... |
434 for(bit = 30; bit >= 0; bit--) { | 436 for(bit = 30; bit >= 0; bit--) { |
435 if(v >= ((int64)div<<bit)) { | 437 if(v >= ((int64)div<<bit)) { |
436 v = v - ((int64)div<<bit); | 438 v = v - ((int64)div<<bit); |
437 res += 1<<bit; | 439 res += 1<<bit; |
438 } | 440 } |
439 } | 441 } |
440 if(rem != nil) | 442 if(rem != nil) |
441 *rem = v; | 443 *rem = v; |
442 return res; | 444 return res; |
443 } | 445 } |
LEFT | RIGHT |