RSDT: Difference between revisions

[unchecked revision][unchecked revision]
Content deleted Content added
There should be pages about these tables
m Bot: Replace deprecated source tag with syntaxhighlight
 
(14 intermediate revisions by 9 users not shown)
Line 1:
{{ACPI}}
 
'''RSDT''' (Root System Description Table) is a data structure used in the [[ACPI]] programming interface. This table contains pointers to all the other System Description Tables.
 
Line 4 ⟶ 6:
To find the RSDT you need first to locate and check the [[RSDP]], then use the RsdtPointer for ACPI Version < 2.0 an XsdtPointer for any other case.
 
The ACPI standards state that an OS that complies with ACPI version 2.0 or later should use the [[XSDT]] instead of the RSDT, however I personally doubt that there is a difference on 80x86 computers. AFAIK the XSDT itself was introduced for Itanium's (IA64IA-64) and other 64 bit computers where it's likely that the BIOS (and ACPI tables) are above 4 GB. On 80x86 it's likely that the RSDT and the XSDT both point to the same tables below 4 GB for compatibility reasons (it doesn't make sense to have 2 versions of the same tables) -- Brendan.
 
==Validating the RSDT==
You only need to sum all the bytes in the table and compare the result to 0 (mod 0x100).
 
==Structure==
The RSDT is the main System Description Table. However there are many kinds of SDT. All the SDT may be split into two parts. One (the header) which is common to all the SDT anand another (data) which is different for each table.
The structure of the header is:
<sourcesyntaxhighlight lang="c">
struct ACPISDTHeader {
char Signature[4];
Line 23 ⟶ 25:
uint32_t CreatorID;
uint32_t CreatorRevision;
};
</syntaxhighlight>
</source>
=== Header fields ===
==== Signature ====
All the ACPI tables have a 4byte4 byte Signature field (except the RSDP which has an 8byte8 byte one). Using the signature, you can determine what table are you working with.
 
==== Length ====
Total size of the table, inclusive of the header.
==== Checksum ====
A 8bit8-bit checksum field of the whole table, inclusive of the header. All bytes of the table summed must be equal to 0 (mod 0xFF0x100). You should always do a checksum of the table before using it, even if you found the table linked by other tables.
<sourcesyntaxhighlight lang="c">
bool doChecksum(ACPISDTHeader *tableHeader)
{
Line 44 ⟶ 47:
return sum == 0;
}
</syntaxhighlight>
</source>
 
=== Other fields ===
In case you used RsdtPointer, the complete table structure is:
<sourcesyntaxhighlight lang="c">
struct RSDT {
struct ACPISDTHeader h;
uint32_t PointerToOtherSDT[(h.Length - sizeof(h)) / 4];
};
</syntaxhighlight>
</source>
If you instead used the XsdtPointer, then the table is:
<sourcesyntaxhighlight lang="c">
struct XSDT {
struct ACPISDTHeader h;
uint64_t PointerToOtherSDT[(h.Length - sizeof(h)) / 8];
};
</syntaxhighlight>
</source>
 
== How to use ==
Well, suppose you want to find the [[FADT]]. The FADT, being a SDT has a ACPISDTHeader. It's signature is "FACP".
You may use this code:
<sourcesyntaxhighlight lang="c">
void *findFACP(void *RootSDT)
{
Line 80 ⟶ 84:
return NULL;
}
</syntaxhighlight>
</source>
 
== What can you find? ==
Line 96 ⟶ 100:
* "ERST": Error Record Serialization Table ([[ERST]])
* "FACP": Fixed ACPI Description Table ([[FADT]])
* "FACS": Firmware ACPPIACPI Control Structure ([[FACS]])
* "HEST": Hardware Error Source Table ([[HEST]])
* "MSCT": Maximum System Characteristics Table ([[MSCT]])
Line 103 ⟶ 107:
* "PMTT" Platform Memory Topology Table ([[PMTT]])
* "PSDT": Persistent System Description Table ([[PSDT]])
* "RASF": ACPI RAS FeatureTableFeature Table ([[RASF]])
* "RSDT": Root System Description Table (This wiki page; included for completeness)
* "SBST": Smart Battery Specification Table ([[SBST]])
Line 116 ⟶ 120:
 
== What's next? ==
You should now parse each table pointed by the RSDP.RSDT (Probably you will need only the [[FADT]], the [[SSDT]] and the [[MADT]]). On multiprocessor systems, you should refer to the [[SRAT]] and the [[SLIT]] tables to obtain the NUMA (proximity domain in ACPI jargon) of each processor.
 
[[Category:ACPI]]