ACPI学习笔记 - 不断修订中-last updated on Oct 15
刚起步, 3.0b规范还只看了一部分, 本文档对别人应该没什么意义,只是记录我的学习过程而已。 肯定有大量误解,欢迎BUG FIXING。 /**
* file : ACPI Notes with Linux.txt
* AUTHOR : albcamus * Copyright : GNU FDL(Free Documentation License) * XXX : continuously correcting and improving */
TERMINOLOGY: ===========
I.) TABLES OF ACPI
SDTH : System Description Table Header (注意这个不是Table,它是每个Table都包含的头) RSDP : Root System Description Pointer ('RSD PTR')
RSDT : Root System Description Table (signature is 'RSDT')
FADT : Fixed ACPI Description Table ('FACP')
FACS : Firmware ACPI Control Structure ('FACS')
DSDT : Differentiated System Description Table ('DSDT')
PSDT : Persistent System Description Table
('PSDT'). 注意它是ACPI Spec-1.0定义的,早已被移除。 SSDT : Secondary System Description Table ('SSDT')
MADT : Multipile ACPI Description Table ('APIC')
SBST : Smart Battery Table ('SBST')
XSDT : Extended System Description Table ('XSDT')
ECDT : Embedded Conroller Boot Resources Table ('ECDT')
SLIT : System Locality Distance Information Table ('SLIT')
SRAT : System Resource Affinity Table ('SRAT')
MCFG : PCI-Memory Mapped Configuration table and sub-table ('MCFG')
SPCR : Serial Port Console Redirection table ('SPCR')
BERT : Boot Error Record Table ('BERT')
SBFT : Simple Boot Flag Table ('BOOT')
CPET? : Corrected Platform Error Polling Table ('CPEP')
DBGT? : Debug Port Table
('DBGP')
DMAT? : DMA Remapping Table ('DMAR')
TCPT? : Trusted Computing Platform Alliance Table ('TCPA')
WDRT : Watchdog Resource Table ('WDRT')
ASFT? : Alert Standard Format Table ('ASF!')
具体见ACPI规范3.0b的Table 5-6. 这里只是一部分。
Note, ACPI定义的所有tables、blocks和structures,全都是little-endian。
II.) THE OTHER TERMINOLOGIES
ASL : ACPI Source Language AML : ACPI Machine Language DSL : Digital Simulation Language
E820 : a system memory map protocol, provided in ACPI spec, ch14 for 3.0b EFI : Enhanced Firmware Interface HPET : High Precision Event Timer GPE : General-Purpose Event GSI : Global System Interrupts OSL : OS Service Layer
OSPM : OS Power Management, 指Linux等OS中实现对ACPI支持的代码 PRT : PCI IRQ Routing Table
PXE : Preboot Execution Environment
SAPIC : Streamlined APIC, IA64上使用的APIC。其local SAPIC和I/O SAPIC分别对应着IA32
和x86-64上的Local APIC和I/O APIC SBF : Simple Boot Flag
SCI : System Control Interrupt
(OS-visible interrupts, triggered by ACPI events)
SMBIOS/DMI : System Management BIOS/Desktop Management Interface. PC的BIOS规范。
TOM : Top Of Memory
UUID : Universal Uniform IDentifiers
xface : Linux内核ACPI源文件的命名法,表示Interface。例如tbxface.c实现table的接口。
1, RSDP, RSDT and XSDT
RSDP是位于系统内存地址空间中的,它的值由firmware设置。
RSDP包含了两个指针(还有其他字段,见Linux的struct acpi_table_rsdp),分别保存着RSDT表的物理地址
(32位), 和XSDT表的物理地址(64位)。
Linux寻找RSDP的代码见acpi_os_get_root_pointer()函数。
从ACPI2.0+开始,XSDT就取代了RSDT。 RSDT是ACPI 1.0中的,现代的OEM厂商一般也还提供RSDT,但那只
是为了向后兼容ACPI-1.0而已。 或者用RSDT,或者用XSDT,不管选择用那个,它都包含了其他ACPI表数组 的地址。
Linux下这2者的定义是:
struct acpi_table_rsdt {
struct acpi_table_header header; /* Common ACPI table header */ u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */ };
struct acpi_table_xsdt {
struct acpi_table_header header; /* Common ACPI table header */ u64 table_offset_entry[1]; /* Array of pointers to ACPI tables */ /* FIXME: 为什么数组大小是1? */ };
2, ACPI Table Header
ACPI所有的描述表(FACS表除外?Linux的acpi_table_facs结构不包含header,ACPI规范中也没有)都包含
着一个Header, 所有描述表的Header结构都是一样的。Linux把它定义为:
struct acpi_table_header {
char signature[ACPI_NAME_SIZE]; /* ASCII table signature */ u32 length; /* Length of table in bytes, including this header */ u8 revision; /* ACPI Specification minor version # */