exconfig.c (126372) | exconfig.c (129684) |
---|---|
1/****************************************************************************** 2 * 3 * Module Name: exconfig - Namespace reconfiguration (Load/Unload opcodes) | 1/****************************************************************************** 2 * 3 * Module Name: exconfig - Namespace reconfiguration (Load/Unload opcodes) |
4 * $Revision: 75 $ | 4 * $Revision: 77 $ |
5 * 6 *****************************************************************************/ 7 8/****************************************************************************** 9 * 10 * 1. Copyright Notice 11 * 12 * Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp. --- 105 unchanged lines hidden (view full) --- 118#define __EXCONFIG_C__ 119 120#include "acpi.h" 121#include "acinterp.h" 122#include "amlcode.h" 123#include "acnamesp.h" 124#include "acevents.h" 125#include "actables.h" | 5 * 6 *****************************************************************************/ 7 8/****************************************************************************** 9 * 10 * 1. Copyright Notice 11 * 12 * Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp. --- 105 unchanged lines hidden (view full) --- 118#define __EXCONFIG_C__ 119 120#include "acpi.h" 121#include "acinterp.h" 122#include "amlcode.h" 123#include "acnamesp.h" 124#include "acevents.h" 125#include "actables.h" |
126#include "acdispat.h" |
|
126 127 128#define _COMPONENT ACPI_EXECUTER 129 ACPI_MODULE_NAME ("exconfig") 130 131 132/******************************************************************************* 133 * --- 236 unchanged lines hidden (view full) --- 370 ACPI_OPERAND_OBJECT *ObjDesc, 371 ACPI_OPERAND_OBJECT *Target, 372 ACPI_WALK_STATE *WalkState) 373{ 374 ACPI_STATUS Status; 375 ACPI_OPERAND_OBJECT *DdbHandle; 376 ACPI_OPERAND_OBJECT *BufferDesc = NULL; 377 ACPI_TABLE_HEADER *TablePtr = NULL; | 127 128 129#define _COMPONENT ACPI_EXECUTER 130 ACPI_MODULE_NAME ("exconfig") 131 132 133/******************************************************************************* 134 * --- 236 unchanged lines hidden (view full) --- 371 ACPI_OPERAND_OBJECT *ObjDesc, 372 ACPI_OPERAND_OBJECT *Target, 373 ACPI_WALK_STATE *WalkState) 374{ 375 ACPI_STATUS Status; 376 ACPI_OPERAND_OBJECT *DdbHandle; 377 ACPI_OPERAND_OBJECT *BufferDesc = NULL; 378 ACPI_TABLE_HEADER *TablePtr = NULL; |
378 UINT8 *TableDataPtr; | 379 ACPI_PHYSICAL_ADDRESS Address; |
379 ACPI_TABLE_HEADER TableHeader; 380 UINT32 i; 381 382 ACPI_FUNCTION_TRACE ("ExLoadOp"); 383 384 385 /* Object can be either an OpRegion or a Field */ 386 387 switch (ACPI_GET_OBJECT_TYPE (ObjDesc)) 388 { 389 case ACPI_TYPE_REGION: 390 391 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Load from Region %p %s\n", 392 ObjDesc, AcpiUtGetObjectTypeName (ObjDesc))); 393 | 380 ACPI_TABLE_HEADER TableHeader; 381 UINT32 i; 382 383 ACPI_FUNCTION_TRACE ("ExLoadOp"); 384 385 386 /* Object can be either an OpRegion or a Field */ 387 388 switch (ACPI_GET_OBJECT_TYPE (ObjDesc)) 389 { 390 case ACPI_TYPE_REGION: 391 392 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Load from Region %p %s\n", 393 ObjDesc, AcpiUtGetObjectTypeName (ObjDesc))); 394 |
394 /* Get the table header */ | 395 /* 396 * If the Region Address and Length have not been previously evaluated, 397 * evaluate them now and save the results. 398 */ 399 if (!(ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)) 400 { 401 Status = AcpiDsGetRegionArguments (ObjDesc); 402 if (ACPI_FAILURE (Status)) 403 { 404 return_ACPI_STATUS (Status); 405 } 406 } |
395 | 407 |
408 /* Get the base physical address of the region */ 409 410 Address = ObjDesc->Region.Address; 411 412 /* Get the table length from the table header */ 413 |
|
396 TableHeader.Length = 0; | 414 TableHeader.Length = 0; |
397 for (i = 0; i < sizeof (ACPI_TABLE_HEADER); i++) | 415 for (i = 0; i < 8; i++) |
398 { 399 Status = AcpiEvAddressSpaceDispatch (ObjDesc, ACPI_READ, | 416 { 417 Status = AcpiEvAddressSpaceDispatch (ObjDesc, ACPI_READ, |
400 (ACPI_PHYSICAL_ADDRESS) i, 8, | 418 (ACPI_PHYSICAL_ADDRESS) i + Address, 8, |
401 ((UINT8 *) &TableHeader) + i); 402 if (ACPI_FAILURE (Status)) 403 { 404 return_ACPI_STATUS (Status); 405 } 406 } 407 | 419 ((UINT8 *) &TableHeader) + i); 420 if (ACPI_FAILURE (Status)) 421 { 422 return_ACPI_STATUS (Status); 423 } 424 } 425 |
426 /* Sanity check the table length */ 427 428 if (TableHeader.Length < sizeof (ACPI_TABLE_HEADER)) 429 { 430 return_ACPI_STATUS (AE_BAD_HEADER); 431 } 432 |
|
408 /* Allocate a buffer for the entire table */ 409 410 TablePtr = ACPI_MEM_ALLOCATE (TableHeader.Length); 411 if (!TablePtr) 412 { 413 return_ACPI_STATUS (AE_NO_MEMORY); 414 } 415 | 433 /* Allocate a buffer for the entire table */ 434 435 TablePtr = ACPI_MEM_ALLOCATE (TableHeader.Length); 436 if (!TablePtr) 437 { 438 return_ACPI_STATUS (AE_NO_MEMORY); 439 } 440 |
416 /* Copy the header to the buffer */ | 441 /* Get the entire table from the op region */ |
417 | 442 |
418 ACPI_MEMCPY (TablePtr, &TableHeader, sizeof (ACPI_TABLE_HEADER)); 419 TableDataPtr = ACPI_PTR_ADD (UINT8, TablePtr, sizeof (ACPI_TABLE_HEADER)); 420 421 /* Get the table from the op region */ 422 | |
423 for (i = 0; i < TableHeader.Length; i++) 424 { 425 Status = AcpiEvAddressSpaceDispatch (ObjDesc, ACPI_READ, | 443 for (i = 0; i < TableHeader.Length; i++) 444 { 445 Status = AcpiEvAddressSpaceDispatch (ObjDesc, ACPI_READ, |
426 (ACPI_PHYSICAL_ADDRESS) i, 8, 427 ((UINT8 *) TableDataPtr + i)); | 446 (ACPI_PHYSICAL_ADDRESS) i + Address, 8, 447 ((UINT8 *) TablePtr + i)); |
428 if (ACPI_FAILURE (Status)) 429 { 430 goto Cleanup; 431 } 432 } 433 break; 434 435 --- 11 unchanged lines hidden (view full) --- 447 */ 448 Status = AcpiExReadDataFromField (WalkState, ObjDesc, &BufferDesc); 449 if (ACPI_FAILURE (Status)) 450 { 451 goto Cleanup; 452 } 453 454 TablePtr = ACPI_CAST_PTR (ACPI_TABLE_HEADER, BufferDesc->Buffer.Pointer); | 448 if (ACPI_FAILURE (Status)) 449 { 450 goto Cleanup; 451 } 452 } 453 break; 454 455 --- 11 unchanged lines hidden (view full) --- 467 */ 468 Status = AcpiExReadDataFromField (WalkState, ObjDesc, &BufferDesc); 469 if (ACPI_FAILURE (Status)) 470 { 471 goto Cleanup; 472 } 473 474 TablePtr = ACPI_CAST_PTR (ACPI_TABLE_HEADER, BufferDesc->Buffer.Pointer); |
475 476 /* Sanity check the table length */ 477 478 if (TablePtr->Length < sizeof (ACPI_TABLE_HEADER)) 479 { 480 return_ACPI_STATUS (AE_BAD_HEADER); 481 } |
|
455 break; 456 457 458 default: 459 return_ACPI_STATUS (AE_AML_OPERAND_TYPE); 460 } 461 462 /* The table must be either an SSDT or a PSDT */ --- 105 unchanged lines hidden --- | 482 break; 483 484 485 default: 486 return_ACPI_STATUS (AE_AML_OPERAND_TYPE); 487 } 488 489 /* The table must be either an SSDT or a PSDT */ --- 105 unchanged lines hidden --- |