github.com/comwrg/go/src@v0.0.0-20220319063731-c238d0440370/runtime/internal/sys/arch.go (about) 1 // Copyright 2014 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package sys 6 7 type ArchFamilyType int 8 9 const ( 10 AMD64 ArchFamilyType = iota 11 ARM 12 ARM64 13 I386 14 MIPS 15 MIPS64 16 PPC64 17 RISCV64 18 S390X 19 WASM 20 ) 21 22 // PtrSize is the size of a pointer in bytes - unsafe.Sizeof(uintptr(0)) but as an ideal constant. 23 // It is also the size of the machine's native word size (that is, 4 on 32-bit systems, 8 on 64-bit). 24 const PtrSize = 4 << (^uintptr(0) >> 63) 25 26 // AIX requires a larger stack for syscalls. 27 const StackGuardMultiplier = StackGuardMultiplierDefault*(1-GoosAix) + 2*GoosAix 28 29 // ArchFamily is the architecture family (AMD64, ARM, ...) 30 const ArchFamily ArchFamilyType = _ArchFamily 31 32 // BigEndian reports whether the architecture is big-endian. 33 const BigEndian = GoarchArmbe|GoarchArm64be|GoarchMips|GoarchMips64|GoarchPpc|GoarchPpc64|GoarchS390|GoarchS390x|GoarchSparc|GoarchSparc64 == 1 34 35 // DefaultPhysPageSize is the default physical page size. 36 const DefaultPhysPageSize = _DefaultPhysPageSize 37 38 // PCQuantum is the minimal unit for a program counter (1 on x86, 4 on most other systems). 39 // The various PC tables record PC deltas pre-divided by PCQuantum. 40 const PCQuantum = _PCQuantum 41 42 // Int64Align is the required alignment for a 64-bit integer (4 on 32-bit systems, 8 on 64-bit). 43 const Int64Align = PtrSize 44 45 // MinFrameSize is the size of the system-reserved words at the bottom 46 // of a frame (just above the architectural stack pointer). 47 // It is zero on x86 and PtrSize on most non-x86 (LR-based) systems. 48 // On PowerPC it is larger, to cover three more reserved words: 49 // the compiler word, the link editor word, and the TOC save word. 50 const MinFrameSize = _MinFrameSize 51 52 // StackAlign is the required alignment of the SP register. 53 // The stack must be at least word aligned, but some architectures require more. 54 const StackAlign = _StackAlign