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

Side by Side Diff: src/pkg/runtime/sys_linux_amd64.s

Issue 6814103: code review 6814103: runtime: use vDSO clock_gettime for time.now & runtime.... (Closed)
Patch Set: diff -r f4796b726694 https://code.google.com/p/go/ Created 12 years, 5 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:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/pkg/runtime/vdso_linux_amd64.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // System calls and other sys.stuff for AMD64, Linux 6 // System calls and other sys.stuff for AMD64, Linux
7 // 7 //
8 8
9 #include "zasm_GOOS_GOARCH.h" 9 #include "zasm_GOOS_GOARCH.h"
10 10
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 TEXT runtime·mincore(SB),7,$0-24 95 TEXT runtime·mincore(SB),7,$0-24
96 MOVQ 8(SP), DI 96 MOVQ 8(SP), DI
97 MOVQ 16(SP), SI 97 MOVQ 16(SP), SI
98 MOVQ 24(SP), DX 98 MOVQ 24(SP), DX
99 MOVL $27, AX // syscall entry 99 MOVL $27, AX // syscall entry
100 SYSCALL 100 SYSCALL
101 RET 101 RET
102 102
103 // func now() (sec int64, nsec int32) 103 // func now() (sec int64, nsec int32)
104 TEXT time·now(SB), 7, $32 104 TEXT time·now(SB), 7, $32
105 MOVQ runtime·__vdso_clock_gettime_sym(SB), AX
106 CMPQ AX, $0
107 JEQ fallback_gtod
108 MOVL $0, DI // CLOCK_REALTIME
109 LEAQ 8(SP), SI
110 CALL AX
111 MOVQ 8(SP), AX // sec
112 MOVQ 16(SP), DX // nsec
113 MOVQ AX, sec+0(FP)
114 MOVL DX, nsec+8(FP)
115 RET
116 fallback_gtod:
105 LEAQ 8(SP), DI 117 LEAQ 8(SP), DI
106 MOVQ $0, SI 118 MOVQ $0, SI
107 MOVQ runtime·__vdso_gettimeofday_sym(SB), AX 119 MOVQ runtime·__vdso_gettimeofday_sym(SB), AX
108 CALL AX 120 CALL AX
109 MOVQ 8(SP), AX // sec 121 MOVQ 8(SP), AX // sec
110 MOVL 16(SP), DX // usec 122 MOVL 16(SP), DX // usec
111 123 » IMULQ» $1000, DX
112 » // sec is in AX, usec in DX
113 MOVQ AX, sec+0(FP) 124 MOVQ AX, sec+0(FP)
114 IMULQ $1000, DX
115 MOVL DX, nsec+8(FP) 125 MOVL DX, nsec+8(FP)
116 RET 126 RET
117 127
118 TEXT runtime·nanotime(SB), 7, $32 128 TEXT runtime·nanotime(SB), 7, $32
119 » LEAQ» 8(SP), DI 129 » CALL» time·now(SB)
120 » MOVQ» $0, SI 130 » MOVQ» 0(SP), AX» // sec
121 » MOVQ» $0xffffffffff600000, AX 131 » MOVL» 8(SP), DX» // nsec
122 » CALL» AX
123 » MOVQ» 8(SP), AX» // sec
124 » MOVL» 16(SP), DX» // usec
125 132
126 // sec is in AX, usec in DX 133 // sec is in AX, usec in DX
127 // return nsec in AX 134 // return nsec in AX
128 IMULQ $1000000000, AX 135 IMULQ $1000000000, AX
129 IMULQ $1000, DX
130 ADDQ DX, AX 136 ADDQ DX, AX
131 RET 137 RET
132 138
133 TEXT runtime·rtsigprocmask(SB),7,$0-32 139 TEXT runtime·rtsigprocmask(SB),7,$0-32
134 MOVL 8(SP), DI 140 MOVL 8(SP), DI
135 MOVQ 16(SP), SI 141 MOVQ 16(SP), SI
136 MOVQ 24(SP), DX 142 MOVQ 24(SP), DX
137 MOVL 32(SP), R10 143 MOVL 32(SP), R10
138 MOVL $14, AX // syscall entry 144 MOVL $14, AX // syscall entry
139 SYSCALL 145 SYSCALL
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 SYSCALL 319 SYSCALL
314 RET 320 RET
315 321
316 TEXT runtime·sched_getaffinity(SB),7,$0 322 TEXT runtime·sched_getaffinity(SB),7,$0
317 MOVQ 8(SP), DI 323 MOVQ 8(SP), DI
318 MOVL 16(SP), SI 324 MOVL 16(SP), SI
319 MOVQ 24(SP), DX 325 MOVQ 24(SP), DX
320 MOVL $204, AX // syscall entry 326 MOVL $204, AX // syscall entry
321 SYSCALL 327 SYSCALL
322 RET 328 RET
OLDNEW
« no previous file with comments | « no previous file | src/pkg/runtime/vdso_linux_amd64.c » ('j') | no next file with comments »

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