acpi

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Install

func Install(vm hv.VirtualMachine, cfg Config) error

Install writes ACPI tables into guest memory using the provided config.

Types

type Config

type Config struct {
	MemoryBase uint64
	MemorySize uint64
	TablesBase uint64
	TablesSize uint64
	RSDPBase   uint64

	NumCPUs   int
	LAPICBase uint32

	IOAPIC IOAPICConfig

	HPET *HPETConfig

	// VirtioDevices describes virtio-mmio devices to add to the DSDT.
	VirtioDevices []VirtioMMIODevice

	// ISAOverrides emits MADT interrupt source overrides for legacy ISA IRQs.
	ISAOverrides []InterruptOverride

	OEM OEMInfo
}

Config controls how ACPI tables are laid out and populated inside guest memory. All addresses are physical guest addresses.

type HPETConfig

type HPETConfig struct {
	Address uint64
}

HPETConfig describes the optional HPET ACPI table.

type IOAPICConfig

type IOAPICConfig struct {
	ID      uint8
	Address uint32
	GSIBase uint32
}

IOAPICConfig describes the IO-APIC entry that will be emitted into MADT.

type InterruptOverride

type InterruptOverride struct {
	Bus   uint8  // typically 0 (ISA)
	IRQ   uint8  // source IRQ
	GSI   uint32 // destination GSI
	Flags uint16 // polarity/trigger encoding per ACPI spec
}

InterruptOverride describes a single MADT INT_SRC_OVR entry.

type OEMInfo

type OEMInfo struct {
	OEMID           [6]byte
	OEMTableID      [8]byte
	OEMRevision     uint32
	CreatorID       [4]byte
	CreatorRevision uint32
}

OEMInfo mirrors the ACPI table header OEM fields.

func DefaultOEMInfo

func DefaultOEMInfo() OEMInfo

DefaultOEMInfo returns the default table header metadata used by the VMM.

type VirtioMMIODevice

type VirtioMMIODevice struct {
	Name     string // 4-char ACPI name (e.g., "VIO0")
	BaseAddr uint64
	Size     uint64
	GSI      uint32 // Global System Interrupt number
}

VirtioMMIODevice describes a virtio-mmio device for DSDT generation.

Jump to

Keyboard shortcuts

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