Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenexdebug.c
Go to the documentation of this file.
00001 /****************************************************************************** 00002 * 00003 * Module Name: exdebug - Support for stores to the AML Debug Object 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 __EXDEBUG_C__ 00117 00118 #include "acpi.h" 00119 #include "accommon.h" 00120 #include "acinterp.h" 00121 00122 00123 #define _COMPONENT ACPI_EXECUTER 00124 ACPI_MODULE_NAME ("exdebug") 00125 00126 00127 #ifndef ACPI_NO_ERROR_MESSAGES 00128 /******************************************************************************* 00129 * 00130 * FUNCTION: AcpiExDoDebugObject 00131 * 00132 * PARAMETERS: SourceDesc - Object to be output to "Debug Object" 00133 * Level - Indentation level (used for packages) 00134 * Index - Current package element, zero if not pkg 00135 * 00136 * RETURN: None 00137 * 00138 * DESCRIPTION: Handles stores to the AML Debug Object. For example: 00139 * Store(INT1, Debug) 00140 * 00141 * This function is not compiled if ACPI_NO_ERROR_MESSAGES is set. 00142 * 00143 * This function is only enabled if AcpiGbl_EnableAmlDebugObject is set, or 00144 * if ACPI_LV_DEBUG_OBJECT is set in the AcpiDbgLevel. Thus, in the normal 00145 * operational case, stores to the debug object are ignored but can be easily 00146 * enabled if necessary. 00147 * 00148 ******************************************************************************/ 00149 00150 void 00151 AcpiExDoDebugObject ( 00152 ACPI_OPERAND_OBJECT *SourceDesc, 00153 UINT32 Level, 00154 UINT32 Index) 00155 { 00156 UINT32 i; 00157 00158 00159 ACPI_FUNCTION_TRACE_PTR (ExDoDebugObject, SourceDesc); 00160 00161 00162 /* Output must be enabled via the DebugObject global or the DbgLevel */ 00163 00164 if (!AcpiGbl_EnableAmlDebugObject && 00165 !(AcpiDbgLevel & ACPI_LV_DEBUG_OBJECT)) 00166 { 00167 return_VOID; 00168 } 00169 00170 /* 00171 * Print line header as long as we are not in the middle of an 00172 * object display 00173 */ 00174 if (!((Level > 0) && Index == 0)) 00175 { 00176 AcpiOsPrintf ("[ACPI Debug] %*s", Level, " "); 00177 } 00178 00179 /* Display the index for package output only */ 00180 00181 if (Index > 0) 00182 { 00183 AcpiOsPrintf ("(%.2u) ", Index-1); 00184 } 00185 00186 if (!SourceDesc) 00187 { 00188 AcpiOsPrintf ("[Null Object]\n"); 00189 return_VOID; 00190 } 00191 00192 if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc) == ACPI_DESC_TYPE_OPERAND) 00193 { 00194 AcpiOsPrintf ("%s ", AcpiUtGetObjectTypeName (SourceDesc)); 00195 00196 if (!AcpiUtValidInternalObject (SourceDesc)) 00197 { 00198 AcpiOsPrintf ("%p, Invalid Internal Object!\n", SourceDesc); 00199 return_VOID; 00200 } 00201 } 00202 else if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc) == ACPI_DESC_TYPE_NAMED) 00203 { 00204 AcpiOsPrintf ("%s: %p\n", 00205 AcpiUtGetTypeName (((ACPI_NAMESPACE_NODE *) SourceDesc)->Type), 00206 SourceDesc); 00207 return_VOID; 00208 } 00209 else 00210 { 00211 return_VOID; 00212 } 00213 00214 /* SourceDesc is of type ACPI_DESC_TYPE_OPERAND */ 00215 00216 switch (SourceDesc->Common.Type) 00217 { 00218 case ACPI_TYPE_INTEGER: 00219 00220 /* Output correct integer width */ 00221 00222 if (AcpiGbl_IntegerByteWidth == 4) 00223 { 00224 AcpiOsPrintf ("0x%8.8X\n", 00225 (UINT32) SourceDesc->Integer.Value); 00226 } 00227 else 00228 { 00229 AcpiOsPrintf ("0x%8.8X%8.8X\n", 00230 ACPI_FORMAT_UINT64 (SourceDesc->Integer.Value)); 00231 } 00232 break; 00233 00234 case ACPI_TYPE_BUFFER: 00235 00236 AcpiOsPrintf ("[0x%.2X]\n", (UINT32) SourceDesc->Buffer.Length); 00237 AcpiUtDumpBuffer2 (SourceDesc->Buffer.Pointer, 00238 (SourceDesc->Buffer.Length < 256) ? 00239 SourceDesc->Buffer.Length : 256, DB_BYTE_DISPLAY); 00240 break; 00241 00242 case ACPI_TYPE_STRING: 00243 00244 AcpiOsPrintf ("[0x%.2X] \"%s\"\n", 00245 SourceDesc->String.Length, SourceDesc->String.Pointer); 00246 break; 00247 00248 case ACPI_TYPE_PACKAGE: 00249 00250 AcpiOsPrintf ("[Contains 0x%.2X Elements]\n", 00251 SourceDesc->Package.Count); 00252 00253 /* Output the entire contents of the package */ 00254 00255 for (i = 0; i < SourceDesc->Package.Count; i++) 00256 { 00257 AcpiExDoDebugObject (SourceDesc->Package.Elements[i], 00258 Level+4, i+1); 00259 } 00260 break; 00261 00262 case ACPI_TYPE_LOCAL_REFERENCE: 00263 00264 AcpiOsPrintf ("[%s] ", AcpiUtGetReferenceName (SourceDesc)); 00265 00266 /* Decode the reference */ 00267 00268 switch (SourceDesc->Reference.Class) 00269 { 00270 case ACPI_REFCLASS_INDEX: 00271 00272 AcpiOsPrintf ("0x%X\n", SourceDesc->Reference.Value); 00273 break; 00274 00275 case ACPI_REFCLASS_TABLE: 00276 00277 /* Case for DdbHandle */ 00278 00279 AcpiOsPrintf ("Table Index 0x%X\n", SourceDesc->Reference.Value); 00280 return; 00281 00282 default: 00283 break; 00284 } 00285 00286 AcpiOsPrintf (" "); 00287 00288 /* Check for valid node first, then valid object */ 00289 00290 if (SourceDesc->Reference.Node) 00291 { 00292 if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc->Reference.Node) != 00293 ACPI_DESC_TYPE_NAMED) 00294 { 00295 AcpiOsPrintf (" %p - Not a valid namespace node\n", 00296 SourceDesc->Reference.Node); 00297 } 00298 else 00299 { 00300 AcpiOsPrintf ("Node %p [%4.4s] ", SourceDesc->Reference.Node, 00301 (SourceDesc->Reference.Node)->Name.Ascii); 00302 00303 switch ((SourceDesc->Reference.Node)->Type) 00304 { 00305 /* These types have no attached object */ 00306 00307 case ACPI_TYPE_DEVICE: 00308 AcpiOsPrintf ("Device\n"); 00309 break; 00310 00311 case ACPI_TYPE_THERMAL: 00312 AcpiOsPrintf ("Thermal Zone\n"); 00313 break; 00314 00315 default: 00316 AcpiExDoDebugObject ((SourceDesc->Reference.Node)->Object, 00317 Level+4, 0); 00318 break; 00319 } 00320 } 00321 } 00322 else if (SourceDesc->Reference.Object) 00323 { 00324 if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc->Reference.Object) == 00325 ACPI_DESC_TYPE_NAMED) 00326 { 00327 AcpiExDoDebugObject (((ACPI_NAMESPACE_NODE *) 00328 SourceDesc->Reference.Object)->Object, 00329 Level+4, 0); 00330 } 00331 else 00332 { 00333 AcpiExDoDebugObject (SourceDesc->Reference.Object, 00334 Level+4, 0); 00335 } 00336 } 00337 break; 00338 00339 default: 00340 00341 AcpiOsPrintf ("%p\n", SourceDesc); 00342 break; 00343 } 00344 00345 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, "\n")); 00346 return_VOID; 00347 } 00348 #endif 00349 00350 Generated on Sun May 27 2012 04:27:16 for ReactOS by
1.7.6.1
|