Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 344049
b: refs/heads/master
c: b2a3500
h: refs/heads/master
i:
  344047: b6e4bfe
v: v3
  • Loading branch information
Thomas Renninger authored and H. Peter Anvin committed Oct 1, 2012
1 parent f9bd18f commit d079eb1
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 53aac44c904abbad9f474f652f099de13b5c3563
refs/heads/master: b2a35003dfbcc7b7a5e5c6e524e7d49ba66e0bb5
60 changes: 56 additions & 4 deletions trunk/drivers/acpi/osl.c
Original file line number Diff line number Diff line change
Expand Up @@ -681,12 +681,64 @@ acpi_os_table_override(struct acpi_table_header * existing_table,

acpi_status
acpi_os_physical_table_override(struct acpi_table_header *existing_table,
acpi_physical_address * new_address,
u32 *new_table_length)
acpi_physical_address *address,
u32 *table_length)
{
return AE_SUPPORT;
}
#ifndef CONFIG_ACPI_INITRD_TABLE_OVERRIDE
*table_length = 0;
*address = 0;
return AE_OK;
#else
int table_offset = 0;
struct acpi_table_header *table;

*table_length = 0;
*address = 0;

if (!acpi_tables_addr)
return AE_OK;

do {
if (table_offset + ACPI_HEADER_SIZE > all_tables_size) {
WARN_ON(1);
return AE_OK;
}

table = acpi_os_map_memory(acpi_tables_addr + table_offset,
ACPI_HEADER_SIZE);

if (table_offset + table->length > all_tables_size) {
acpi_os_unmap_memory(table, ACPI_HEADER_SIZE);
WARN_ON(1);
return AE_OK;
}

table_offset += table->length;

if (memcmp(existing_table->signature, table->signature, 4)) {
acpi_os_unmap_memory(table,
ACPI_HEADER_SIZE);
continue;
}

/* Only override tables with matching oem id */
if (memcmp(table->oem_table_id, existing_table->oem_table_id,
ACPI_OEM_TABLE_ID_SIZE)) {
acpi_os_unmap_memory(table,
ACPI_HEADER_SIZE);
continue;
}

table_offset -= table->length;
*table_length = table->length;
acpi_os_unmap_memory(table, ACPI_HEADER_SIZE);
*address = acpi_tables_addr + table_offset;
break;
} while (table_offset + ACPI_HEADER_SIZE < all_tables_size);

return AE_OK;
#endif
}

static irqreturn_t acpi_irq(int irq, void *dev_id)
{
Expand Down

0 comments on commit d079eb1

Please sign in to comment.