aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/linux/amd64
diff options
context:
space:
mode:
authorJonathan Mark <jhmark@xenops.com>2011-06-07 21:50:10 -0700
committerIan Lance Taylor <iant@golang.org>2011-06-07 21:50:10 -0700
commitddde52ae5612706cb529b964dd3a27adb3e0ae0b (patch)
tree600cdd41932259547e72b3df189fe19d19549cb8 /src/pkg/runtime/linux/amd64
parentbac24da2acec0fc3a6ef4c0243ac103e7a031de9 (diff)
downloadgo-ddde52ae5612706cb529b964dd3a27adb3e0ae0b.tar.xz
runtime: SysMap uses MAP_FIXED if needed on 64-bit Linux
This change was adapted from gccgo's libgo/runtime/mem.c at Ian Taylor's suggestion. It fixes all.bash failing with "address space conflict: map() =" on amd64 Linux with kernel version 2.6.32.8-grsec-2.1.14-modsign-xeon-64. With this change, SysMap will use MAP_FIXED to allocate its desired address space, after first calling mincore to check that there is nothing else mapped there. R=iant, dave, n13m3y3r, rsc CC=golang-dev https://golang.org/cl/4438091
Diffstat (limited to 'src/pkg/runtime/linux/amd64')
-rw-r--r--src/pkg/runtime/linux/amd64/sys.s8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/pkg/runtime/linux/amd64/sys.s b/src/pkg/runtime/linux/amd64/sys.s
index eadd300058..66fdab2083 100644
--- a/src/pkg/runtime/linux/amd64/sys.s
+++ b/src/pkg/runtime/linux/amd64/sys.s
@@ -53,6 +53,14 @@ TEXT runtimeĀ·setitimer(SB),7,$0-24
SYSCALL
RET
+TEXT runtimeĀ·mincore(SB),7,$0-24
+ MOVQ 8(SP), DI
+ MOVQ 16(SP), SI
+ MOVQ 24(SP), DX
+ MOVL $27, AX // syscall entry
+ SYSCALL
+ RET
+
TEXT runtimeĀ·gettime(SB), 7, $32
LEAQ 8(SP), DI
MOVQ $0, SI