From aa5493116beaa24b57cc92f0513613358103ed13 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 7 Jun 2017 18:12:58 +0000 Subject: runtime: support ia64 in lfstack Patch by Andreas Schwab. Reviewed-on: https://go-review.googlesource.com/45071 From-SVN: r248994 --- libgo/go/runtime/lfstack_64bit.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'libgo/go') diff --git a/libgo/go/runtime/lfstack_64bit.go b/libgo/go/runtime/lfstack_64bit.go index b314a3b..8a39fee 100644 --- a/libgo/go/runtime/lfstack_64bit.go +++ b/libgo/go/runtime/lfstack_64bit.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build amd64 arm64 mips64 mips64le ppc64 ppc64le s390x arm64be alpha mipsn64 sparc64 +// +build amd64 arm64 mips64 mips64le ppc64 ppc64le s390x arm64be alpha mipsn64 sparc64 ia64 package runtime @@ -38,12 +38,22 @@ const ( // room in the bottom for the count. sparcLinuxAddrBits = 52 sparcLinuxCntBits = 64 - sparcLinuxAddrBits + 3 + + // On IA64, the virtual address space is devided into 8 regions, with + // 52 address bits each (with 64k page size). + ia64AddrBits = 55 + ia64CntBits = 64 - ia64AddrBits + 3 ) func lfstackPack(node *lfnode, cnt uintptr) uint64 { if GOARCH == "sparc64" && GOOS == "linux" { return uint64(uintptr(unsafe.Pointer(node)))<<(64-sparcLinuxAddrBits) | uint64(cnt&(1<> sparcLinuxCntBits << 3))) } + if GOARCH == "ia64" { + return (*lfnode)(unsafe.Pointer(uintptr((val>>ia64CntBits<<3)&(1<<(64-3)-1) | val&^(1<<(64-3)-1)))) + } return (*lfnode)(unsafe.Pointer(uintptr(val >> cntBits << 3))) } -- cgit v1.1