diff options
Diffstat (limited to 'src/syscall/asm_linux_amd64.s')
| -rw-r--r-- | src/syscall/asm_linux_amd64.s | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/syscall/asm_linux_amd64.s b/src/syscall/asm_linux_amd64.s index 2c3374338f..ba22179dc2 100644 --- a/src/syscall/asm_linux_amd64.s +++ b/src/syscall/asm_linux_amd64.s @@ -9,6 +9,8 @@ // System calls for AMD64, Linux // +#define SYS_gettimeofday 96 + // func Syscall(trap int64, a1, a2, a3 uintptr) (r1, r2, err uintptr); // Trap # in AX, args in DI SI DX R10 R8 R9, return in AX DX // Note that this differs from "standard" ABI convention, which @@ -144,13 +146,19 @@ TEXT ·gettimeofday(SB),NOSPLIT,$0-16 MOVQ tv+0(FP), DI MOVQ $0, SI MOVQ runtime·vdsoGettimeofdaySym(SB), AX + TESTQ AX, AX + JZ fallback CALL AX - +ret: CMPQ AX, $0xfffffffffffff001 JLS ok7 NEGQ AX MOVQ AX, err+8(FP) RET +fallback: + MOVL $SYS_gettimeofday, AX + SYSCALL + JMP ret ok7: MOVQ $0, err+8(FP) RET |
