Add code for replacing DSDT. See comments in the file.

Ideas from T.Shiozaki.
This commit is contained in:
kochi 2004-06-07 17:35:14 +00:00
parent 96f8bc3637
commit 7322c3b561
1 changed files with 34 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: OsdMisc.c,v 1.9 2004/04/11 06:52:38 kochi Exp $ */
/* $NetBSD: OsdMisc.c,v 1.10 2004/06/07 17:35:14 kochi Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: OsdMisc.c,v 1.9 2004/04/11 06:52:38 kochi Exp $");
__KERNEL_RCSID(0, "$NetBSD: OsdMisc.c,v 1.10 2004/06/07 17:35:14 kochi Exp $");
#include "opt_ddb.h"
@ -58,6 +58,31 @@ __KERNEL_RCSID(0, "$NetBSD: OsdMisc.c,v 1.9 2004/04/11 06:52:38 kochi Exp $");
#include <dev/acpi/acpi_osd.h>
#include <dev/acpi/acpica/Subsystem/acdebug.h>
/*
* for debugging DSDT (try this at your own risk!):
*
* 1. dump your raw DSDT (with acpidump(*1) etc.)
* 2. disassemble with iasl -d (*2)
* 3. modify the ASL file
* 4. compile it with iasl -tc
* 5. copy *.hex to /sys/dev/acpi/acpica/Osd/dsdt.hex
* -or-
* options ACPI_DSDT_FILE="\"yourdsdt.hex\"" in
* your config file and yourdsdt.hex in the build directory
* 6. uncomment ACPI_DEDT_OVERRIDE or options ACPI_DSDT_OVERRIDE
* in your kernel config file and rebuild the kernel
*
* (*1) /usr/pkgsrc/sysutils/acpidump
* (*2) /usr/pkgsrc/sysutils/acpi-iasl
*/
/* #define ACPI_DSDT_OVERRIDE */
#ifdef ACPI_DSDT_OVERRIDE
#ifndef ACPI_DSDT_FILE
#define ACPI_DSDT_FILE "dsdt.hex"
#endif
#include ACPI_DSDT_FILE
#endif
int acpi_indebugger;
@ -125,7 +150,14 @@ ACPI_STATUS
AcpiOsTableOverride(ACPI_TABLE_HEADER *ExistingTable,
ACPI_TABLE_HEADER **NewTable)
{
#ifndef ACPI_DSDT_OVERRIDE
*NewTable = NULL;
#else
if (strncmp(ExistingTable->Signature, "DSDT", 4) == 0)
*NewTable = (ACPI_TABLE_HEADER *)AmlCode;
else
*NewTable = NULL;
#endif
return AE_OK;
}