arch

package
v0.0.0-...-f342860 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package arch provides basic descriptions of CPU architectures.

Index

Constants

This section is empty.

Variables

View Source
var (
	AMD64 = &Arch{Layout{0, 8}, "amd64", 0}
	I386  = &Arch{Layout{0, 4}, "386", 0}
)

Functions

This section is empty.

Types

type Arch

type Arch struct {
	// Layout is the byte order and word size of this architecture.
	Layout Layout

	// GoArch is the GOARCH value for this architecture.
	GoArch string

	// MinFrameSize is the number of bytes at the bottom of every
	// stack frame except for empty leaf frames. This includes,
	// for example, space for a saved LR (because that space is
	// always reserved), but does not include the return PC pushed
	// on x86 by CALL (because that is added only on a call).
	MinFrameSize int
}

An Arch describes a CPU architecture.

func (*Arch) String

func (a *Arch) String() string

String returns the GOARCH value of a.

type Layout

type Layout struct {
	// contains filtered or unexported fields
}

Layout describes the data layout (byte order and word size) of an architecture.

func NewLayout

func NewLayout(order binary.ByteOrder, wordSize int) Layout

NewLayout returns a new Layout with the given byte order and word size.

wordSize must be 1, 2, 4, or 8.

func (Layout) Int16

func (l Layout) Int16(b []byte) int16

func (Layout) Int32

func (l Layout) Int32(b []byte) int32

func (Layout) Int64

func (l Layout) Int64(b []byte) int64

func (Layout) Order

func (l Layout) Order() binary.ByteOrder

Order returns the byte order of l.

func (Layout) Uint16

func (l Layout) Uint16(b []byte) uint16

func (Layout) Uint32

func (l Layout) Uint32(b []byte) uint32

func (Layout) Uint64

func (l Layout) Uint64(b []byte) uint64

func (Layout) Word

func (l Layout) Word(b []byte) uint64

func (Layout) WordSize

func (l Layout) WordSize() int

WordSize returns the word size of l.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL