]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix freebsd/386 mmap
authorRuss Cox <rsc@golang.org>
Tue, 24 Aug 2010 17:04:02 +0000 (13:04 -0400)
committerRuss Cox <rsc@golang.org>
Tue, 24 Aug 2010 17:04:02 +0000 (13:04 -0400)
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

index a0860db81b4d5b1fbb7f9e47d2a4ba957d3ab6c9..4b3b47427121db53abed2826380edd2fe1fbda77 100644 (file)
@@ -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)