RSDT: Difference between revisions

[unchecked revision][unchecked revision]
Content deleted Content added
m Bot: Replace deprecated source tag with syntaxhighlight
 
(2 intermediate revisions by 2 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 12 ⟶ 14:
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 and another (data) which is different for each table.
The structure of the header is:
<sourcesyntaxhighlight lang="c">
struct ACPISDTHeader {
char Signature[4];
Line 24 ⟶ 26:
uint32_t CreatorRevision;
};
</syntaxhighlight>
</source>
=== Header fields ===
==== Signature ====
Line 33 ⟶ 35:
==== Checksum ====
A 8-bit checksum field of the whole table, inclusive of the header. All bytes of the table summed must be equal to 0 (mod 0x100). 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 45 ⟶ 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 82 ⟶ 84:
return NULL;
}
</syntaxhighlight>
</source>
 
== What can you find? ==