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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 #endif | 124 #endif |
125 }; | 125 }; |
126 struct Usema | 126 struct Usema |
127 { | 127 { |
128 uint32 u; | 128 uint32 u; |
129 uint32 k; | 129 uint32 k; |
130 }; | 130 }; |
131 union Note | 131 union Note |
132 { | 132 { |
133 struct { // Linux | 133 struct { // Linux |
134 » » Lock» lock; | 134 » » uint32» state; |
| 135 » }; |
| 136 » struct {» // Windows |
| 137 » » Lock lock; |
135 }; | 138 }; |
136 struct { // OS X | 139 struct { // OS X |
137 int32 wakeup; | 140 int32 wakeup; |
138 Usema sema; | 141 Usema sema; |
139 }; | 142 }; |
140 }; | 143 }; |
141 struct String | 144 struct String |
142 { | 145 { |
143 byte* str; | 146 byte* str; |
144 int32 len; | 147 int32 len; |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 extern int32 runtime·gomaxprocs; | 378 extern int32 runtime·gomaxprocs; |
376 extern uint32 runtime·panicking; | 379 extern uint32 runtime·panicking; |
377 extern int32 runtime·gcwaiting; // gc is waiting to run | 380 extern int32 runtime·gcwaiting; // gc is waiting to run |
378 int8* runtime·goos; | 381 int8* runtime·goos; |
379 extern bool runtime·iscgo; | 382 extern bool runtime·iscgo; |
380 | 383 |
381 /* | 384 /* |
382 * common functions and data | 385 * common functions and data |
383 */ | 386 */ |
384 int32 runtime·strcmp(byte*, byte*); | 387 int32 runtime·strcmp(byte*, byte*); |
| 388 byte* runtime·strstr(byte*, byte*); |
385 int32 runtime·findnull(byte*); | 389 int32 runtime·findnull(byte*); |
386 int32 runtime·findnullw(uint16*); | 390 int32 runtime·findnullw(uint16*); |
387 void runtime·dump(byte*, int32); | 391 void runtime·dump(byte*, int32); |
388 int32 runtime·runetochar(byte*, int32); | 392 int32 runtime·runetochar(byte*, int32); |
389 int32 runtime·charntorune(int32*, uint8*, int32); | 393 int32 runtime·charntorune(int32*, uint8*, int32); |
390 | 394 |
391 /* | 395 /* |
392 * very low level c-called | 396 * very low level c-called |
393 */ | 397 */ |
394 #define FLUSH(x) USED(x) | 398 #define FLUSH(x) USED(x) |
(...skipping 25 matching lines...) Expand all Loading... |
420 int32 runtime·gotraceback(void); | 424 int32 runtime·gotraceback(void); |
421 void runtime·traceback(uint8 *pc, uint8 *sp, uint8 *lr, G* gp); | 425 void runtime·traceback(uint8 *pc, uint8 *sp, uint8 *lr, G* gp); |
422 void runtime·tracebackothers(G*); | 426 void runtime·tracebackothers(G*); |
423 int32 runtime·write(int32, void*, int32); | 427 int32 runtime·write(int32, void*, int32); |
424 int32 runtime·mincore(void*, uintptr, byte*); | 428 int32 runtime·mincore(void*, uintptr, byte*); |
425 bool runtime·cas(uint32*, uint32, uint32); | 429 bool runtime·cas(uint32*, uint32, uint32); |
426 bool runtime·casp(void**, void*, void*); | 430 bool runtime·casp(void**, void*, void*); |
427 // Don't confuse with XADD x86 instruction, | 431 // Don't confuse with XADD x86 instruction, |
428 // this one is actually 'addx', that is, add-and-fetch. | 432 // this one is actually 'addx', that is, add-and-fetch. |
429 uint32 runtime·xadd(uint32 volatile*, int32); | 433 uint32 runtime·xadd(uint32 volatile*, int32); |
| 434 uint32 runtime·xchg(uint32 volatile*, uint32); |
430 uint32 runtime·atomicload(uint32 volatile*); | 435 uint32 runtime·atomicload(uint32 volatile*); |
431 void runtime·atomicstore(uint32 volatile*, uint32); | 436 void runtime·atomicstore(uint32 volatile*, uint32); |
432 void* runtime·atomicloadp(void* volatile*); | 437 void* runtime·atomicloadp(void* volatile*); |
433 void runtime·atomicstorep(void* volatile*, void*); | 438 void runtime·atomicstorep(void* volatile*, void*); |
434 void runtime·jmpdefer(byte*, void*); | 439 void runtime·jmpdefer(byte*, void*); |
435 void runtime·exit1(int32); | 440 void runtime·exit1(int32); |
436 void runtime·ready(G*); | 441 void runtime·ready(G*); |
437 byte* runtime·getenv(int8*); | 442 byte* runtime·getenv(int8*); |
438 int32 runtime·atoi(byte*); | 443 int32 runtime·atoi(byte*); |
439 void runtime·newosproc(M *m, G *g, void *stk, void (*fn)(void)); | 444 void runtime·newosproc(M *m, G *g, void *stk, void (*fn)(void)); |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 uint64 runtime·float64tobits(float64 f); | 595 uint64 runtime·float64tobits(float64 f); |
591 float64 runtime·frexp(float64 d, int32 *ep); | 596 float64 runtime·frexp(float64 d, int32 *ep); |
592 bool runtime·isInf(float64 f, int32 sign); | 597 bool runtime·isInf(float64 f, int32 sign); |
593 bool runtime·isNaN(float64 f); | 598 bool runtime·isNaN(float64 f); |
594 float64 runtime·ldexp(float64 d, int32 e); | 599 float64 runtime·ldexp(float64 d, int32 e); |
595 float64 runtime·modf(float64 d, float64 *ip); | 600 float64 runtime·modf(float64 d, float64 *ip); |
596 void runtime·semacquire(uint32*); | 601 void runtime·semacquire(uint32*); |
597 void runtime·semrelease(uint32*); | 602 void runtime·semrelease(uint32*); |
598 String runtime·signame(int32 sig); | 603 String runtime·signame(int32 sig); |
599 int32 runtime·gomaxprocsfunc(int32 n); | 604 int32 runtime·gomaxprocsfunc(int32 n); |
| 605 void runtime·procyield(uint32); |
| 606 void runtime·osyield(void); |
600 | 607 |
601 void runtime·mapassign(Hmap*, byte*, byte*); | 608 void runtime·mapassign(Hmap*, byte*, byte*); |
602 void runtime·mapaccess(Hmap*, byte*, byte*, bool*); | 609 void runtime·mapaccess(Hmap*, byte*, byte*, bool*); |
603 void runtime·mapiternext(struct hash_iter*); | 610 void runtime·mapiternext(struct hash_iter*); |
604 bool runtime·mapiterkey(struct hash_iter*, void*); | 611 bool runtime·mapiterkey(struct hash_iter*, void*); |
605 void runtime·mapiterkeyvalue(struct hash_iter*, void*, void*); | 612 void runtime·mapiterkeyvalue(struct hash_iter*, void*, void*); |
606 Hmap* runtime·makemap_c(Type*, Type*, int64); | 613 Hmap* runtime·makemap_c(Type*, Type*, int64); |
607 | 614 |
608 Hchan* runtime·makechan_c(Type*, int64); | 615 Hchan* runtime·makechan_c(Type*, int64); |
609 void runtime·chansend(Hchan*, void*, bool*); | 616 void runtime·chansend(Hchan*, void*, bool*); |
610 void runtime·chanrecv(Hchan*, void*, bool*, bool*); | 617 void runtime·chanrecv(Hchan*, void*, bool*, bool*); |
611 int32 runtime·chanlen(Hchan*); | 618 int32 runtime·chanlen(Hchan*); |
612 int32 runtime·chancap(Hchan*); | 619 int32 runtime·chancap(Hchan*); |
613 | 620 |
614 void runtime·ifaceE2I(struct InterfaceType*, Eface, Iface*); | 621 void runtime·ifaceE2I(struct InterfaceType*, Eface, Iface*); |
615 | 622 |
LEFT | RIGHT |