Commit d11c6b57 authored by zhiqiangxu's avatar zhiqiangxu Committed by GitHub

cannon arch: move derivable stuff to arch.go (#13350)

* cannon arch: move derivable stuff to arch.go

* address comments
parent cb755961
package arch
// This file contains stuff common to both arch32 and arch64
const (
IsMips32 = WordSize == 32
WordSizeBytes = WordSize >> 3
PageAddrSize = 12
PageKeySize = WordSize - PageAddrSize
MemProofLeafCount = WordSize - 4
MemProofSize = MemProofLeafCount * 32
)
......@@ -13,16 +13,8 @@ type (
)
const (
IsMips32 = true
WordSize = 32
WordSizeBytes = WordSize >> 3
PageAddrSize = 12
PageKeySize = WordSize - PageAddrSize
MemProofLeafCount = 28
MemProofSize = MemProofLeafCount * 32
AddressMask = 0xFFffFFfc
WordSize = 32
ExtMask = 0x3
HeapStart = 0x05_00_00_00
......
......@@ -13,16 +13,8 @@ type (
)
const (
IsMips32 = false
WordSize = 64
WordSizeBytes = WordSize >> 3
PageAddrSize = 12
PageKeySize = WordSize - PageAddrSize
MemProofLeafCount = 60
MemProofSize = MemProofLeafCount * 32
AddressMask = 0xFFFFFFFFFFFFFFF8
WordSize = 64
ExtMask = 0x7
// Ensure virtual address is limited to 48-bits as many user programs assume such to implement packed pointers
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment