summaryrefslogtreecommitdiff
path: root/src/pkg/runtime/sys_freebsd_386.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_386.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_386.s')
-rw-r--r--src/pkg/runtime/sys_freebsd_386.s38
1 files changed, 23 insertions, 15 deletions
diff --git a/src/pkg/runtime/sys_freebsd_386.s b/src/pkg/runtime/sys_freebsd_386.s
index a72d8972b..d5370267a 100644
--- a/src/pkg/runtime/sys_freebsd_386.s
+++ b/src/pkg/runtime/sys_freebsd_386.s
@@ -39,6 +39,7 @@ TEXT runtime·thr_start(SB),7,$0
MOVL AX, m(CX)
CALL runtime·stackcheck(SB) // smashes AX
CALL runtime·mstart(SB)
+
MOVL 0, AX // crash (not reached)
// Exit the entire program (like C exit)
@@ -89,7 +90,7 @@ TEXT runtime·mmap(SB),7,$32
MOVSL
MOVSL
MOVSL
- MOVL $0, AX // top 64 bits of file offset
+ MOVL $0, AX // top 32 bits of file offset
STOSL
MOVL $477, AX
INT $0x80
@@ -102,6 +103,12 @@ TEXT runtime·munmap(SB),7,$-4
MOVL $0xf1, 0xf1 // crash
RET
+TEXT runtime·madvise(SB),7,$-4
+ MOVL $75, AX // madvise
+ INT $0x80
+ // ignore failure - maybe pages are locked
+ RET
+
TEXT runtime·setitimer(SB), 7, $-4
MOVL $83, AX
INT $0x80
@@ -109,40 +116,38 @@ TEXT runtime·setitimer(SB), 7, $-4
// func now() (sec int64, nsec int32)
TEXT time·now(SB), 7, $32
- MOVL $116, AX
+ MOVL $232, AX
LEAL 12(SP), BX
- MOVL BX, 4(SP)
- MOVL $0, 8(SP)
+ MOVL $0, 4(SP)
+ MOVL BX, 8(SP)
INT $0x80
MOVL 12(SP), AX // sec
- MOVL 16(SP), BX // usec
+ MOVL 16(SP), BX // nsec
- // sec is in AX, usec in BX
+ // sec is in AX, nsec in BX
MOVL AX, sec+0(FP)
MOVL $0, sec+4(FP)
- IMULL $1000, BX
MOVL BX, nsec+8(FP)
RET
// int64 nanotime(void) so really
// void nanotime(int64 *nsec)
TEXT runtime·nanotime(SB), 7, $32
- MOVL $116, AX
+ MOVL $232, AX
LEAL 12(SP), BX
- MOVL BX, 4(SP)
- MOVL $0, 8(SP)
+ MOVL $0, 4(SP)
+ MOVL BX, 8(SP)
INT $0x80
MOVL 12(SP), AX // sec
- MOVL 16(SP), BX // usec
+ MOVL 16(SP), BX // nsec
- // sec is in AX, usec in BX
+ // sec is in AX, nsec in BX
// convert to DX:AX nsec
MOVL $1000000000, CX
MULL CX
- IMULL $1000, BX
ADDL BX, AX
ADCL $0, DX
-
+
MOVL ret+0(FP), DI
MOVL AX, 0(DI)
MOVL DX, 4(DI)
@@ -162,8 +167,11 @@ TEXT runtime·sigtramp(SB),7,$44
// check that m exists
MOVL m(CX), BX
CMPL BX, $0
- JNE 2(PC)
+ JNE 5(PC)
+ MOVL signo+0(FP), BX
+ MOVL BX, 0(SP)
CALL runtime·badsignal(SB)
+ RET
// save g
MOVL g(CX), DI