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

Delta Between Two Patch Sets: src/pkg/runtime/asm_386.s

Issue 5606048: code review 5606048: runtime: add runtime.cputicks() and seed fastrand with it (Closed)
Left Patch Set: Created 13 years, 2 months ago
Right Patch Set: diff -r 1b6e7832103e http://go.googlecode.com/hg/ Created 13 years, 2 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:
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | src/pkg/runtime/asm_amd64.s » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
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 "zasm_GOOS_GOARCH.h" 5 #include "zasm_GOOS_GOARCH.h"
6 6
7 TEXT _rt0_386(SB),7,$0 7 TEXT _rt0_386(SB),7,$0
8 // Linux, Windows start the FPU in extended double precision. 8 // Linux, Windows start the FPU in extended double precision.
9 // Other operating systems use double precision. 9 // Other operating systems use double precision.
10 // Change to double precision to match them, 10 // Change to double precision to match them,
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 TEXT runtime·setcallerpc(SB),7,$0 517 TEXT runtime·setcallerpc(SB),7,$0
518 MOVL x+0(FP),AX // addr of first arg 518 MOVL x+0(FP),AX // addr of first arg
519 MOVL x+4(FP), BX 519 MOVL x+4(FP), BX
520 MOVL BX, -4(AX) // set calling pc 520 MOVL BX, -4(AX) // set calling pc
521 RET 521 RET
522 522
523 TEXT runtime·getcallersp(SB), 7, $0 523 TEXT runtime·getcallersp(SB), 7, $0
524 MOVL sp+0(FP), AX 524 MOVL sp+0(FP), AX
525 RET 525 RET
526 526
527 // int64 runtime·cputicks(void), so really
528 // void runtime·cputicks(int64 *ticks)
529 TEXT runtime·cputicks(SB),7,$0
530 BYTE $0x0F; BYTE $0x31; // RDTSC; not supported by 8a
531 MOVL ret+0(FP), DI
532 MOVL AX, 0(DI)
533 MOVL DX, 4(DI)
534 RET
535
527 TEXT runtime·ldt0setup(SB),7,$16 536 TEXT runtime·ldt0setup(SB),7,$16
528 // set up ldt 7 to point at tls0 537 // set up ldt 7 to point at tls0
529 // ldt 1 would be fine on Linux, but on OS X, 7 is as low as we can go. 538 // ldt 1 would be fine on Linux, but on OS X, 7 is as low as we can go.
530 // the entry number is just a hint. setldt will set up GS with what it used. 539 // the entry number is just a hint. setldt will set up GS with what it used.
531 MOVL $7, 0(SP) 540 MOVL $7, 0(SP)
532 LEAL runtime·tls0(SB), AX 541 LEAL runtime·tls0(SB), AX
533 MOVL AX, 4(SP) 542 MOVL AX, 4(SP)
534 MOVL $32, 8(SP) // sizeof(tls array) 543 MOVL $32, 8(SP) // sizeof(tls array)
535 CALL runtime·setldt(SB) 544 CALL runtime·setldt(SB)
536 RET 545 RET
537 546
538 TEXT runtime·emptyfunc(SB),0,$0 547 TEXT runtime·emptyfunc(SB),0,$0
539 RET 548 RET
540 549
541 TEXT runtime·abort(SB),7,$0 550 TEXT runtime·abort(SB),7,$0
542 INT $0x3 551 INT $0x3
543 552
544 GLOBL runtime·tls0(SB), $32 553 GLOBL runtime·tls0(SB), $32
LEFTRIGHT

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