| .. | .. |
|---|
| 3 | 3 | * |
|---|
| 4 | 4 | * Module Name: dsopcode - Dispatcher support for regions and fields |
|---|
| 5 | 5 | * |
|---|
| 6 | | - * Copyright (C) 2000 - 2018, Intel Corp. |
|---|
| 6 | + * Copyright (C) 2000 - 2020, Intel Corp. |
|---|
| 7 | 7 | * |
|---|
| 8 | 8 | *****************************************************************************/ |
|---|
| 9 | 9 | |
|---|
| .. | .. |
|---|
| 130 | 130 | /* Must have a valid (>0) bit count */ |
|---|
| 131 | 131 | |
|---|
| 132 | 132 | if (bit_count == 0) { |
|---|
| 133 | | - ACPI_ERROR((AE_INFO, |
|---|
| 134 | | - "Attempt to CreateField of length zero")); |
|---|
| 133 | + ACPI_BIOS_ERROR((AE_INFO, |
|---|
| 134 | + "Attempt to CreateField of length zero")); |
|---|
| 135 | 135 | status = AE_AML_OPERAND_VALUE; |
|---|
| 136 | 136 | goto cleanup; |
|---|
| 137 | 137 | } |
|---|
| .. | .. |
|---|
| 194 | 194 | /* Entire field must fit within the current length of the buffer */ |
|---|
| 195 | 195 | |
|---|
| 196 | 196 | if ((bit_offset + bit_count) > (8 * (u32)buffer_desc->buffer.length)) { |
|---|
| 197 | | - ACPI_ERROR((AE_INFO, |
|---|
| 198 | | - "Field [%4.4s] at bit offset/length %u/%u " |
|---|
| 199 | | - "exceeds size of target Buffer (%u bits)", |
|---|
| 200 | | - acpi_ut_get_node_name(result_desc), bit_offset, |
|---|
| 201 | | - bit_count, 8 * (u32)buffer_desc->buffer.length)); |
|---|
| 202 | 197 | status = AE_AML_BUFFER_LIMIT; |
|---|
| 198 | + ACPI_BIOS_EXCEPTION((AE_INFO, status, |
|---|
| 199 | + "Field [%4.4s] at bit offset/length %u/%u " |
|---|
| 200 | + "exceeds size of target Buffer (%u bits)", |
|---|
| 201 | + acpi_ut_get_node_name(result_desc), |
|---|
| 202 | + bit_offset, bit_count, |
|---|
| 203 | + 8 * (u32)buffer_desc->buffer.length)); |
|---|
| 203 | 204 | goto cleanup; |
|---|
| 204 | 205 | } |
|---|
| 205 | 206 | |
|---|
| .. | .. |
|---|
| 216 | 217 | } |
|---|
| 217 | 218 | |
|---|
| 218 | 219 | obj_desc->buffer_field.buffer_obj = buffer_desc; |
|---|
| 220 | + obj_desc->buffer_field.is_create_field = |
|---|
| 221 | + aml_opcode == AML_CREATE_FIELD_OP; |
|---|
| 219 | 222 | |
|---|
| 220 | 223 | /* Reference count for buffer_desc inherits obj_desc count */ |
|---|
| 221 | 224 | |
|---|
| .. | .. |
|---|
| 355 | 358 | union acpi_operand_object *operand_desc; |
|---|
| 356 | 359 | struct acpi_namespace_node *node; |
|---|
| 357 | 360 | union acpi_parse_object *next_op; |
|---|
| 361 | + acpi_adr_space_type space_id; |
|---|
| 358 | 362 | |
|---|
| 359 | 363 | ACPI_FUNCTION_TRACE_PTR(ds_eval_region_operands, op); |
|---|
| 360 | 364 | |
|---|
| .. | .. |
|---|
| 367 | 371 | /* next_op points to the op that holds the space_ID */ |
|---|
| 368 | 372 | |
|---|
| 369 | 373 | next_op = op->common.value.arg; |
|---|
| 374 | + space_id = (acpi_adr_space_type)next_op->common.value.integer; |
|---|
| 370 | 375 | |
|---|
| 371 | 376 | /* next_op points to address op */ |
|---|
| 372 | 377 | |
|---|
| .. | .. |
|---|
| 401 | 406 | |
|---|
| 402 | 407 | obj_desc->region.length = (u32) operand_desc->integer.value; |
|---|
| 403 | 408 | acpi_ut_remove_reference(operand_desc); |
|---|
| 409 | + |
|---|
| 410 | + /* A zero-length operation region is unusable. Just warn */ |
|---|
| 411 | + |
|---|
| 412 | + if (!obj_desc->region.length |
|---|
| 413 | + && (space_id < ACPI_NUM_PREDEFINED_REGIONS)) { |
|---|
| 414 | + ACPI_WARNING((AE_INFO, |
|---|
| 415 | + "Operation Region [%4.4s] has zero length (SpaceId %X)", |
|---|
| 416 | + node->name.ascii, space_id)); |
|---|
| 417 | + } |
|---|
| 404 | 418 | |
|---|
| 405 | 419 | /* |
|---|
| 406 | 420 | * Get the address and save it |
|---|
| .. | .. |
|---|
| 522 | 536 | obj_desc, |
|---|
| 523 | 537 | ACPI_FORMAT_UINT64(obj_desc->region.address), |
|---|
| 524 | 538 | obj_desc->region.length)); |
|---|
| 525 | | - |
|---|
| 526 | | - status = acpi_ut_add_address_range(obj_desc->region.space_id, |
|---|
| 527 | | - obj_desc->region.address, |
|---|
| 528 | | - obj_desc->region.length, node); |
|---|
| 529 | 539 | |
|---|
| 530 | 540 | /* Now the address and length are valid for this opregion */ |
|---|
| 531 | 541 | |
|---|