Print this page
update to acpica-unix2-20140114
acpica-unix2-20130823
PANKOVs restructure
   1 /*******************************************************************************
   2  *
   3  * Module Name: dsmthdat - control method arguments and local variables
   4  *
   5  ******************************************************************************/
   6 
   7 /*
   8  * Copyright (C) 2000 - 2011, Intel Corp.
   9  * All rights reserved.
  10  *
  11  * Redistribution and use in source and binary forms, with or without
  12  * modification, are permitted provided that the following conditions
  13  * are met:
  14  * 1. Redistributions of source code must retain the above copyright
  15  *    notice, this list of conditions, and the following disclaimer,
  16  *    without modification.
  17  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  18  *    substantially similar to the "NO WARRANTY" disclaimer below
  19  *    ("Disclaimer") and any redistribution must be conditioned upon
  20  *    including a substantially similar Disclaimer requirement for further
  21  *    binary redistribution.
  22  * 3. Neither the names of the above-listed copyright holders nor the names
  23  *    of any contributors may be used to endorse or promote products derived
  24  *    from this software without specific prior written permission.
  25  *
  26  * Alternatively, this software may be distributed under the terms of the
  27  * GNU General Public License ("GPL") version 2 as published by the Free
  28  * Software Foundation.


 298 
 299         *Node = &WalkState->LocalVariables[Index];
 300         break;
 301 
 302     case ACPI_REFCLASS_ARG:
 303 
 304         if (Index > ACPI_METHOD_MAX_ARG)
 305         {
 306             ACPI_ERROR ((AE_INFO,
 307                 "Arg index %u is invalid (max %u)",
 308                 Index, ACPI_METHOD_MAX_ARG));
 309             return_ACPI_STATUS (AE_AML_INVALID_INDEX);
 310         }
 311 
 312         /* Return a pointer to the pseudo-node */
 313 
 314         *Node = &WalkState->Arguments[Index];
 315         break;
 316 
 317     default:

 318         ACPI_ERROR ((AE_INFO, "Type %u is invalid", Type));
 319         return_ACPI_STATUS (AE_TYPE);
 320     }
 321 
 322     return_ACPI_STATUS (AE_OK);
 323 }
 324 
 325 
 326 /*******************************************************************************
 327  *
 328  * FUNCTION:    AcpiDsMethodDataSetValue
 329  *
 330  * PARAMETERS:  Type                - Either ACPI_REFCLASS_LOCAL or
 331  *                                    ACPI_REFCLASS_ARG
 332  *              Index               - Which Local or Arg to get
 333  *              Object              - Object to be inserted into the stack entry
 334  *              WalkState           - Current walk state object
 335  *
 336  * RETURN:      Status
 337  *


 455             {
 456                 return_ACPI_STATUS (AE_NO_MEMORY);
 457             }
 458 
 459             Node->Object = Object;
 460         }
 461 
 462         /* Otherwise, return the error */
 463 
 464         else switch (Type)
 465         {
 466         case ACPI_REFCLASS_ARG:
 467 
 468             ACPI_ERROR ((AE_INFO,
 469                 "Uninitialized Arg[%u] at node %p",
 470                 Index, Node));
 471 
 472             return_ACPI_STATUS (AE_AML_UNINITIALIZED_ARG);
 473 
 474         case ACPI_REFCLASS_LOCAL:
 475 
 476             /*
 477              * No error message for this case, will be trapped again later to
 478              * detect and ignore cases of Store(LocalX,LocalX)
 479              */
 480             return_ACPI_STATUS (AE_AML_UNINITIALIZED_LOCAL);
 481 
 482         default:
 483 
 484             ACPI_ERROR ((AE_INFO, "Not a Arg/Local opcode: 0x%X", Type));
 485             return_ACPI_STATUS (AE_AML_INTERNAL);
 486         }
 487     }
 488 
 489     /*
 490      * The Index points to an initialized and valid object.
 491      * Return an additional reference to the object
 492      */
 493     *DestDesc = Object;
 494     AcpiUtAddReference (Object);
 495 


 751     if (ACPI_FAILURE (Status))
 752     {
 753         return_VALUE ((ACPI_TYPE_NOT_FOUND));
 754     }
 755 
 756     /* Get the object */
 757 
 758     Object = AcpiNsGetAttachedObject (Node);
 759     if (!Object)
 760     {
 761         /* Uninitialized local/arg, return TYPE_ANY */
 762 
 763         return_VALUE (ACPI_TYPE_ANY);
 764     }
 765 
 766     /* Get the object type */
 767 
 768     return_VALUE (Object->Type);
 769 }
 770 #endif
 771 
 772 
   1 /*******************************************************************************
   2  *
   3  * Module Name: dsmthdat - control method arguments and local variables
   4  *
   5  ******************************************************************************/
   6 
   7 /*
   8  * Copyright (C) 2000 - 2014, Intel Corp.
   9  * All rights reserved.
  10  *
  11  * Redistribution and use in source and binary forms, with or without
  12  * modification, are permitted provided that the following conditions
  13  * are met:
  14  * 1. Redistributions of source code must retain the above copyright
  15  *    notice, this list of conditions, and the following disclaimer,
  16  *    without modification.
  17  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  18  *    substantially similar to the "NO WARRANTY" disclaimer below
  19  *    ("Disclaimer") and any redistribution must be conditioned upon
  20  *    including a substantially similar Disclaimer requirement for further
  21  *    binary redistribution.
  22  * 3. Neither the names of the above-listed copyright holders nor the names
  23  *    of any contributors may be used to endorse or promote products derived
  24  *    from this software without specific prior written permission.
  25  *
  26  * Alternatively, this software may be distributed under the terms of the
  27  * GNU General Public License ("GPL") version 2 as published by the Free
  28  * Software Foundation.


 298 
 299         *Node = &WalkState->LocalVariables[Index];
 300         break;
 301 
 302     case ACPI_REFCLASS_ARG:
 303 
 304         if (Index > ACPI_METHOD_MAX_ARG)
 305         {
 306             ACPI_ERROR ((AE_INFO,
 307                 "Arg index %u is invalid (max %u)",
 308                 Index, ACPI_METHOD_MAX_ARG));
 309             return_ACPI_STATUS (AE_AML_INVALID_INDEX);
 310         }
 311 
 312         /* Return a pointer to the pseudo-node */
 313 
 314         *Node = &WalkState->Arguments[Index];
 315         break;
 316 
 317     default:
 318 
 319         ACPI_ERROR ((AE_INFO, "Type %u is invalid", Type));
 320         return_ACPI_STATUS (AE_TYPE);
 321     }
 322 
 323     return_ACPI_STATUS (AE_OK);
 324 }
 325 
 326 
 327 /*******************************************************************************
 328  *
 329  * FUNCTION:    AcpiDsMethodDataSetValue
 330  *
 331  * PARAMETERS:  Type                - Either ACPI_REFCLASS_LOCAL or
 332  *                                    ACPI_REFCLASS_ARG
 333  *              Index               - Which Local or Arg to get
 334  *              Object              - Object to be inserted into the stack entry
 335  *              WalkState           - Current walk state object
 336  *
 337  * RETURN:      Status
 338  *


 456             {
 457                 return_ACPI_STATUS (AE_NO_MEMORY);
 458             }
 459 
 460             Node->Object = Object;
 461         }
 462 
 463         /* Otherwise, return the error */
 464 
 465         else switch (Type)
 466         {
 467         case ACPI_REFCLASS_ARG:
 468 
 469             ACPI_ERROR ((AE_INFO,
 470                 "Uninitialized Arg[%u] at node %p",
 471                 Index, Node));
 472 
 473             return_ACPI_STATUS (AE_AML_UNINITIALIZED_ARG);
 474 
 475         case ACPI_REFCLASS_LOCAL:

 476             /*
 477              * No error message for this case, will be trapped again later to
 478              * detect and ignore cases of Store(LocalX,LocalX)
 479              */
 480             return_ACPI_STATUS (AE_AML_UNINITIALIZED_LOCAL);
 481 
 482         default:
 483 
 484             ACPI_ERROR ((AE_INFO, "Not a Arg/Local opcode: 0x%X", Type));
 485             return_ACPI_STATUS (AE_AML_INTERNAL);
 486         }
 487     }
 488 
 489     /*
 490      * The Index points to an initialized and valid object.
 491      * Return an additional reference to the object
 492      */
 493     *DestDesc = Object;
 494     AcpiUtAddReference (Object);
 495 


 751     if (ACPI_FAILURE (Status))
 752     {
 753         return_VALUE ((ACPI_TYPE_NOT_FOUND));
 754     }
 755 
 756     /* Get the object */
 757 
 758     Object = AcpiNsGetAttachedObject (Node);
 759     if (!Object)
 760     {
 761         /* Uninitialized local/arg, return TYPE_ANY */
 762 
 763         return_VALUE (ACPI_TYPE_ANY);
 764     }
 765 
 766     /* Get the object type */
 767 
 768     return_VALUE (Object->Type);
 769 }
 770 #endif