]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix mmap comments
authorShenghou Ma <minux.ma@gmail.com>
Fri, 21 Sep 2012 05:50:02 +0000 (13:50 +0800)
committerShenghou Ma <minux.ma@gmail.com>
Fri, 21 Sep 2012 05:50:02 +0000 (13:50 +0800)
We only pass lower 32 bits of file offset to asm routine.

R=r, dave, rsc
CC=golang-dev
https://golang.org/cl/6499118

src/pkg/runtime/runtime.h
src/pkg/runtime/sys_freebsd_386.s
src/pkg/runtime/sys_netbsd_386.s
src/pkg/runtime/sys_openbsd_386.s

index 96da29a00cb2ac69979577fa3d64839068a1f928..37427fb92d3a8805d4b4591c79f33b0ed247dbe6 100644 (file)
@@ -728,6 +728,9 @@ void        runtime·parfordo(ParFor *desc);
 /*
  * low level C-called
  */
+// for mmap, we only pass the lower 32 bits of file offset to the 
+// assembly routine; the higher bits (if required), should be provided
+// by the assembly routine as 0.
 uint8* runtime·mmap(byte*, uintptr, int32, int32, int32, uint32);
 void   runtime·munmap(byte*, uintptr);
 void   runtime·madvise(byte*, uintptr, int32);
index 2cfce09f44eba5d17408632dcc148bbd0b39f053..c386268ff5d19f52ca35638877da64679271e91a 100644 (file)
@@ -89,7 +89,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
index 5f6738ee2d3fb662f0a3c1a071a8957ac003012a..c4bc80933a4ec71dad7b184789e28443316fcd58 100644 (file)
@@ -68,7 +68,7 @@ TEXT runtime·mmap(SB),7,$36
        MOVL    $0, AX
        STOSL                           // arg 6 - pad
        MOVSL                           // arg 7 - offset
-       MOVL    $0, AX                  // top 64 bits of file offset
+       MOVL    $0, AX                  // top 32 bits of file offset
        STOSL
        MOVL    $197, AX                // sys_mmap
        INT     $0x80
index d04b5e653a25b7990093ebff5386df00d20edd5c..7888638dff981803c80c8af8f82e704428bbc581 100644 (file)
@@ -69,7 +69,7 @@ TEXT runtime·mmap(SB),7,$36
        MOVL    $0, AX
        STOSL                           // arg 6 - pad
        MOVSL                           // arg 7 - offset
-       MOVL    $0, AX                  // top 64 bits of file offset
+       MOVL    $0, AX                  // top 32 bits of file offset
        STOSL
        MOVL    $197, AX                // sys_mmap
        INT     $0x80