Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
a2aa807e
Commit
a2aa807e
authored
Aug 29, 2017
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runtime: fix lfstack for 64-bit AIX
Reviewed-on:
https://go-review.googlesource.com/57550
From-SVN: r251420
parent
4e395d91
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletions
+19
-1
gcc/go/gofrontend/MERGE
+1
-1
libgo/go/runtime/lfstack_64bit.go
+18
-0
No files found.
gcc/go/gofrontend/MERGE
View file @
a2aa807e
2c4a2bd826e58c8c8c51b9196c8d2c67abc4037e
db8e3801bf8508656606d6e465c76cdc6e9a9eb7
The first line of this file holds the git revision number of the last
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
merge done from the gofrontend repository.
libgo/go/runtime/lfstack_64bit.go
View file @
a2aa807e
...
@@ -43,6 +43,14 @@ const (
...
@@ -43,6 +43,14 @@ const (
// 52 address bits each (with 64k page size).
// 52 address bits each (with 64k page size).
ia64AddrBits
=
55
ia64AddrBits
=
55
ia64CntBits
=
64
-
ia64AddrBits
+
3
ia64CntBits
=
64
-
ia64AddrBits
+
3
// On AIX, 64-bit addresses are split into 36-bit segment number and 28-bit
// offset in segment. Segment numbers in the range 0x070000000-0x07FFFFFFF
// and 0x0A0000000-0x0AFFFFFFF(LSA) are available for mmap.
// We assume all lfnode addresses are from memory allocated with mmap.
// We use one bit to distinguish between the two ranges.
aixAddrBits
=
57
aixCntBits
=
64
-
aixAddrBits
+
3
)
)
func
lfstackPack
(
node
*
lfnode
,
cnt
uintptr
)
uint64
{
func
lfstackPack
(
node
*
lfnode
,
cnt
uintptr
)
uint64
{
...
@@ -54,6 +62,9 @@ func lfstackPack(node *lfnode, cnt uintptr) uint64 {
...
@@ -54,6 +62,9 @@ func lfstackPack(node *lfnode, cnt uintptr) uint64 {
val
:=
uint64
(
uintptr
(
unsafe
.
Pointer
(
node
)))
val
:=
uint64
(
uintptr
(
unsafe
.
Pointer
(
node
)))
return
(
val
<<
(
64
-
ia64AddrBits
))
&
(
1
<<
(
64
-
3
)
-
1
)
|
val
&^
(
1
<<
(
64
-
3
)
-
1
)
|
uint64
(
cnt
&
(
1
<<
ia64CntBits
-
1
))
return
(
val
<<
(
64
-
ia64AddrBits
))
&
(
1
<<
(
64
-
3
)
-
1
)
|
val
&^
(
1
<<
(
64
-
3
)
-
1
)
|
uint64
(
cnt
&
(
1
<<
ia64CntBits
-
1
))
}
}
if
GOARCH
==
"ppc64"
&&
GOOS
==
"aix"
{
return
uint64
(
uintptr
(
unsafe
.
Pointer
(
node
)))
<<
(
64
-
aixAddrBits
)
|
uint64
(
cnt
&
(
1
<<
aixCntBits
-
1
))
}
return
uint64
(
uintptr
(
unsafe
.
Pointer
(
node
)))
<<
(
64
-
addrBits
)
|
uint64
(
cnt
&
(
1
<<
cntBits
-
1
))
return
uint64
(
uintptr
(
unsafe
.
Pointer
(
node
)))
<<
(
64
-
addrBits
)
|
uint64
(
cnt
&
(
1
<<
cntBits
-
1
))
}
}
...
@@ -69,5 +80,12 @@ func lfstackUnpack(val uint64) *lfnode {
...
@@ -69,5 +80,12 @@ func lfstackUnpack(val uint64) *lfnode {
if
GOARCH
==
"ia64"
{
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
>>
ia64CntBits
<<
3
)
&
(
1
<<
(
64
-
3
)
-
1
)
|
val
&^
(
1
<<
(
64
-
3
)
-
1
))))
}
}
if
GOARCH
==
"ppc64"
&&
GOOS
==
"aix"
{
if
val
&
(
1
<<
63
)
!=
0
{
return
(
*
lfnode
)(
unsafe
.
Pointer
(
uintptr
((
val
>>
aixCntBits
<<
3
)
|
0x7
<<
56
)))
}
else
{
return
(
*
lfnode
)(
unsafe
.
Pointer
(
uintptr
((
val
>>
aixCntBits
<<
3
)
|
0xa
<<
56
)))
}
}
return
(
*
lfnode
)(
unsafe
.
Pointer
(
uintptr
(
val
>>
cntBits
<<
3
)))
return
(
*
lfnode
)(
unsafe
.
Pointer
(
uintptr
(
val
>>
cntBits
<<
3
)))
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment