From e1e829b7866b0390e7c8e0dc425490b88264b67d Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 24 Aug 2010 13:04:02 -0400 Subject: [PATCH] runtime: fix freebsd/386 mmap The runtime only passes 32 bits of file offset, but the kernel wants 64 bits, so have to add zeros explicitly in a copy of the arguments. R=adg, Martin Neubauer CC=golang-dev https://golang.org/cl/1933044 --- src/pkg/runtime/freebsd/386/sys.s | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/pkg/runtime/freebsd/386/sys.s b/src/pkg/runtime/freebsd/386/sys.s index a0860db81b4..4b3b4742712 100644 --- a/src/pkg/runtime/freebsd/386/sys.s +++ b/src/pkg/runtime/freebsd/386/sys.s @@ -66,7 +66,18 @@ TEXT notok(SB),7,$0 MOVL $0xf1, 0xf1 RET -TEXT ·mmap(SB),7,$-4 +TEXT ·mmap(SB),7,$32 + LEAL arg0+0(FP), SI + LEAL 4(SP), DI + CLD + MOVSL + MOVSL + MOVSL + MOVSL + MOVSL + MOVSL + MOVL $0, AX // top 64 bits of file offset + STOSL MOVL $477, AX INT $0x80 JAE 2(PC)