Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenutglobal.c
Go to the documentation of this file.
00001 /****************************************************************************** 00002 * 00003 * Module Name: utglobal - Global variables for the ACPI subsystem 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 __UTGLOBAL_C__ 00117 #define DEFINE_ACPI_GLOBALS 00118 00119 #include "acpi.h" 00120 #include "accommon.h" 00121 00122 #define _COMPONENT ACPI_UTILITIES 00123 ACPI_MODULE_NAME ("utglobal") 00124 00125 00126 /******************************************************************************* 00127 * 00128 * Static global variable initialization. 00129 * 00130 ******************************************************************************/ 00131 00132 /* 00133 * We want the debug switches statically initialized so they 00134 * are already set when the debugger is entered. 00135 */ 00136 00137 /* Debug switch - level and trace mask */ 00138 00139 #ifdef ACPI_DEBUG_OUTPUT 00140 UINT32 AcpiDbgLevel = ACPI_DEBUG_DEFAULT; 00141 #else 00142 UINT32 AcpiDbgLevel = ACPI_NORMAL_DEFAULT; 00143 #endif 00144 00145 /* Debug switch - layer (component) mask */ 00146 00147 UINT32 AcpiDbgLayer = ACPI_COMPONENT_DEFAULT; 00148 UINT32 AcpiGbl_NestingLevel = 0; 00149 00150 /* Debugger globals */ 00151 00152 BOOLEAN AcpiGbl_DbTerminateThreads = FALSE; 00153 BOOLEAN AcpiGbl_AbortMethod = FALSE; 00154 BOOLEAN AcpiGbl_MethodExecuting = FALSE; 00155 00156 /* System flags */ 00157 00158 UINT32 AcpiGbl_StartupFlags = 0; 00159 00160 /* System starts uninitialized */ 00161 00162 BOOLEAN AcpiGbl_Shutdown = TRUE; 00163 00164 const char *AcpiGbl_SleepStateNames[ACPI_S_STATE_COUNT] = 00165 { 00166 "\\_S0_", 00167 "\\_S1_", 00168 "\\_S2_", 00169 "\\_S3_", 00170 "\\_S4_", 00171 "\\_S5_" 00172 }; 00173 00174 const char *AcpiGbl_LowestDstateNames[ACPI_NUM_SxW_METHODS] = 00175 { 00176 "_S0W", 00177 "_S1W", 00178 "_S2W", 00179 "_S3W", 00180 "_S4W" 00181 }; 00182 00183 const char *AcpiGbl_HighestDstateNames[ACPI_NUM_SxD_METHODS] = 00184 { 00185 "_S1D", 00186 "_S2D", 00187 "_S3D", 00188 "_S4D" 00189 }; 00190 00191 00192 /******************************************************************************* 00193 * 00194 * Namespace globals 00195 * 00196 ******************************************************************************/ 00197 00198 /* 00199 * Predefined ACPI Names (Built-in to the Interpreter) 00200 * 00201 * NOTES: 00202 * 1) _SB_ is defined to be a device to allow \_SB_._INI to be run 00203 * during the initialization sequence. 00204 * 2) _TZ_ is defined to be a thermal zone in order to allow ASL code to 00205 * perform a Notify() operation on it. 09/2010: Changed to type Device. 00206 * This still allows notifies, but does not confuse host code that 00207 * searches for valid ThermalZone objects. 00208 */ 00209 const ACPI_PREDEFINED_NAMES AcpiGbl_PreDefinedNames[] = 00210 { 00211 {"_GPE", ACPI_TYPE_LOCAL_SCOPE, NULL}, 00212 {"_PR_", ACPI_TYPE_LOCAL_SCOPE, NULL}, 00213 {"_SB_", ACPI_TYPE_DEVICE, NULL}, 00214 {"_SI_", ACPI_TYPE_LOCAL_SCOPE, NULL}, 00215 {"_TZ_", ACPI_TYPE_DEVICE, NULL}, 00216 {"_REV", ACPI_TYPE_INTEGER, (char *) ACPI_CA_SUPPORT_LEVEL}, 00217 {"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME}, 00218 {"_GL_", ACPI_TYPE_MUTEX, (char *) 1}, 00219 00220 #if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY) 00221 {"_OSI", ACPI_TYPE_METHOD, (char *) 1}, 00222 #endif 00223 00224 /* Table terminator */ 00225 00226 {NULL, ACPI_TYPE_ANY, NULL} 00227 }; 00228 00229 00230 /****************************************************************************** 00231 * 00232 * Event and Hardware globals 00233 * 00234 ******************************************************************************/ 00235 00236 ACPI_BIT_REGISTER_INFO AcpiGbl_BitRegisterInfo[ACPI_NUM_BITREG] = 00237 { 00238 /* Name Parent Register Register Bit Position Register Bit Mask */ 00239 00240 /* ACPI_BITREG_TIMER_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_TIMER_STATUS, ACPI_BITMASK_TIMER_STATUS}, 00241 /* ACPI_BITREG_BUS_MASTER_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_BUS_MASTER_STATUS, ACPI_BITMASK_BUS_MASTER_STATUS}, 00242 /* ACPI_BITREG_GLOBAL_LOCK_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_GLOBAL_LOCK_STATUS, ACPI_BITMASK_GLOBAL_LOCK_STATUS}, 00243 /* ACPI_BITREG_POWER_BUTTON_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_POWER_BUTTON_STATUS, ACPI_BITMASK_POWER_BUTTON_STATUS}, 00244 /* ACPI_BITREG_SLEEP_BUTTON_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_SLEEP_BUTTON_STATUS, ACPI_BITMASK_SLEEP_BUTTON_STATUS}, 00245 /* ACPI_BITREG_RT_CLOCK_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_RT_CLOCK_STATUS, ACPI_BITMASK_RT_CLOCK_STATUS}, 00246 /* ACPI_BITREG_WAKE_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_WAKE_STATUS, ACPI_BITMASK_WAKE_STATUS}, 00247 /* ACPI_BITREG_PCIEXP_WAKE_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_PCIEXP_WAKE_STATUS, ACPI_BITMASK_PCIEXP_WAKE_STATUS}, 00248 00249 /* ACPI_BITREG_TIMER_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_TIMER_ENABLE, ACPI_BITMASK_TIMER_ENABLE}, 00250 /* ACPI_BITREG_GLOBAL_LOCK_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE, ACPI_BITMASK_GLOBAL_LOCK_ENABLE}, 00251 /* ACPI_BITREG_POWER_BUTTON_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_POWER_BUTTON_ENABLE, ACPI_BITMASK_POWER_BUTTON_ENABLE}, 00252 /* ACPI_BITREG_SLEEP_BUTTON_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE, ACPI_BITMASK_SLEEP_BUTTON_ENABLE}, 00253 /* ACPI_BITREG_RT_CLOCK_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_RT_CLOCK_ENABLE, ACPI_BITMASK_RT_CLOCK_ENABLE}, 00254 /* ACPI_BITREG_PCIEXP_WAKE_DISABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE, ACPI_BITMASK_PCIEXP_WAKE_DISABLE}, 00255 00256 /* ACPI_BITREG_SCI_ENABLE */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_SCI_ENABLE, ACPI_BITMASK_SCI_ENABLE}, 00257 /* ACPI_BITREG_BUS_MASTER_RLD */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_BUS_MASTER_RLD, ACPI_BITMASK_BUS_MASTER_RLD}, 00258 /* ACPI_BITREG_GLOBAL_LOCK_RELEASE */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_GLOBAL_LOCK_RELEASE, ACPI_BITMASK_GLOBAL_LOCK_RELEASE}, 00259 /* ACPI_BITREG_SLEEP_TYPE */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_SLEEP_TYPE, ACPI_BITMASK_SLEEP_TYPE}, 00260 /* ACPI_BITREG_SLEEP_ENABLE */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_SLEEP_ENABLE, ACPI_BITMASK_SLEEP_ENABLE}, 00261 00262 /* ACPI_BITREG_ARB_DIS */ {ACPI_REGISTER_PM2_CONTROL, ACPI_BITPOSITION_ARB_DISABLE, ACPI_BITMASK_ARB_DISABLE} 00263 }; 00264 00265 00266 ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS] = 00267 { 00268 /* ACPI_EVENT_PMTIMER */ {ACPI_BITREG_TIMER_STATUS, ACPI_BITREG_TIMER_ENABLE, ACPI_BITMASK_TIMER_STATUS, ACPI_BITMASK_TIMER_ENABLE}, 00269 /* ACPI_EVENT_GLOBAL */ {ACPI_BITREG_GLOBAL_LOCK_STATUS, ACPI_BITREG_GLOBAL_LOCK_ENABLE, ACPI_BITMASK_GLOBAL_LOCK_STATUS, ACPI_BITMASK_GLOBAL_LOCK_ENABLE}, 00270 /* ACPI_EVENT_POWER_BUTTON */ {ACPI_BITREG_POWER_BUTTON_STATUS, ACPI_BITREG_POWER_BUTTON_ENABLE, ACPI_BITMASK_POWER_BUTTON_STATUS, ACPI_BITMASK_POWER_BUTTON_ENABLE}, 00271 /* ACPI_EVENT_SLEEP_BUTTON */ {ACPI_BITREG_SLEEP_BUTTON_STATUS, ACPI_BITREG_SLEEP_BUTTON_ENABLE, ACPI_BITMASK_SLEEP_BUTTON_STATUS, ACPI_BITMASK_SLEEP_BUTTON_ENABLE}, 00272 /* ACPI_EVENT_RTC */ {ACPI_BITREG_RT_CLOCK_STATUS, ACPI_BITREG_RT_CLOCK_ENABLE, ACPI_BITMASK_RT_CLOCK_STATUS, ACPI_BITMASK_RT_CLOCK_ENABLE}, 00273 }; 00274 00275 00276 /******************************************************************************* 00277 * 00278 * FUNCTION: AcpiUtInitGlobals 00279 * 00280 * PARAMETERS: None 00281 * 00282 * RETURN: Status 00283 * 00284 * DESCRIPTION: Init ACPICA globals. All globals that require specific 00285 * initialization should be initialized here! 00286 * 00287 ******************************************************************************/ 00288 00289 ACPI_STATUS 00290 AcpiUtInitGlobals ( 00291 void) 00292 { 00293 ACPI_STATUS Status; 00294 UINT32 i; 00295 00296 00297 ACPI_FUNCTION_TRACE (UtInitGlobals); 00298 00299 00300 /* Create all memory caches */ 00301 00302 Status = AcpiUtCreateCaches (); 00303 if (ACPI_FAILURE (Status)) 00304 { 00305 return_ACPI_STATUS (Status); 00306 } 00307 00308 /* Mutex locked flags */ 00309 00310 for (i = 0; i < ACPI_NUM_MUTEX; i++) 00311 { 00312 AcpiGbl_MutexInfo[i].Mutex = NULL; 00313 AcpiGbl_MutexInfo[i].ThreadId = ACPI_MUTEX_NOT_ACQUIRED; 00314 AcpiGbl_MutexInfo[i].UseCount = 0; 00315 } 00316 00317 for (i = 0; i < ACPI_NUM_OWNERID_MASKS; i++) 00318 { 00319 AcpiGbl_OwnerIdMask[i] = 0; 00320 } 00321 00322 /* Last OwnerID is never valid */ 00323 00324 AcpiGbl_OwnerIdMask[ACPI_NUM_OWNERID_MASKS - 1] = 0x80000000; 00325 00326 /* Event counters */ 00327 00328 AcpiMethodCount = 0; 00329 AcpiSciCount = 0; 00330 AcpiGpeCount = 0; 00331 00332 for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) 00333 { 00334 AcpiFixedEventCount[i] = 0; 00335 } 00336 00337 /* GPE support */ 00338 00339 AcpiGbl_AllGpesInitialized = FALSE; 00340 AcpiGbl_GpeXruptListHead = NULL; 00341 AcpiGbl_GpeFadtBlocks[0] = NULL; 00342 AcpiGbl_GpeFadtBlocks[1] = NULL; 00343 AcpiCurrentGpeCount = 0; 00344 00345 /* Global handlers */ 00346 00347 AcpiGbl_SystemNotify.Handler = NULL; 00348 AcpiGbl_DeviceNotify.Handler = NULL; 00349 AcpiGbl_ExceptionHandler = NULL; 00350 AcpiGbl_InitHandler = NULL; 00351 AcpiGbl_TableHandler = NULL; 00352 AcpiGbl_InterfaceHandler = NULL; 00353 AcpiGbl_GlobalEventHandler = NULL; 00354 00355 /* Global Lock support */ 00356 00357 AcpiGbl_GlobalLockSemaphore = NULL; 00358 AcpiGbl_GlobalLockMutex = NULL; 00359 AcpiGbl_GlobalLockAcquired = FALSE; 00360 AcpiGbl_GlobalLockHandle = 0; 00361 AcpiGbl_GlobalLockPresent = FALSE; 00362 00363 /* Miscellaneous variables */ 00364 00365 AcpiGbl_DSDT = NULL; 00366 AcpiGbl_CmSingleStep = FALSE; 00367 AcpiGbl_DbTerminateThreads = FALSE; 00368 AcpiGbl_Shutdown = FALSE; 00369 AcpiGbl_NsLookupCount = 0; 00370 AcpiGbl_PsFindCount = 0; 00371 AcpiGbl_AcpiHardwarePresent = TRUE; 00372 AcpiGbl_LastOwnerIdIndex = 0; 00373 AcpiGbl_NextOwnerIdOffset = 0; 00374 AcpiGbl_TraceMethodName = 0; 00375 AcpiGbl_TraceDbgLevel = 0; 00376 AcpiGbl_TraceDbgLayer = 0; 00377 AcpiGbl_DebuggerConfiguration = DEBUGGER_THREADING; 00378 AcpiGbl_DbOutputFlags = ACPI_DB_CONSOLE_OUTPUT; 00379 AcpiGbl_OsiData = 0; 00380 AcpiGbl_OsiMutex = NULL; 00381 AcpiGbl_RegMethodsExecuted = FALSE; 00382 00383 /* Hardware oriented */ 00384 00385 AcpiGbl_EventsInitialized = FALSE; 00386 AcpiGbl_SystemAwakeAndRunning = TRUE; 00387 00388 /* Namespace */ 00389 00390 AcpiGbl_ModuleCodeList = NULL; 00391 AcpiGbl_RootNode = NULL; 00392 AcpiGbl_RootNodeStruct.Name.Integer = ACPI_ROOT_NAME; 00393 AcpiGbl_RootNodeStruct.DescriptorType = ACPI_DESC_TYPE_NAMED; 00394 AcpiGbl_RootNodeStruct.Type = ACPI_TYPE_DEVICE; 00395 AcpiGbl_RootNodeStruct.Parent = NULL; 00396 AcpiGbl_RootNodeStruct.Child = NULL; 00397 AcpiGbl_RootNodeStruct.Peer = NULL; 00398 AcpiGbl_RootNodeStruct.Object = NULL; 00399 00400 00401 #ifdef ACPI_DISASSEMBLER 00402 AcpiGbl_ExternalList = NULL; 00403 #endif 00404 00405 #ifdef ACPI_DEBUG_OUTPUT 00406 AcpiGbl_LowestStackPointer = ACPI_CAST_PTR (ACPI_SIZE, ACPI_SIZE_MAX); 00407 #endif 00408 00409 #ifdef ACPI_DBG_TRACK_ALLOCATIONS 00410 AcpiGbl_DisplayFinalMemStats = FALSE; 00411 AcpiGbl_DisableMemTracking = FALSE; 00412 #endif 00413 00414 return_ACPI_STATUS (AE_OK); 00415 } 00416 00417 /* Public globals */ 00418 00419 ACPI_EXPORT_SYMBOL (AcpiGbl_FADT) 00420 ACPI_EXPORT_SYMBOL (AcpiDbgLevel) 00421 ACPI_EXPORT_SYMBOL (AcpiDbgLayer) 00422 ACPI_EXPORT_SYMBOL (AcpiGpeCount) 00423 ACPI_EXPORT_SYMBOL (AcpiCurrentGpeCount) Generated on Sun May 27 2012 04:27:23 for ReactOS by
1.7.6.1
|