aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/export_test.go
diff options
context:
space:
mode:
authorMichael Anthony Knyszek <mknyszek@google.com>2019-11-07 22:42:38 +0000
committerBrad Fitzpatrick <bradfitz@golang.org>2019-11-10 04:23:22 +0000
commite6fb39aa6869fa5033b87c14a9826598679cb47d (patch)
tree37cab347f8084c3b89d4170e3eeee3d36439bdbf /src/runtime/export_test.go
parent78d4560793de65e21199d3c80e9c901833bdaeba (diff)
downloadgo-e6fb39aa6869fa5033b87c14a9826598679cb47d.tar.gz
go-e6fb39aa6869fa5033b87c14a9826598679cb47d.zip
runtime: make the test addresses for pageAlloc smaller on 32-bit
This change makes the test addresses start at 1 GiB instead of 2 GiB to support mips and mipsle, which only have 31-bit address spaces. It also changes some tests to use smaller offsets for the chunk index to avoid jumping too far ahead in the address space to support 31-bit address spaces. The tests don't require such large jumps for what they're testing anyway. Updates #35112. Fixes #35440. Change-Id: Ic68ff2b0a1f10ef37ac00d4bb5b910ddcdc76f2e Reviewed-on: https://go-review.googlesource.com/c/go/+/205938 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/runtime/export_test.go')
-rw-r--r--src/runtime/export_test.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/runtime/export_test.go b/src/runtime/export_test.go
index ef977b302e..1db465673c 100644
--- a/src/runtime/export_test.go
+++ b/src/runtime/export_test.go
@@ -830,7 +830,10 @@ func FreePageAlloc(pp *PageAlloc) {
// BaseChunkIdx is a convenient chunkIdx value which works on both
// 64 bit and 32 bit platforms, allowing the tests to share code
// between the two.
-var BaseChunkIdx = ChunkIdx(chunkIndex((0xc000*pageAlloc64Bit + 0x200*pageAlloc32Bit) * pallocChunkBytes))
+//
+// This should not be higher than 0x100*pallocChunkBytes to support
+// mips and mipsle, which only have 31-bit address spaces.
+var BaseChunkIdx = ChunkIdx(chunkIndex((0xc000*pageAlloc64Bit + 0x100*pageAlloc32Bit) * pallocChunkBytes))
// PageBase returns an address given a chunk index and a page index
// relative to that chunk.