Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 193490
b: refs/heads/master
c: 69ec87e
h: refs/heads/master
v: v3
  • Loading branch information
Lin Ming authored and Len Brown committed Apr 20, 2010
1 parent f3a8cfa commit 0226861
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 729df0f848daf2f17d02107199fa92efe909d995
refs/heads/master: 69ec87efa815d69140423014bb5f91e034faac22
8 changes: 8 additions & 0 deletions trunk/drivers/acpi/acpica/acglobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,14 @@ u8 ACPI_INIT_GLOBAL(acpi_gbl_use_default_register_widths, TRUE);
*/
u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_aml_debug_object, FALSE);

/*
* Optionally copy the entire DSDT to local memory (instead of simply
* mapping it.) There are some BIOSs that corrupt or replace the original
* DSDT, creating the need for this option. Default is FALSE, do not copy
* the DSDT.
*/
u8 ACPI_INIT_GLOBAL(acpi_gbl_copy_dsdt_locally, FALSE);

/* acpi_gbl_FADT is a local copy of the FADT, converted to a common format. */

struct acpi_table_fadt acpi_gbl_FADT;
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/acpi/acpica/actables.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ acpi_tb_verify_checksum(struct acpi_table_header *table, u32 length);

void acpi_tb_check_dsdt_header(void);

void acpi_tb_copy_dsdt(struct acpi_table_desc *table_desc);

void
acpi_tb_install_table(acpi_physical_address address,
char *signature, u32 table_index);
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/acpi/acpica/psxface.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#include "acparser.h"
#include "acdispat.h"
#include "acinterp.h"
#include "actables.h"
#include "amlcode.h"

#define _COMPONENT ACPI_PARSER
Expand Down
35 changes: 35 additions & 0 deletions trunk/drivers/acpi/acpica/tbutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,41 @@ void acpi_tb_check_dsdt_header(void)
}
}

/*******************************************************************************
*
* FUNCTION: acpi_tb_copy_dsdt
*
* PARAMETERS: table_desc - Installed table to copy
*
* RETURN: None
*
* DESCRIPTION: Implements a subsystem option to copy the DSDT to local memory.
* Some very bad BIOSs are known to either corrupt the DSDT or
* install a new, bad DSDT. This copy works around the problem.
*
******************************************************************************/

void acpi_tb_copy_dsdt(struct acpi_table_desc *table_desc)
{
struct acpi_table_header *new_table;

new_table = ACPI_ALLOCATE(table_desc->length);
if (!new_table) {
ACPI_ERROR((AE_INFO, "Could not copy DSDT of length 0x%X",
table_desc->length));
return;
}

ACPI_MEMCPY(new_table, table_desc->pointer, table_desc->length);
acpi_tb_delete_table(table_desc);
table_desc->pointer = new_table;
table_desc->flags = ACPI_TABLE_ORIGIN_ALLOCATED;

ACPI_INFO((AE_INFO,
"Forced DSDT copy: length 0x%05X copied locally, original unmapped",
new_table->length));
}

/*******************************************************************************
*
* FUNCTION: acpi_tb_install_table
Expand Down
10 changes: 10 additions & 0 deletions trunk/drivers/acpi/acpica/tbxface.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,16 @@ static acpi_status acpi_tb_load_namespace(void)
goto unlock_and_exit;
}

/*
* Optionally copy the entire DSDT to local memory (instead of simply
* mapping it.) There are some BIOSs that corrupt or replace the original
* DSDT, creating the need for this option. Default is FALSE, do not copy
* the DSDT.
*/
if (acpi_gbl_copy_dsdt_locally) {
acpi_tb_copy_dsdt(acpi_gbl_DSDT);
}

/*
* Save the original DSDT header for detection of table corruption
* and/or replacement of the DSDT from outside the OS.
Expand Down
1 change: 1 addition & 0 deletions trunk/include/acpi/acpixf.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ extern u8 acpi_gbl_use_default_register_widths;
extern acpi_name acpi_gbl_trace_method_name;
extern u32 acpi_gbl_trace_flags;
extern u8 acpi_gbl_enable_aml_debug_object;
extern u8 acpi_gbl_copy_dsdt_locally;

extern u32 acpi_current_gpe_count;
extern struct acpi_table_fadt acpi_gbl_FADT;
Expand Down

0 comments on commit 0226861

Please sign in to comment.