Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygendswscope.c
Go to the documentation of this file.
00001 /****************************************************************************** 00002 * 00003 * Module Name: dswscope - Scope stack manipulation 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 #define __DSWSCOPE_C__ 00117 00118 #include "acpi.h" 00119 #include "accommon.h" 00120 #include "acdispat.h" 00121 00122 00123 #define _COMPONENT ACPI_DISPATCHER 00124 ACPI_MODULE_NAME ("dswscope") 00125 00126 00127 /**************************************************************************** 00128 * 00129 * FUNCTION: AcpiDsScopeStackClear 00130 * 00131 * PARAMETERS: WalkState - Current state 00132 * 00133 * RETURN: None 00134 * 00135 * DESCRIPTION: Pop (and free) everything on the scope stack except the 00136 * root scope object (which remains at the stack top.) 00137 * 00138 ***************************************************************************/ 00139 00140 void 00141 AcpiDsScopeStackClear ( 00142 ACPI_WALK_STATE *WalkState) 00143 { 00144 ACPI_GENERIC_STATE *ScopeInfo; 00145 00146 ACPI_FUNCTION_NAME (DsScopeStackClear); 00147 00148 00149 while (WalkState->ScopeInfo) 00150 { 00151 /* Pop a scope off the stack */ 00152 00153 ScopeInfo = WalkState->ScopeInfo; 00154 WalkState->ScopeInfo = ScopeInfo->Scope.Next; 00155 00156 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, 00157 "Popped object type (%s)\n", 00158 AcpiUtGetTypeName (ScopeInfo->Common.Value))); 00159 AcpiUtDeleteGenericState (ScopeInfo); 00160 } 00161 } 00162 00163 00164 /**************************************************************************** 00165 * 00166 * FUNCTION: AcpiDsScopeStackPush 00167 * 00168 * PARAMETERS: Node - Name to be made current 00169 * Type - Type of frame being pushed 00170 * WalkState - Current state 00171 * 00172 * RETURN: Status 00173 * 00174 * DESCRIPTION: Push the current scope on the scope stack, and make the 00175 * passed Node current. 00176 * 00177 ***************************************************************************/ 00178 00179 ACPI_STATUS 00180 AcpiDsScopeStackPush ( 00181 ACPI_NAMESPACE_NODE *Node, 00182 ACPI_OBJECT_TYPE Type, 00183 ACPI_WALK_STATE *WalkState) 00184 { 00185 ACPI_GENERIC_STATE *ScopeInfo; 00186 ACPI_GENERIC_STATE *OldScopeInfo; 00187 00188 00189 ACPI_FUNCTION_TRACE (DsScopeStackPush); 00190 00191 00192 if (!Node) 00193 { 00194 /* Invalid scope */ 00195 00196 ACPI_ERROR ((AE_INFO, "Null scope parameter")); 00197 return_ACPI_STATUS (AE_BAD_PARAMETER); 00198 } 00199 00200 /* Make sure object type is valid */ 00201 00202 if (!AcpiUtValidObjectType (Type)) 00203 { 00204 ACPI_WARNING ((AE_INFO, 00205 "Invalid object type: 0x%X", Type)); 00206 } 00207 00208 /* Allocate a new scope object */ 00209 00210 ScopeInfo = AcpiUtCreateGenericState (); 00211 if (!ScopeInfo) 00212 { 00213 return_ACPI_STATUS (AE_NO_MEMORY); 00214 } 00215 00216 /* Init new scope object */ 00217 00218 ScopeInfo->Common.DescriptorType = ACPI_DESC_TYPE_STATE_WSCOPE; 00219 ScopeInfo->Scope.Node = Node; 00220 ScopeInfo->Common.Value = (UINT16) Type; 00221 00222 WalkState->ScopeDepth++; 00223 00224 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, 00225 "[%.2d] Pushed scope ", (UINT32) WalkState->ScopeDepth)); 00226 00227 OldScopeInfo = WalkState->ScopeInfo; 00228 if (OldScopeInfo) 00229 { 00230 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, 00231 "[%4.4s] (%s)", 00232 AcpiUtGetNodeName (OldScopeInfo->Scope.Node), 00233 AcpiUtGetTypeName (OldScopeInfo->Common.Value))); 00234 } 00235 else 00236 { 00237 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, 00238 "[\\___] (%s)", "ROOT")); 00239 } 00240 00241 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, 00242 ", New scope -> [%4.4s] (%s)\n", 00243 AcpiUtGetNodeName (ScopeInfo->Scope.Node), 00244 AcpiUtGetTypeName (ScopeInfo->Common.Value))); 00245 00246 /* Push new scope object onto stack */ 00247 00248 AcpiUtPushGenericState (&WalkState->ScopeInfo, ScopeInfo); 00249 return_ACPI_STATUS (AE_OK); 00250 } 00251 00252 00253 /**************************************************************************** 00254 * 00255 * FUNCTION: AcpiDsScopeStackPop 00256 * 00257 * PARAMETERS: WalkState - Current state 00258 * 00259 * RETURN: Status 00260 * 00261 * DESCRIPTION: Pop the scope stack once. 00262 * 00263 ***************************************************************************/ 00264 00265 ACPI_STATUS 00266 AcpiDsScopeStackPop ( 00267 ACPI_WALK_STATE *WalkState) 00268 { 00269 ACPI_GENERIC_STATE *ScopeInfo; 00270 ACPI_GENERIC_STATE *NewScopeInfo; 00271 00272 00273 ACPI_FUNCTION_TRACE (DsScopeStackPop); 00274 00275 00276 /* 00277 * Pop scope info object off the stack. 00278 */ 00279 ScopeInfo = AcpiUtPopGenericState (&WalkState->ScopeInfo); 00280 if (!ScopeInfo) 00281 { 00282 return_ACPI_STATUS (AE_STACK_UNDERFLOW); 00283 } 00284 00285 WalkState->ScopeDepth--; 00286 00287 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, 00288 "[%.2d] Popped scope [%4.4s] (%s), New scope -> ", 00289 (UINT32) WalkState->ScopeDepth, 00290 AcpiUtGetNodeName (ScopeInfo->Scope.Node), 00291 AcpiUtGetTypeName (ScopeInfo->Common.Value))); 00292 00293 NewScopeInfo = WalkState->ScopeInfo; 00294 if (NewScopeInfo) 00295 { 00296 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, 00297 "[%4.4s] (%s)\n", 00298 AcpiUtGetNodeName (NewScopeInfo->Scope.Node), 00299 AcpiUtGetTypeName (NewScopeInfo->Common.Value))); 00300 } 00301 else 00302 { 00303 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, 00304 "[\\___] (ROOT)\n")); 00305 } 00306 00307 AcpiUtDeleteGenericState (ScopeInfo); 00308 return_ACPI_STATUS (AE_OK); 00309 } 00310 00311 Generated on Thu May 24 2012 04:27:44 for ReactOS by
1.7.6.1
|