-
Notifications
You must be signed in to change notification settings - Fork 4k
cannon: 64-bit Refactor #12029
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
cannon: 64-bit Refactor #12029
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
dfa61bb
cannon: 64-bit Refactor
Inphi 7a24ad0
fix 64-bit test compilation errors
Inphi 1373011
review comments
Inphi 940bc42
Merge remote-tracking branch 'origin/develop' into inphi/cannon-64-reorg
Inphi aabd851
more review comments
Inphi e3b65d7
fcntl syscall err for 64-bit
Inphi 883f799
simplify pad check
Inphi ab95e47
cannon: sc must store lsb 32 on 64-bits
Inphi 6a45ad4
lint
Inphi 0547402
fix sc 64-bit logic
Inphi 378e22e
add TODO state test
Inphi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| //go:build !cannon64 | ||
| // +build !cannon64 | ||
|
|
||
| package arch | ||
|
|
||
| import "encoding/binary" | ||
|
|
||
| type ( | ||
| // Word differs from the tradditional meaning in MIPS. The type represents the *maximum* architecture specific access length and value sizes. | ||
| Word = uint32 | ||
| // SignedInteger specifies the maximum signed integer type used for arithmetic. | ||
| SignedInteger = int32 | ||
| ) | ||
|
|
||
| const ( | ||
| IsMips32 = true | ||
| WordSize = 32 | ||
| WordSizeBytes = WordSize >> 3 | ||
| PageAddrSize = 12 | ||
| PageKeySize = WordSize - PageAddrSize | ||
|
|
||
| MemProofLeafCount = 28 | ||
| MemProofSize = MemProofLeafCount * 32 | ||
|
|
||
| AddressMask = 0xFFffFFfc | ||
| ExtMask = 0x3 | ||
|
|
||
| HeapStart = 0x05_00_00_00 | ||
| HeapEnd = 0x60_00_00_00 | ||
| ProgramBreak = 0x40_00_00_00 | ||
| HighMemoryStart = 0x7f_ff_d0_00 | ||
| ) | ||
|
|
||
| var ByteOrderWord = byteOrder32{} | ||
|
|
||
| type byteOrder32 struct{} | ||
|
|
||
| func (bo byteOrder32) Word(b []byte) Word { | ||
| return binary.BigEndian.Uint32(b) | ||
| } | ||
|
|
||
| func (bo byteOrder32) AppendWord(b []byte, v uint32) []byte { | ||
| return binary.BigEndian.AppendUint32(b, v) | ||
| } | ||
|
|
||
| func (bo byteOrder32) PutWord(b []byte, v uint32) { | ||
| binary.BigEndian.PutUint32(b, v) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| //go:build cannon64 | ||
| // +build cannon64 | ||
|
|
||
| package arch | ||
|
|
||
| import "encoding/binary" | ||
|
|
||
| type ( | ||
| // Word differs from the tradditional meaning in MIPS. The type represents the *maximum* architecture specific access length and value sizes | ||
| Word = uint64 | ||
| // SignedInteger specifies the maximum signed integer type used for arithmetic. | ||
| SignedInteger = int64 | ||
| ) | ||
|
|
||
| const ( | ||
| IsMips32 = false | ||
| WordSize = 64 | ||
| WordSizeBytes = WordSize >> 3 | ||
| PageAddrSize = 12 | ||
| PageKeySize = WordSize - PageAddrSize | ||
|
|
||
| MemProofLeafCount = 60 | ||
| MemProofSize = MemProofLeafCount * 32 | ||
|
|
||
| AddressMask = 0xFFFFFFFFFFFFFFF8 | ||
| ExtMask = 0x7 | ||
|
|
||
| HeapStart = 0x10_00_00_00_00_00_00_00 | ||
| HeapEnd = 0x60_00_00_00_00_00_00_00 | ||
| ProgramBreak = 0x40_00_00_00_00_00_00_00 | ||
| HighMemoryStart = 0x7F_FF_FF_FF_D0_00_00_00 | ||
| ) | ||
|
|
||
| var ByteOrderWord = byteOrder64{} | ||
|
|
||
| type byteOrder64 struct{} | ||
|
|
||
| func (bo byteOrder64) Word(b []byte) Word { | ||
| return binary.BigEndian.Uint64(b) | ||
| } | ||
|
|
||
| func (bo byteOrder64) AppendWord(b []byte, v uint64) []byte { | ||
| return binary.BigEndian.AppendUint64(b, v) | ||
| } | ||
|
|
||
| func (bo byteOrder64) PutWord(b []byte, v uint64) { | ||
| binary.BigEndian.PutUint64(b, v) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| package arch | ||
|
|
||
| type ByteOrder interface { | ||
| Word([]byte) Word | ||
| AppendWord([]byte, Word) []byte | ||
| PutWord([]byte, Word) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.