Skip to contentSkip to conversation

2.4/2.6 use xdsdt to print table header

PATCH In review Alex Williamson 2 participants 2 messages Jan 13, 2004 – Jan 26, 2004 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 2.4/2.6 use xdsdt to print table header

I'm resending this patch to get it into the main ACPI source. This
fixes a problem where the DSDT pointer in the FADT is NULL because it uses the 64bit XDSDT instead. The current code is happy to map a NULL address and return success to the caller. This can crash the system or printout garbage headers to the console. It's a simple matter to check table revision and use the XDSDT in favor of the DSDT. This has been living happily in both the 2.4 and 2.6 ia64 tree for some time. Please accept. Thanks,

Alex

Signature · 36 lines
Alex Williamson                             HP Linux & Open Source Lab

diff -Nru a/drivers/acpi/tables.c b/drivers/acpi/tables.c
--- a/drivers/acpi/tables.c	Mon Jan 12 15:37:12 2004
+++ b/drivers/acpi/tables.c	Mon Jan 12 15:37:12 2004
@@ -262,10 +262,17 @@
 
 	/* Map the DSDT header via the pointer in the FADT */
 	if (id == ACPI_DSDT) {
-		struct acpi_table_fadt *fadt = (struct acpi_table_fadt *) *header;
+		struct fadt_descriptor_rev2 *fadt = (struct fadt_descriptor_rev2 *) *header;
+
+		if (fadt->revision == 3 && fadt->Xdsdt) {
+			*header = (void *) __acpi_map_table(fadt->Xdsdt,
+					sizeof(struct acpi_table_header));
+		} else if (fadt->V1_dsdt) {
+			*header = (void *) __acpi_map_table(fadt->V1_dsdt,
+					sizeof(struct acpi_table_header));
+		} else
+			*header = 0;
 
-		*header = (void *) __acpi_map_table(fadt->dsdt_addr,
-				sizeof(struct acpi_table_header));
 		if (!*header) {
 			printk(KERN_WARNING PREFIX "Unable to map DSDT\n");
 			return -ENODEV;





-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
#1 lore raw

Accepted.

Thanks Alex,
-Len

Quoted 10 lines · Alex Williamson

I'm resending this patch to get it into the main ACPI source. This
fixes a problem where the DSDT pointer in the FADT is NULL because it uses the 64bit XDSDT instead. The current code is happy to map a NULL address and return success to the caller. This can crash the system or printout garbage headers to the console. It's a simple matter to check table revision and use the XDSDT in favor of the DSDT. This has been living happily in both the 2.4 and 2.6 ia64 tree for some time. Please accept. Thanks,

Alex

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn