summaryrefslogtreecommitdiff
path: root/src/pkg/runtime/sys_freebsd_amd64.s
diff options
context:
space:
mode:
authorMichael Stapelberg <stapelberg@debian.org>2013-03-04 21:27:36 +0100
committerMichael Stapelberg <michael@stapelberg.de>2013-03-04 21:27:36 +0100
commit04b08da9af0c450d645ab7389d1467308cfc2db8 (patch)
treedb247935fa4f2f94408edc3acd5d0d4f997aa0d8 /src/pkg/runtime/sys_freebsd_amd64.s
parent917c5fb8ec48e22459d77e3849e6d388f93d3260 (diff)
downloadgolang-upstream/1.1_hg20130304.tar.gz
Imported Upstream version 1.1~hg20130304upstream/1.1_hg20130304
Diffstat (limited to 'src/pkg/runtime/sys_freebsd_amd64.s')
-rw-r--r--src/pkg/runtime/sys_freebsd_amd64.s40
1 files changed, 25 insertions, 15 deletions
diff --git a/src/pkg/runtime/sys_freebsd_amd64.s b/src/pkg/runtime/sys_freebsd_amd64.s
index 36e034a80..40c6237e2 100644
--- a/src/pkg/runtime/sys_freebsd_amd64.s
+++ b/src/pkg/runtime/sys_freebsd_amd64.s
@@ -38,8 +38,9 @@ TEXT runtime·thr_start(SB),7,$0
MOVQ m_g0(R13), DI
MOVQ DI, g(CX)
- CALL runtime·stackcheck(SB)
- CALL runtime·mstart(SB)
+ CALL runtime·stackcheck(SB)
+ CALL runtime·mstart(SB)
+
MOVQ 0, AX // crash (not reached)
// Exit the entire program (like C exit)
@@ -94,31 +95,29 @@ TEXT runtime·setitimer(SB), 7, $-8
// func now() (sec int64, nsec int32)
TEXT time·now(SB), 7, $32
- MOVL $116, AX
- LEAQ 8(SP), DI
- MOVQ $0, SI
+ MOVL $232, AX
+ MOVQ $0, DI
+ LEAQ 8(SP), SI
SYSCALL
MOVQ 8(SP), AX // sec
- MOVL 16(SP), DX // usec
+ MOVQ 16(SP), DX // nsec
- // sec is in AX, usec in DX
+ // sec is in AX, nsec in DX
MOVQ AX, sec+0(FP)
- IMULQ $1000, DX
MOVL DX, nsec+8(FP)
RET
TEXT runtime·nanotime(SB), 7, $32
- MOVL $116, AX
- LEAQ 8(SP), DI
- MOVQ $0, SI
+ MOVL $232, AX
+ MOVQ $0, DI
+ LEAQ 8(SP), SI
SYSCALL
MOVQ 8(SP), AX // sec
- MOVL 16(SP), DX // usec
+ MOVQ 16(SP), DX // nsec
- // sec is in AX, usec in DX
+ // sec is in AX, nsec in DX
// return nsec in AX
IMULQ $1000000000, AX
- IMULQ $1000, DX
ADDQ DX, AX
RET
@@ -138,8 +137,10 @@ TEXT runtime·sigtramp(SB),7,$64
// check that m exists
MOVQ m(BX), BP
CMPQ BP, $0
- JNE 2(PC)
+ JNE 4(PC)
+ MOVQ DI, 0(SP)
CALL runtime·badsignal(SB)
+ RET
// save g
MOVQ g(BX), R10
@@ -182,6 +183,15 @@ TEXT runtime·munmap(SB),7,$0
MOVL $0xf1, 0xf1 // crash
RET
+TEXT runtime·madvise(SB),7,$0
+ MOVQ 8(SP), DI
+ MOVQ 16(SP), SI
+ MOVQ 24(SP), DX
+ MOVQ $75, AX // madvise
+ SYSCALL
+ // ignore failure - maybe pages are locked
+ RET
+
TEXT runtime·sigaltstack(SB),7,$-8
MOVQ new+8(SP), DI
MOVQ old+16(SP), SI