1
0
mirror of https://github.com/taigrr/gopher-os synced 2025-01-18 04:43:13 -08:00
gopher-os/kernel/mem/constants_amd64.go
Achilleas Anagnostopoulos d7eb2547dd Change the Frame type to uintptr and remove Size/Order methods
To keep the implementation portable, the Frame type had to be changed
from uint64 to uintptr. Using uintptr ensures that the frame will always
match the pointer size of the platform.
2017-05-31 15:07:09 +01:00

18 lines
475 B
Go

// +build amd64
package mem
const (
// PointerShift is equal to log2(unsafe.Sizeof(uintptr)). The pointer
// size for this architecture is defined as (1 << PointerShift).
PointerShift = 3
// PageShift is equal to log2(PageSize). This constant is used when
// we need to convert a physical address to a page number (shift right by PageShift)
// and vice-versa.
PageShift = 12
// PageSize defines the system's page size in bytes.
PageSize = Size(1 << PageShift)
)