return_ACPI_STATUS(status);
}
- table_desc.address = obj_desc->region.address;
+ table_desc.address = ACPI_PTR_TO_PHYSADDR(table_desc.pointer);
break;
case ACPI_TYPE_BUFFER: /* Buffer or resolved region_field */
}
ACPI_MEMCPY(table_desc.pointer, table, length);
- table_desc.address = ACPI_TO_INTEGER(table_desc.pointer);
+ table_desc.address = ACPI_PTR_TO_PHYSADDR(table_desc.pointer);
break;
default:
/* Map the table if necessary */
if (!table_desc->pointer) {
- if ((table_desc->flags & ACPI_TABLE_ORIGIN_MASK) ==
- ACPI_TABLE_ORIGIN_MAPPED) {
+ switch (table_desc->flags & ACPI_TABLE_ORIGIN_MASK) {
+ case ACPI_TABLE_ORIGIN_MAPPED:
+
table_desc->pointer =
acpi_os_map_memory(table_desc->address,
table_desc->length);
+ break;
+
+ case ACPI_TABLE_ORIGIN_ALLOCATED:
+ case ACPI_TABLE_ORIGIN_UNKNOWN:
+ case ACPI_TABLE_ORIGIN_OVERRIDE:
+
+ table_desc->pointer =
+ ACPI_CAST_PTR(struct acpi_table_header,
+ table_desc->address);
+ break;
+
+ default:
+
+ break;
}
if (!table_desc->pointer) {
case ACPI_TABLE_ORIGIN_ALLOCATED:
ACPI_FREE(table_desc->pointer);
+ table_desc->address = ACPI_PTR_TO_PHYSADDR(NULL);
break;
/* Not mapped or allocated, there is nothing we can do */
ACPI_MEMCPY(new_table, table_desc->pointer, table_desc->length);
acpi_tb_delete_table(table_desc);
+ table_desc->address = ACPI_PTR_TO_PHYSADDR(new_table);
table_desc->pointer = new_table;
table_desc->flags = ACPI_TABLE_ORIGIN_ALLOCATED;