fadt.bend checks
raw source on the hub · import bend-osdev-acpi@0.1.2.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.1/word64.bend as W import bend-osdev-bytes@0.1.1.1/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
AcpiFadtBlocks@pm1a_evt:U32 -> @pm1b_evt:U32 -> @pm1a_cnt:U32 -> @pm1b_cnt:U32 -> @pm2_cnt:U32 -> @pm_tmr:U32 -> @gpe0:U32 -> @gpe1:U32 -> AcpiFadtBlocks
type AcpiFadtLens source · line 34 · raw
Data
their lengths in bytes, and GPE1_BASE
AcpiFadtLens@pm1_evt:U32 -> @pm1_cnt:U32 -> @pm2_cnt:U32 -> @pm_tmr:U32 -> @gpe0:U32 -> @gpe1:U32 -> @gpe1_base:U32 -> AcpiFadtLens
type AcpiFadtCore source · line 38 · raw
Data
bytes 36 to 115. int_model is byte 44, reserved since ACPI 2.0
AcpiFadtCore@firmware_ctrl:U32 -> @dsdt:U32 -> @int_model:U32 -> @pm_profile:U32 -> @sci_int:U32 -> @smi_cmd:U32 -> @acpi_enable:U32 -> @acpi_disable:U32 -> @s4bios_req:U32 -> @pstate_cnt:U32 -> @blocks:AcpiFadtBlocks -> @lens:AcpiFadtLens -> @cst_cnt:U32 -> @p_lvl2_lat:U32 -> @p_lvl3_lat:U32 -> @flush_size:U32 -> @flush_stride:U32 -> @duty_offset:U32 -> @duty_width:U32 -> @day_alrm:U32 -> @mon_alrm:U32 -> @century:U32 -> @iapc_boot_arch:U32 -> @flags:U32 -> AcpiFadtCore
type AcpiFadtX source · line 42 · raw
Data
the X_ register blocks (Generic Address Structures)
AcpiFadtX@pm1a_evt:0x437a65a35fd0c02411bea19819f9b33f/gas.AcpiGas -> @pm1b_evt:0x437a65a35fd0c02411bea19819f9b33f/gas.AcpiGas -> @pm1a_cnt:0x437a65a35fd0c02411bea19819f9b33f/gas.AcpiGas -> @pm1b_cnt:0x437a65a35fd0c02411bea19819f9b33f/gas.AcpiGas -> @pm2_cnt:0x437a65a35fd0c02411bea19819f9b33f/gas.AcpiGas -> @pm_tmr:0x437a65a35fd0c02411bea19819f9b33f/gas.AcpiGas -> @gpe0:0x437a65a35fd0c02411bea19819f9b33f/gas.AcpiGas -> @gpe1:0x437a65a35fd0c02411bea19819f9b33f/gas.AcpiGas -> AcpiFadtX
type AcpiFadtExt source · line 46 · raw
Data
bytes 116 to 243
AcpiFadtExt@reset_reg:0x437a65a35fd0c02411bea19819f9b33f/gas.AcpiGas -> @reset_value:U32 -> @arm_boot_arch:U32 -> @minor_version:U32 -> @x_firmware_ctrl:0xea9c6e6209a3ac3fb21596f70f09f650/word64.W64 -> @x_dsdt:0xea9c6e6209a3ac3fb21596f70f09f650/word64.W64 -> @x:AcpiFadtX -> AcpiFadtExt
type AcpiFadtSleep source · line 50 · raw
Data
bytes 244 to 267
AcpiFadtSleep@control:0x437a65a35fd0c02411bea19819f9b33f/gas.AcpiGas -> @status:0x437a65a35fd0c02411bea19819f9b33f/gas.AcpiGas -> AcpiFadtSleep
type AcpiFadt source · line 53 · raw
Data
AcpiFadt@header:0x437a65a35fd0c02411bea19819f9b33f/header.AcpiHeader -> @core:AcpiFadtCore -> @ext:Maybe<&2, AcpiFadtExt> -> @sleep:Maybe<&2, AcpiFadtSleep> -> @hypervisor:Maybe<&2, 0xea9c6e6209a3ac3fb21596f70f09f650/word64.W64> -> AcpiFadt
type AcpiFadtBlock source · line 137 · raw
Data
The fixed register blocks, by name
AcpiFadtPm1aEvtAcpiFadtBlock
AcpiFadtPm1bEvtAcpiFadtBlock
AcpiFadtPm1aCntAcpiFadtBlock
AcpiFadtPm1bCntAcpiFadtBlock
AcpiFadtPm2CntAcpiFadtBlock
AcpiFadtPmTmrAcpiFadtBlock
AcpiFadtGpe0AcpiFadtBlock
AcpiFadtGpe1AcpiFadtBlock
Definitions
def fadt.core source · line 58 · raw
@+o:0x15cc157649e26d54c7c549cb80d4a2a9/bytes.Octets -> AcpiFadtCore
def fadt.x source · line 63 · raw
@+o:0x15cc157649e26d54c7c549cb80d4a2a9/bytes.Octets -> AcpiFadtX
def fadt.ext source · line 66 · raw
@has:Bool -> @+o:0x15cc157649e26d54c7c549cb80d4a2a9/bytes.Octets -> Maybe<&2, AcpiFadtExt>
def fadt.sleep source · line 73 · raw
@has:Bool -> @+o:0x15cc157649e26d54c7c549cb80d4a2a9/bytes.Octets -> Maybe<&2, AcpiFadtSleep>
def fadt.hyp source · line 80 · raw
@has:Bool -> @+o:0x15cc157649e26d54c7c549cb80d4a2a9/bytes.Octets -> Maybe<&2, 0xea9c6e6209a3ac3fb21596f70f09f650/word64.W64>
def fadt.read source · line 87 · raw
@ok:Bool -> @+h:0x437a65a35fd0c02411bea19819f9b33f/header.AcpiHeader -> @+o:0x15cc157649e26d54c7c549cb80d4a2a9/bytes.Octets -> Result<&2, &2, 0x437a65a35fd0c02411bea19819f9b33f/error.AcpiError, AcpiFadt>
def AcpiFadt.of_sdt source · line 96 · raw
@t:0x437a65a35fd0c02411bea19819f9b33f/header.AcpiSdt -> Result<&2, &2, 0x437a65a35fd0c02411bea19819f9b33f/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, 0x437a65a35fd0c02411bea19819f9b33f/error.AcpiError, 0x437a65a35fd0c02411bea19819f9b33f/header.AcpiSdt> -> Result<&2, &2, 0x437a65a35fd0c02411bea19819f9b33f/error.AcpiError, AcpiFadt>
def AcpiFadt.parse source · line 111 · raw
@+o:0x15cc157649e26d54c7c549cb80d4a2a9/bytes.Octets -> Result<&2, &2, 0x437a65a35fd0c02411bea19819f9b33f/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 -> 0x437a65a35fd0c02411bea19819f9b33f/gas.AcpiGas
def fadt.xblock source · line 168 · raw
@x:AcpiFadtX -> @k:AcpiFadtBlock -> 0x437a65a35fd0c02411bea19819f9b33f/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 -> 0x437a65a35fd0c02411bea19819f9b33f/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:0x437a65a35fd0c02411bea19819f9b33f/gas.AcpiGas -> @+legacy:0x437a65a35fd0c02411bea19819f9b33f/gas.AcpiGas -> 0x437a65a35fd0c02411bea19819f9b33f/gas.AcpiGas
def fadt.block.go source · line 262 · raw
@+k:AcpiFadtBlock -> @m:Maybe<&2, AcpiFadtExt> -> @+legacy:0x437a65a35fd0c02411bea19819f9b33f/gas.AcpiGas -> 0x437a65a35fd0c02411bea19819f9b33f/gas.AcpiGas
def AcpiFadt.block source · line 273 · raw
@+f:AcpiFadt -> @+k:AcpiFadtBlock -> 0x437a65a35fd0c02411bea19819f9b33f/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 -> 0x15cc157649e26d54c7c549cb80d4a2a9/bytes.Octets
def fadt.enc.core source · line 281 · raw
@c:AcpiFadtCore -> 0x15cc157649e26d54c7c549cb80d4a2a9/bytes.Octets
def fadt.enc.ext source · line 286 · raw
@m:Maybe<&2, AcpiFadtExt> -> 0x15cc157649e26d54c7c549cb80d4a2a9/bytes.Octets
def fadt.enc.sleep source · line 293 · raw
@m:Maybe<&2, AcpiFadtSleep> -> 0x15cc157649e26d54c7c549cb80d4a2a9/bytes.Octets
def fadt.enc.hyp source · line 300 · raw
@m:Maybe<&2, 0xea9c6e6209a3ac3fb21596f70f09f650/word64.W64> -> 0x15cc157649e26d54c7c549cb80d4a2a9/bytes.Octets
def AcpiFadt.build source · line 309 · raw
@f:AcpiFadt -> 0x15cc157649e26d54c7c549cb80d4a2a9/bytes.Octets
the table (signature "FACP", revision as in the header, length 276, checksum computed)