ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

exoparg2.c
Go to the documentation of this file.
00001 /******************************************************************************
00002  *
00003  * Module Name: exoparg2 - AML execution - opcodes with 2 arguments
00004  *
00005  *****************************************************************************/
00006 
00007 /******************************************************************************
00008  *
00009  * 1. Copyright Notice
00010  *
00011  * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
00012  * All rights reserved.
00013  *
00014  * 2. License
00015  *
00016  * 2.1. This is your license from Intel Corp. under its intellectual property
00017  * rights.  You may have additional license terms from the party that provided
00018  * you this software, covering your right to use that party's intellectual
00019  * property rights.
00020  *
00021  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
00022  * copy of the source code appearing in this file ("Covered Code") an
00023  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
00024  * base code distributed originally by Intel ("Original Intel Code") to copy,
00025  * make derivatives, distribute, use and display any portion of the Covered
00026  * Code in any form, with the right to sublicense such rights; and
00027  *
00028  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
00029  * license (with the right to sublicense), under only those claims of Intel
00030  * patents that are infringed by the Original Intel Code, to make, use, sell,
00031  * offer to sell, and import the Covered Code and derivative works thereof
00032  * solely to the minimum extent necessary to exercise the above copyright
00033  * license, and in no event shall the patent license extend to any additions
00034  * to or modifications of the Original Intel Code.  No other license or right
00035  * is granted directly or by implication, estoppel or otherwise;
00036  *
00037  * The above copyright and patent license is granted only if the following
00038  * conditions are met:
00039  *
00040  * 3. Conditions
00041  *
00042  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
00043  * Redistribution of source code of any substantial portion of the Covered
00044  * Code or modification with rights to further distribute source must include
00045  * the above Copyright Notice, the above License, this list of Conditions,
00046  * and the following Disclaimer and Export Compliance provision.  In addition,
00047  * Licensee must cause all Covered Code to which Licensee contributes to
00048  * contain a file documenting the changes Licensee made to create that Covered
00049  * Code and the date of any change.  Licensee must include in that file the
00050  * documentation of any changes made by any predecessor Licensee.  Licensee
00051  * must include a prominent statement that the modification is derived,
00052  * directly or indirectly, from Original Intel Code.
00053  *
00054  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
00055  * Redistribution of source code of any substantial portion of the Covered
00056  * Code or modification without rights to further distribute source must
00057  * include the following Disclaimer and Export Compliance provision in the
00058  * documentation and/or other materials provided with distribution.  In
00059  * addition, Licensee may not authorize further sublicense of source of any
00060  * portion of the Covered Code, and must include terms to the effect that the
00061  * license from Licensee to its licensee is limited to the intellectual
00062  * property embodied in the software Licensee provides to its licensee, and
00063  * not to intellectual property embodied in modifications its licensee may
00064  * make.
00065  *
00066  * 3.3. Redistribution of Executable. Redistribution in executable form of any
00067  * substantial portion of the Covered Code or modification must reproduce the
00068  * above Copyright Notice, and the following Disclaimer and Export Compliance
00069  * provision in the documentation and/or other materials provided with the
00070  * distribution.
00071  *
00072  * 3.4. Intel retains all right, title, and interest in and to the Original
00073  * Intel Code.
00074  *
00075  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
00076  * Intel shall be used in advertising or otherwise to promote the sale, use or
00077  * other dealings in products derived from or relating to the Covered Code
00078  * without prior written authorization from Intel.
00079  *
00080  * 4. Disclaimer and Export Compliance
00081  *
00082  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
00083  * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
00084  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
00085  * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
00086  * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
00087  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
00088  * PARTICULAR PURPOSE.
00089  *
00090  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
00091  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
00092  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
00093  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
00094  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
00095  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
00096  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
00097  * LIMITED REMEDY.
00098  *
00099  * 4.3. Licensee shall not export, either directly or indirectly, any of this
00100  * software or system incorporating such software without first obtaining any
00101  * required license or other approval from the U. S. Department of Commerce or
00102  * any other agency or department of the United States Government.  In the
00103  * event Licensee exports any such software from the United States or
00104  * re-exports any such software from a foreign destination, Licensee shall
00105  * ensure that the distribution and export/re-export of the software is in
00106  * compliance with all laws, regulations, orders, or other restrictions of the
00107  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
00108  * any of its subsidiaries will export/re-export any technical data, process,
00109  * software, or service, directly or indirectly, to any country for which the
00110  * United States government or any agency thereof requires an export license,
00111  * other governmental approval, or letter of assurance, without first obtaining
00112  * such license, approval or letter.
00113  *
00114  *****************************************************************************/
00115 
00116 
00117 #define __EXOPARG2_C__
00118 
00119 #include "acpi.h"
00120 #include "accommon.h"
00121 #include "acparser.h"
00122 #include "acinterp.h"
00123 #include "acevents.h"
00124 #include "amlcode.h"
00125 
00126 
00127 #define _COMPONENT          ACPI_EXECUTER
00128         ACPI_MODULE_NAME    ("exoparg2")
00129 
00130 
00131 
00154 /*******************************************************************************
00155  *
00156  * FUNCTION:    AcpiExOpcode_2A_0T_0R
00157  *
00158  * PARAMETERS:  WalkState           - Current walk state
00159  *
00160  * RETURN:      Status
00161  *
00162  * DESCRIPTION: Execute opcode with two arguments, no target, and no return
00163  *              value.
00164  *
00165  * ALLOCATION:  Deletes both operands
00166  *
00167  ******************************************************************************/
00168 
00169 ACPI_STATUS
00170 AcpiExOpcode_2A_0T_0R (
00171     ACPI_WALK_STATE         *WalkState)
00172 {
00173     ACPI_OPERAND_OBJECT     **Operand = &WalkState->Operands[0];
00174     ACPI_NAMESPACE_NODE     *Node;
00175     UINT32                  Value;
00176     ACPI_STATUS             Status = AE_OK;
00177 
00178 
00179     ACPI_FUNCTION_TRACE_STR (ExOpcode_2A_0T_0R,
00180             AcpiPsGetOpcodeName (WalkState->Opcode));
00181 
00182 
00183     /* Examine the opcode */
00184 
00185     switch (WalkState->Opcode)
00186     {
00187     case AML_NOTIFY_OP:         /* Notify (NotifyObject, NotifyValue) */
00188 
00189         /* The first operand is a namespace node */
00190 
00191         Node = (ACPI_NAMESPACE_NODE *) Operand[0];
00192 
00193         /* Second value is the notify value */
00194 
00195         Value = (UINT32) Operand[1]->Integer.Value;
00196 
00197         /* Are notifies allowed on this object? */
00198 
00199         if (!AcpiEvIsNotifyObject (Node))
00200         {
00201             ACPI_ERROR ((AE_INFO,
00202                 "Unexpected notify object type [%s]",
00203                 AcpiUtGetTypeName (Node->Type)));
00204 
00205             Status = AE_AML_OPERAND_TYPE;
00206             break;
00207         }
00208 
00209         /*
00210          * Dispatch the notify to the appropriate handler
00211          * NOTE: the request is queued for execution after this method
00212          * completes.  The notify handlers are NOT invoked synchronously
00213          * from this thread -- because handlers may in turn run other
00214          * control methods.
00215          */
00216         Status = AcpiEvQueueNotifyRequest (Node, Value);
00217         break;
00218 
00219 
00220     default:
00221 
00222         ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
00223             WalkState->Opcode));
00224         Status = AE_AML_BAD_OPCODE;
00225     }
00226 
00227     return_ACPI_STATUS (Status);
00228 }
00229 
00230 
00231 /*******************************************************************************
00232  *
00233  * FUNCTION:    AcpiExOpcode_2A_2T_1R
00234  *
00235  * PARAMETERS:  WalkState           - Current walk state
00236  *
00237  * RETURN:      Status
00238  *
00239  * DESCRIPTION: Execute a dyadic operator (2 operands) with 2 output targets
00240  *              and one implicit return value.
00241  *
00242  ******************************************************************************/
00243 
00244 ACPI_STATUS
00245 AcpiExOpcode_2A_2T_1R (
00246     ACPI_WALK_STATE         *WalkState)
00247 {
00248     ACPI_OPERAND_OBJECT     **Operand = &WalkState->Operands[0];
00249     ACPI_OPERAND_OBJECT     *ReturnDesc1 = NULL;
00250     ACPI_OPERAND_OBJECT     *ReturnDesc2 = NULL;
00251     ACPI_STATUS             Status;
00252 
00253 
00254     ACPI_FUNCTION_TRACE_STR (ExOpcode_2A_2T_1R,
00255         AcpiPsGetOpcodeName (WalkState->Opcode));
00256 
00257 
00258     /* Execute the opcode */
00259 
00260     switch (WalkState->Opcode)
00261     {
00262     case AML_DIVIDE_OP:
00263 
00264         /* Divide (Dividend, Divisor, RemainderResult QuotientResult) */
00265 
00266         ReturnDesc1 = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
00267         if (!ReturnDesc1)
00268         {
00269             Status = AE_NO_MEMORY;
00270             goto Cleanup;
00271         }
00272 
00273         ReturnDesc2 = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
00274         if (!ReturnDesc2)
00275         {
00276             Status = AE_NO_MEMORY;
00277             goto Cleanup;
00278         }
00279 
00280         /* Quotient to ReturnDesc1, remainder to ReturnDesc2 */
00281 
00282         Status = AcpiUtDivide (Operand[0]->Integer.Value,
00283                                Operand[1]->Integer.Value,
00284                                &ReturnDesc1->Integer.Value,
00285                                &ReturnDesc2->Integer.Value);
00286         if (ACPI_FAILURE (Status))
00287         {
00288             goto Cleanup;
00289         }
00290         break;
00291 
00292 
00293     default:
00294 
00295         ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
00296             WalkState->Opcode));
00297         Status = AE_AML_BAD_OPCODE;
00298         goto Cleanup;
00299     }
00300 
00301     /* Store the results to the target reference operands */
00302 
00303     Status = AcpiExStore (ReturnDesc2, Operand[2], WalkState);
00304     if (ACPI_FAILURE (Status))
00305     {
00306         goto Cleanup;
00307     }
00308 
00309     Status = AcpiExStore (ReturnDesc1, Operand[3], WalkState);
00310     if (ACPI_FAILURE (Status))
00311     {
00312         goto Cleanup;
00313     }
00314 
00315 Cleanup:
00316     /*
00317      * Since the remainder is not returned indirectly, remove a reference to
00318      * it. Only the quotient is returned indirectly.
00319      */
00320     AcpiUtRemoveReference (ReturnDesc2);
00321 
00322     if (ACPI_FAILURE (Status))
00323     {
00324         /* Delete the return object */
00325 
00326         AcpiUtRemoveReference (ReturnDesc1);
00327     }
00328 
00329     /* Save return object (the remainder) on success */
00330 
00331     else
00332     {
00333         WalkState->ResultObj = ReturnDesc1;
00334     }
00335 
00336     return_ACPI_STATUS (Status);
00337 }
00338 
00339 
00340 /*******************************************************************************
00341  *
00342  * FUNCTION:    AcpiExOpcode_2A_1T_1R
00343  *
00344  * PARAMETERS:  WalkState           - Current walk state
00345  *
00346  * RETURN:      Status
00347  *
00348  * DESCRIPTION: Execute opcode with two arguments, one target, and a return
00349  *              value.
00350  *
00351  ******************************************************************************/
00352 
00353 ACPI_STATUS
00354 AcpiExOpcode_2A_1T_1R (
00355     ACPI_WALK_STATE         *WalkState)
00356 {
00357     ACPI_OPERAND_OBJECT     **Operand = &WalkState->Operands[0];
00358     ACPI_OPERAND_OBJECT     *ReturnDesc = NULL;
00359     UINT64                  Index;
00360     ACPI_STATUS             Status = AE_OK;
00361     ACPI_SIZE               Length;
00362 
00363 
00364     ACPI_FUNCTION_TRACE_STR (ExOpcode_2A_1T_1R,
00365         AcpiPsGetOpcodeName (WalkState->Opcode));
00366 
00367 
00368     /* Execute the opcode */
00369 
00370     if (WalkState->OpInfo->Flags & AML_MATH)
00371     {
00372         /* All simple math opcodes (add, etc.) */
00373 
00374         ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
00375         if (!ReturnDesc)
00376         {
00377             Status = AE_NO_MEMORY;
00378             goto Cleanup;
00379         }
00380 
00381         ReturnDesc->Integer.Value = AcpiExDoMathOp (WalkState->Opcode,
00382                                                 Operand[0]->Integer.Value,
00383                                                 Operand[1]->Integer.Value);
00384         goto StoreResultToTarget;
00385     }
00386 
00387     switch (WalkState->Opcode)
00388     {
00389     case AML_MOD_OP: /* Mod (Dividend, Divisor, RemainderResult (ACPI 2.0) */
00390 
00391         ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
00392         if (!ReturnDesc)
00393         {
00394             Status = AE_NO_MEMORY;
00395             goto Cleanup;
00396         }
00397 
00398         /* ReturnDesc will contain the remainder */
00399 
00400         Status = AcpiUtDivide (Operand[0]->Integer.Value,
00401                                Operand[1]->Integer.Value,
00402                                NULL,
00403                                &ReturnDesc->Integer.Value);
00404         break;
00405 
00406 
00407     case AML_CONCAT_OP: /* Concatenate (Data1, Data2, Result) */
00408 
00409         Status = AcpiExDoConcatenate (Operand[0], Operand[1],
00410                     &ReturnDesc, WalkState);
00411         break;
00412 
00413 
00414     case AML_TO_STRING_OP: /* ToString (Buffer, Length, Result) (ACPI 2.0) */
00415 
00416         /*
00417          * Input object is guaranteed to be a buffer at this point (it may have
00418          * been converted.)  Copy the raw buffer data to a new object of
00419          * type String.
00420          */
00421 
00422         /*
00423          * Get the length of the new string. It is the smallest of:
00424          * 1) Length of the input buffer
00425          * 2) Max length as specified in the ToString operator
00426          * 3) Length of input buffer up to a zero byte (null terminator)
00427          *
00428          * NOTE: A length of zero is ok, and will create a zero-length, null
00429          *       terminated string.
00430          */
00431         Length = 0;
00432         while ((Length < Operand[0]->Buffer.Length) &&
00433                (Length < Operand[1]->Integer.Value) &&
00434                (Operand[0]->Buffer.Pointer[Length]))
00435         {
00436             Length++;
00437         }
00438 
00439         /* Allocate a new string object */
00440 
00441         ReturnDesc = AcpiUtCreateStringObject (Length);
00442         if (!ReturnDesc)
00443         {
00444             Status = AE_NO_MEMORY;
00445             goto Cleanup;
00446         }
00447 
00448         /*
00449          * Copy the raw buffer data with no transform.
00450          * (NULL terminated already)
00451          */
00452         ACPI_MEMCPY (ReturnDesc->String.Pointer,
00453             Operand[0]->Buffer.Pointer, Length);
00454         break;
00455 
00456 
00457     case AML_CONCAT_RES_OP:
00458 
00459         /* ConcatenateResTemplate (Buffer, Buffer, Result) (ACPI 2.0) */
00460 
00461         Status = AcpiExConcatTemplate (Operand[0], Operand[1],
00462                     &ReturnDesc, WalkState);
00463         break;
00464 
00465 
00466     case AML_INDEX_OP:              /* Index (Source Index Result) */
00467 
00468         /* Create the internal return object */
00469 
00470         ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_LOCAL_REFERENCE);
00471         if (!ReturnDesc)
00472         {
00473             Status = AE_NO_MEMORY;
00474             goto Cleanup;
00475         }
00476 
00477         /* Initialize the Index reference object */
00478 
00479         Index = Operand[1]->Integer.Value;
00480         ReturnDesc->Reference.Value = (UINT32) Index;
00481         ReturnDesc->Reference.Class = ACPI_REFCLASS_INDEX;
00482 
00483         /*
00484          * At this point, the Source operand is a String, Buffer, or Package.
00485          * Verify that the index is within range.
00486          */
00487         switch ((Operand[0])->Common.Type)
00488         {
00489         case ACPI_TYPE_STRING:
00490 
00491             if (Index >= Operand[0]->String.Length)
00492             {
00493                 Status = AE_AML_STRING_LIMIT;
00494             }
00495 
00496             ReturnDesc->Reference.TargetType = ACPI_TYPE_BUFFER_FIELD;
00497             break;
00498 
00499         case ACPI_TYPE_BUFFER:
00500 
00501             if (Index >= Operand[0]->Buffer.Length)
00502             {
00503                 Status = AE_AML_BUFFER_LIMIT;
00504             }
00505 
00506             ReturnDesc->Reference.TargetType = ACPI_TYPE_BUFFER_FIELD;
00507             break;
00508 
00509         case ACPI_TYPE_PACKAGE:
00510 
00511             if (Index >= Operand[0]->Package.Count)
00512             {
00513                 Status = AE_AML_PACKAGE_LIMIT;
00514             }
00515 
00516             ReturnDesc->Reference.TargetType = ACPI_TYPE_PACKAGE;
00517             ReturnDesc->Reference.Where = &Operand[0]->Package.Elements [Index];
00518             break;
00519 
00520         default:
00521 
00522             Status = AE_AML_INTERNAL;
00523             goto Cleanup;
00524         }
00525 
00526         /* Failure means that the Index was beyond the end of the object */
00527 
00528         if (ACPI_FAILURE (Status))
00529         {
00530             ACPI_EXCEPTION ((AE_INFO, Status,
00531                 "Index (0x%8.8X%8.8X) is beyond end of object",
00532                 ACPI_FORMAT_UINT64 (Index)));
00533             goto Cleanup;
00534         }
00535 
00536         /*
00537          * Save the target object and add a reference to it for the life
00538          * of the index
00539          */
00540         ReturnDesc->Reference.Object = Operand[0];
00541         AcpiUtAddReference (Operand[0]);
00542 
00543         /* Store the reference to the Target */
00544 
00545         Status = AcpiExStore (ReturnDesc, Operand[2], WalkState);
00546 
00547         /* Return the reference */
00548 
00549         WalkState->ResultObj = ReturnDesc;
00550         goto Cleanup;
00551 
00552 
00553     default:
00554 
00555         ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
00556             WalkState->Opcode));
00557         Status = AE_AML_BAD_OPCODE;
00558         break;
00559     }
00560 
00561 
00562 StoreResultToTarget:
00563 
00564     if (ACPI_SUCCESS (Status))
00565     {
00566         /*
00567          * Store the result of the operation (which is now in ReturnDesc) into
00568          * the Target descriptor.
00569          */
00570         Status = AcpiExStore (ReturnDesc, Operand[2], WalkState);
00571         if (ACPI_FAILURE (Status))
00572         {
00573             goto Cleanup;
00574         }
00575 
00576         if (!WalkState->ResultObj)
00577         {
00578             WalkState->ResultObj = ReturnDesc;
00579         }
00580     }
00581 
00582 
00583 Cleanup:
00584 
00585     /* Delete return object on error */
00586 
00587     if (ACPI_FAILURE (Status))
00588     {
00589         AcpiUtRemoveReference (ReturnDesc);
00590         WalkState->ResultObj = NULL;
00591     }
00592 
00593     return_ACPI_STATUS (Status);
00594 }
00595 
00596 
00597 /*******************************************************************************
00598  *
00599  * FUNCTION:    AcpiExOpcode_2A_0T_1R
00600  *
00601  * PARAMETERS:  WalkState           - Current walk state
00602  *
00603  * RETURN:      Status
00604  *
00605  * DESCRIPTION: Execute opcode with 2 arguments, no target, and a return value
00606  *
00607  ******************************************************************************/
00608 
00609 ACPI_STATUS
00610 AcpiExOpcode_2A_0T_1R (
00611     ACPI_WALK_STATE         *WalkState)
00612 {
00613     ACPI_OPERAND_OBJECT     **Operand = &WalkState->Operands[0];
00614     ACPI_OPERAND_OBJECT     *ReturnDesc = NULL;
00615     ACPI_STATUS             Status = AE_OK;
00616     BOOLEAN                 LogicalResult = FALSE;
00617 
00618 
00619     ACPI_FUNCTION_TRACE_STR (ExOpcode_2A_0T_1R,
00620         AcpiPsGetOpcodeName (WalkState->Opcode));
00621 
00622 
00623     /* Create the internal return object */
00624 
00625     ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
00626     if (!ReturnDesc)
00627     {
00628         Status = AE_NO_MEMORY;
00629         goto Cleanup;
00630     }
00631 
00632     /* Execute the Opcode */
00633 
00634     if (WalkState->OpInfo->Flags & AML_LOGICAL_NUMERIC)
00635     {
00636         /* LogicalOp  (Operand0, Operand1) */
00637 
00638         Status = AcpiExDoLogicalNumericOp (WalkState->Opcode,
00639                         Operand[0]->Integer.Value, Operand[1]->Integer.Value,
00640                         &LogicalResult);
00641         goto StoreLogicalResult;
00642     }
00643     else if (WalkState->OpInfo->Flags & AML_LOGICAL)
00644     {
00645         /* LogicalOp  (Operand0, Operand1) */
00646 
00647         Status = AcpiExDoLogicalOp (WalkState->Opcode, Operand[0],
00648                     Operand[1], &LogicalResult);
00649         goto StoreLogicalResult;
00650     }
00651 
00652     switch (WalkState->Opcode)
00653     {
00654     case AML_ACQUIRE_OP:            /* Acquire (MutexObject, Timeout) */
00655 
00656         Status = AcpiExAcquireMutex (Operand[1], Operand[0], WalkState);
00657         if (Status == AE_TIME)
00658         {
00659             LogicalResult = TRUE;       /* TRUE = Acquire timed out */
00660             Status = AE_OK;
00661         }
00662         break;
00663 
00664 
00665     case AML_WAIT_OP:               /* Wait (EventObject, Timeout) */
00666 
00667         Status = AcpiExSystemWaitEvent (Operand[1], Operand[0]);
00668         if (Status == AE_TIME)
00669         {
00670             LogicalResult = TRUE;       /* TRUE, Wait timed out */
00671             Status = AE_OK;
00672         }
00673         break;
00674 
00675 
00676     default:
00677 
00678         ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
00679             WalkState->Opcode));
00680         Status = AE_AML_BAD_OPCODE;
00681         goto Cleanup;
00682     }
00683 
00684 
00685 StoreLogicalResult:
00686     /*
00687      * Set return value to according to LogicalResult. logical TRUE (all ones)
00688      * Default is FALSE (zero)
00689      */
00690     if (LogicalResult)
00691     {
00692         ReturnDesc->Integer.Value = ACPI_UINT64_MAX;
00693     }
00694 
00695 Cleanup:
00696 
00697     /* Delete return object on error */
00698 
00699     if (ACPI_FAILURE (Status))
00700     {
00701         AcpiUtRemoveReference (ReturnDesc);
00702     }
00703 
00704     /* Save return object on success */
00705 
00706     else
00707     {
00708         WalkState->ResultObj = ReturnDesc;
00709     }
00710 
00711     return_ACPI_STATUS (Status);
00712 }
00713 
00714 

Generated on Sat May 26 2012 04:25:47 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.