~/bend-docscommunity

fadt.bend checks

raw source on the hub · import bend-osdev-acpi@0.1.1.0/fadt.bend as Fadt

bend-osdev-acpi, fadt.bend: the Fixed ACPI Description Table, "FACP" (ACPI 6.5, section 5.2.9). Every field of revision 6 (276 bytes), grouped by the version that added it; a group is present when the table's length covers all of it:

bytes group since 36-115 AcpiFadtCore: FIRMWARE_CTRL, DSDT, the ACPI 1.0 ACPI 1.0 (116) register blocks and lengths, latencies, RTC alarms, IAPC_BOOT_ARCH, Flags 116-243 AcpiFadtExt: RESET_REG, RESET_VALUE, ACPI 2.0 (244) ARM_BOOT_ARCH, FADT Minor Version, X_FIRMWARE_CTRL, X_DSDT and the eight X_ register blocks 244-267 AcpiFadtSleep: SLEEP_CONTROL_REG, ACPI 5.0 (268) SLEEP_STATUS_REG 268-275 Hypervisor Vendor Identity ACPI 6.0 (276)

(ARM_BOOT_ARCH and the minor version came in ACPI 5.1 in bytes that were reserved before, so older tables read 0 there.) Section 5.2.9 says the X_ forms supersede the 32-bit ones when their address is non-zero; the AcpiFadt.* queries below choose that way.

7 imports
import Base
import bend-osdev-word64@0.1.1.0/word64.bend as W
import bend-osdev-bytes@0.1.1.0/bytes.bend as B
import ./error.bend as E
import ./header.bend as H
import ./fields.bend as F
import ./gas.bend as G

Types

type AcpiFadtBlocks source · line 30 · raw

Data

the ACPI 1.0 register blocks: I/O port addresses

type AcpiFadtLens source · line 34 · raw

Data

their lengths in bytes, and GPE1_BASE

type AcpiFadtCore source · line 38 · raw

Data

bytes 36 to 115. int_model is byte 44, reserved since ACPI 2.0

type AcpiFadtX source · line 42 · raw

Data

the X_ register blocks (Generic Address Structures)

type AcpiFadtExt source · line 46 · raw

Data

bytes 116 to 243

type AcpiFadtSleep source · line 50 · raw

Data

bytes 244 to 267

type AcpiFadt source · line 53 · raw

Data

type AcpiFadtBlock source · line 137 · raw

Data

The fixed register blocks, by name

Definitions

def fadt.core source · line 58 · raw

@+o:0xe0217e1ab38629fddf738452c1f2a82e/bytes.Octets -> AcpiFadtCore

def fadt.x source · line 63 · raw

@+o:0xe0217e1ab38629fddf738452c1f2a82e/bytes.Octets -> AcpiFadtX

def fadt.ext source · line 66 · raw

@has:Bool -> @+o:0xe0217e1ab38629fddf738452c1f2a82e/bytes.Octets -> Maybe<&2, AcpiFadtExt>

def fadt.sleep source · line 73 · raw

@has:Bool -> @+o:0xe0217e1ab38629fddf738452c1f2a82e/bytes.Octets -> Maybe<&2, AcpiFadtSleep>

def fadt.hyp source · line 80 · raw

@has:Bool -> @+o:0xe0217e1ab38629fddf738452c1f2a82e/bytes.Octets -> Maybe<&2, 0xea9c6e6209a3ac3fb21596f70f09f650/word64.W64>

def fadt.read source · line 87 · raw

@ok:Bool -> @+h:0x62173b4e9e82dde7465c7018262f0baa/header.AcpiHeader -> @+o:0xe0217e1ab38629fddf738452c1f2a82e/bytes.Octets -> Result<&2, &2, 0x62173b4e9e82dde7465c7018262f0baa/error.AcpiError, AcpiFadt>

def AcpiFadt.of_sdt source · line 96 · raw

@t:0x62173b4e9e82dde7465c7018262f0baa/header.AcpiSdt -> Result<&2, &2, 0x62173b4e9e82dde7465c7018262f0baa/error.AcpiError, AcpiFadt>

a checked table as an FADT (at least the 116 bytes of ACPI 1.0)

def fadt.parse source · line 102 · raw

@r:Result<&2, &2, 0x62173b4e9e82dde7465c7018262f0baa/error.AcpiError, 0x62173b4e9e82dde7465c7018262f0baa/header.AcpiSdt> -> Result<&2, &2, 0x62173b4e9e82dde7465c7018262f0baa/error.AcpiError, AcpiFadt>

def AcpiFadt.parse source · line 111 · raw

@+o:0xe0217e1ab38629fddf738452c1f2a82e/bytes.Octets -> Result<&2, &2, 0x62173b4e9e82dde7465c7018262f0baa/error.AcpiError, AcpiFadt>

the FADT at the front of o: checked (length, checksum, signature "FACP"), then read

def AcpiFadt.core source · line 116 · raw

@f:AcpiFadt -> AcpiFadtCore

def AcpiFadt.ext source · line 121 · raw

@f:AcpiFadt -> Maybe<&2, AcpiFadtExt>

def AcpiFadt.sleep source · line 126 · raw

@f:AcpiFadt -> Maybe<&2, AcpiFadtSleep>

def AcpiFadt.hypervisor source · line 131 · raw

@f:AcpiFadt -> Maybe<&2, 0xea9c6e6209a3ac3fb21596f70f09f650/word64.W64>

def fadt.legacy source · line 147 · raw

@b:AcpiFadtBlocks -> @l:AcpiFadtLens -> @k:AcpiFadtBlock -> 0x62173b4e9e82dde7465c7018262f0baa/gas.AcpiGas

def fadt.xblock source · line 168 · raw

@x:AcpiFadtX -> @k:AcpiFadtBlock -> 0x62173b4e9e82dde7465c7018262f0baa/gas.AcpiGas

def fadt.core.flags source · line 189 · raw

@c:AcpiFadtCore -> U32

def fadt.core.dsdt source · line 194 · raw

@c:AcpiFadtCore -> U32

def fadt.core.facs source · line 199 · raw

@c:AcpiFadtCore -> U32

def fadt.core.legacy source · line 204 · raw

@k:AcpiFadtBlock -> @c:AcpiFadtCore -> 0x62173b4e9e82dde7465c7018262f0baa/gas.AcpiGas

def AcpiFadt.flags source · line 209 · raw

@f:AcpiFadt -> U32

def AcpiFadt.flag source · line 219 · raw

@+f:AcpiFadt -> @bit:Nat -> Bool

Flags, bit numbers: 0 WBINVD, 1 WBINVD_FLUSH, 2 PROC_C1, 3 P_LVL2_UP, 4 PWR_BUTTON, 5 SLP_BUTTON, 6 FIX_RTC, 7 RTC_S4, 8 TMR_VAL_EXT, 9 DCK_CAP, 10 RESET_REG_SUP, 11 SEALED_CASE, 12 HEADLESS, 13 CPU_SW_SLP, 14 PCI_EXP_WAK, 15 USE_PLATFORM_CLOCK, 16 S4_RTC_STS_VALID, 17 REMOTE_POWER_ON_CAPABLE, 18 FORCE_APIC_CLUSTER_MODEL, 19 FORCE_APIC_PHYSICAL_DESTINATION_MODE, 20 HW_REDUCED_ACPI, 21 LOW_POWER_S0_IDLE_CAPABLE, 22-23 PERSISTENT_CPU_CACHES

def AcpiFadt.hw_reduced source · line 222 · raw

@+f:AcpiFadt -> Bool

def fadt.pick64 source · line 225 · raw

@nz:Bool -> @+x:0xea9c6e6209a3ac3fb21596f70f09f650/word64.W64 -> @lo:U32 -> 0xea9c6e6209a3ac3fb21596f70f09f650/word64.W64

def fadt.dsdt.go source · line 232 · raw

@m:Maybe<&2, AcpiFadtExt> -> @+lo:U32 -> 0xea9c6e6209a3ac3fb21596f70f09f650/word64.W64

def fadt.facs.go source · line 239 · raw

@m:Maybe<&2, AcpiFadtExt> -> @+lo:U32 -> 0xea9c6e6209a3ac3fb21596f70f09f650/word64.W64

def AcpiFadt.dsdt_address source · line 247 · raw

@+f:AcpiFadt -> 0xea9c6e6209a3ac3fb21596f70f09f650/word64.W64

the DSDT's address: X_DSDT when present and non-zero, else DSDT

def AcpiFadt.facs_address source · line 252 · raw

@+f:AcpiFadt -> 0xea9c6e6209a3ac3fb21596f70f09f650/word64.W64

the FACS's address: X_FIRMWARE_CTRL when present and non-zero, else FIRMWARE_CTRL (zero on hardware-reduced systems without a FACS)

def fadt.choose source · line 255 · raw

@nz:Bool -> @+x:0x62173b4e9e82dde7465c7018262f0baa/gas.AcpiGas -> @+legacy:0x62173b4e9e82dde7465c7018262f0baa/gas.AcpiGas -> 0x62173b4e9e82dde7465c7018262f0baa/gas.AcpiGas

def fadt.block.go source · line 262 · raw

@+k:AcpiFadtBlock -> @m:Maybe<&2, AcpiFadtExt> -> @+legacy:0x62173b4e9e82dde7465c7018262f0baa/gas.AcpiGas -> 0x62173b4e9e82dde7465c7018262f0baa/gas.AcpiGas

def AcpiFadt.block source · line 273 · raw

@+f:AcpiFadt -> @+k:AcpiFadtBlock -> 0x62173b4e9e82dde7465c7018262f0baa/gas.AcpiGas

a register block as a Generic Address: the X_ block when present and its address is non-zero, else the 32-bit port with its length (a system I/O block; address 0 when the block is absent)

def fadt.u8 source · line 278 · raw

@v:U32 -> 0xe0217e1ab38629fddf738452c1f2a82e/bytes.Octets

def fadt.enc.core source · line 281 · raw

@c:AcpiFadtCore -> 0xe0217e1ab38629fddf738452c1f2a82e/bytes.Octets

def fadt.enc.ext source · line 286 · raw

@m:Maybe<&2, AcpiFadtExt> -> 0xe0217e1ab38629fddf738452c1f2a82e/bytes.Octets

def fadt.enc.sleep source · line 293 · raw

@m:Maybe<&2, AcpiFadtSleep> -> 0xe0217e1ab38629fddf738452c1f2a82e/bytes.Octets

def fadt.enc.hyp source · line 300 · raw

@m:Maybe<&2, 0xea9c6e6209a3ac3fb21596f70f09f650/word64.W64> -> 0xe0217e1ab38629fddf738452c1f2a82e/bytes.Octets

def AcpiFadt.build source · line 309 · raw

@f:AcpiFadt -> 0xe0217e1ab38629fddf738452c1f2a82e/bytes.Octets

the table (signature "FACP", revision as in the header, length 276, checksum computed)