cpuid

package
v0.0.0-...-343224e Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2021 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Index

Constants

View Source
const (
	INTEL = 1 << iota
	AMD
)

Internal bit assign to handle vendors

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	Level           uint16
	Type            string
	ThreadsPerCache uint32
	LineSize        uint32
	Partitions      uint32
	Sets            uint32
	Size            uint32
	Ways            uint32
	Flags           []string
}

Cache represents a cache spec

type Processor

type Processor struct {
	VendorID          uint32
	VendorSignature   string
	BrandString       string
	MaxStdLevel       uint32
	MaxExtLevel       uint32
	Family            uint32
	ExtFamily         uint32
	Model             uint32
	ExtModel          uint32
	Stepping          uint32
	Type              uint32
	Prefetch          uint32
	Caches            []*Cache
	TLBs              []*TLB
	BaseFrequency     uint32
	MaximumFrequency  uint32
	SMT               uint32
	LogicalCoreCount  uint32
	PhysicalCoreCount uint32
}

Processor represents a processor spec

func NewDecoder

func NewDecoder() *Processor

NewDecoder creates and initializes a Processor as Decoder

func (*Processor) Decode

func (cpu *Processor) Decode() error

Decode makes Processor satisfy the mox.Decoder interface

func (*Processor) GetCaches

func (p *Processor) GetCaches() []*Cache

GetCaches returns caches

func (*Processor) GetTLBs

func (p *Processor) GetTLBs() []*TLB

GetTLBs returns tlbs

type TLB

type TLB struct {
	Type     string
	PageSize string
	Ways     uint32 // 0xFF = fully associative
	Entries  uint32
}

TLB represents a tlb spec

Jump to

Keyboard shortcuts

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