.. | .. |
---|
3 | 3 | * |
---|
4 | 4 | * Module Name: evrgnini- ACPI address_space (op_region) init |
---|
5 | 5 | * |
---|
6 | | - * Copyright (C) 2000 - 2018, Intel Corp. |
---|
| 6 | + * Copyright (C) 2000 - 2020, Intel Corp. |
---|
7 | 7 | * |
---|
8 | 8 | *****************************************************************************/ |
---|
9 | 9 | |
---|
.. | .. |
---|
38 | 38 | union acpi_operand_object *region_desc = |
---|
39 | 39 | (union acpi_operand_object *)handle; |
---|
40 | 40 | struct acpi_mem_space_context *local_region_context; |
---|
| 41 | + struct acpi_mem_mapping *mm; |
---|
41 | 42 | |
---|
42 | 43 | ACPI_FUNCTION_TRACE(ev_system_memory_region_setup); |
---|
43 | 44 | |
---|
.. | .. |
---|
46 | 47 | local_region_context = |
---|
47 | 48 | (struct acpi_mem_space_context *)*region_context; |
---|
48 | 49 | |
---|
49 | | - /* Delete a cached mapping if present */ |
---|
| 50 | + /* Delete memory mappings if present */ |
---|
50 | 51 | |
---|
51 | | - if (local_region_context->mapped_length) { |
---|
52 | | - acpi_os_unmap_memory(local_region_context-> |
---|
53 | | - mapped_logical_address, |
---|
54 | | - local_region_context-> |
---|
55 | | - mapped_length); |
---|
| 52 | + while (local_region_context->first_mm) { |
---|
| 53 | + mm = local_region_context->first_mm; |
---|
| 54 | + local_region_context->first_mm = mm->next_mm; |
---|
| 55 | + acpi_os_unmap_memory(mm->logical_address, |
---|
| 56 | + mm->length); |
---|
| 57 | + ACPI_FREE(mm); |
---|
56 | 58 | } |
---|
57 | 59 | ACPI_FREE(local_region_context); |
---|
58 | 60 | *region_context = NULL; |
---|
.. | .. |
---|
198 | 200 | * root bridge. Still need to return a context object |
---|
199 | 201 | * for the new PCI_Config operation region, however. |
---|
200 | 202 | */ |
---|
201 | | - status = AE_OK; |
---|
202 | 203 | } else { |
---|
203 | 204 | ACPI_EXCEPTION((AE_INFO, status, |
---|
204 | 205 | "Could not install PciConfig handler " |
---|
.. | .. |
---|
514 | 515 | case ACPI_TYPE_THERMAL: |
---|
515 | 516 | |
---|
516 | 517 | handler_obj = obj_desc->common_notify.handler; |
---|
517 | | - break; |
---|
518 | | - |
---|
519 | | - case ACPI_TYPE_METHOD: |
---|
520 | | - /* |
---|
521 | | - * If we are executing module level code, the original |
---|
522 | | - * Node's object was replaced by this Method object and we |
---|
523 | | - * saved the handler in the method object. |
---|
524 | | - * |
---|
525 | | - * Note: Only used for the legacy MLC support. Will |
---|
526 | | - * be removed in the future. |
---|
527 | | - * |
---|
528 | | - * See acpi_ns_exec_module_code |
---|
529 | | - */ |
---|
530 | | - if (!acpi_gbl_execute_tables_as_methods && |
---|
531 | | - obj_desc->method. |
---|
532 | | - info_flags & ACPI_METHOD_MODULE_LEVEL) { |
---|
533 | | - handler_obj = |
---|
534 | | - obj_desc->method.dispatch.handler; |
---|
535 | | - } |
---|
536 | 518 | break; |
---|
537 | 519 | |
---|
538 | 520 | default: |
---|