1*3446Smrj /****************************************************************************** 2*3446Smrj * 3*3446Smrj * Module Name: nsdump - table dumping routines for debug 4*3446Smrj * $Revision: 1.19 $ 5*3446Smrj * 6*3446Smrj *****************************************************************************/ 7*3446Smrj 8*3446Smrj /****************************************************************************** 9*3446Smrj * 10*3446Smrj * 1. Copyright Notice 11*3446Smrj * 12*3446Smrj * Some or all of this work - Copyright (c) 1999 - 2006, Intel Corp. 13*3446Smrj * All rights reserved. 14*3446Smrj * 15*3446Smrj * 2. License 16*3446Smrj * 17*3446Smrj * 2.1. This is your license from Intel Corp. under its intellectual property 18*3446Smrj * rights. You may have additional license terms from the party that provided 19*3446Smrj * you this software, covering your right to use that party's intellectual 20*3446Smrj * property rights. 21*3446Smrj * 22*3446Smrj * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 23*3446Smrj * copy of the source code appearing in this file ("Covered Code") an 24*3446Smrj * irrevocable, perpetual, worldwide license under Intel's copyrights in the 25*3446Smrj * base code distributed originally by Intel ("Original Intel Code") to copy, 26*3446Smrj 27*3446Smrj * make derivatives, distribute, use and display any portion of the Covered 28*3446Smrj * Code in any form, with the right to sublicense such rights; and 29*3446Smrj * 30*3446Smrj * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 31*3446Smrj * license (with the right to sublicense), under only those claims of Intel 32*3446Smrj * patents that are infringed by the Original Intel Code, to make, use, sell, 33*3446Smrj * offer to sell, and import the Covered Code and derivative works thereof 34*3446Smrj * solely to the minimum extent necessary to exercise the above copyright 35*3446Smrj * license, and in no event shall the patent license extend to any additions 36*3446Smrj * to or modifications of the Original Intel Code. No other license or right 37*3446Smrj * is granted directly or by implication, estoppel or otherwise; 38*3446Smrj * 39*3446Smrj * The above copyright and patent license is granted only if the following 40*3446Smrj * conditions are met: 41*3446Smrj * 42*3446Smrj * 3. Conditions 43*3446Smrj * 44*3446Smrj * 3.1. Redistribution of Source with Rights to Further Distribute Source. 45*3446Smrj * Redistribution of source code of any substantial portion of the Covered 46*3446Smrj * Code or modification with rights to further distribute source must include 47*3446Smrj * the above Copyright Notice, the above License, this list of Conditions, 48*3446Smrj * and the following Disclaimer and Export Compliance provision. In addition, 49*3446Smrj * Licensee must cause all Covered Code to which Licensee contributes to 50*3446Smrj * contain a file documenting the changes Licensee made to create that Covered 51*3446Smrj * Code and the date of any change. Licensee must include in that file the 52*3446Smrj * documentation of any changes made by any predecessor Licensee. Licensee 53*3446Smrj * must include a prominent statement that the modification is derived, 54*3446Smrj * directly or indirectly, from Original Intel Code. 55*3446Smrj * 56*3446Smrj * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 57*3446Smrj * Redistribution of source code of any substantial portion of the Covered 58*3446Smrj * Code or modification without rights to further distribute source must 59*3446Smrj * include the following Disclaimer and Export Compliance provision in the 60*3446Smrj * documentation and/or other materials provided with distribution. In 61*3446Smrj * addition, Licensee may not authorize further sublicense of source of any 62*3446Smrj * portion of the Covered Code, and must include terms to the effect that the 63*3446Smrj * license from Licensee to its licensee is limited to the intellectual 64*3446Smrj * property embodied in the software Licensee provides to its licensee, and 65*3446Smrj * not to intellectual property embodied in modifications its licensee may 66*3446Smrj * make. 67*3446Smrj * 68*3446Smrj * 3.3. Redistribution of Executable. Redistribution in executable form of any 69*3446Smrj * substantial portion of the Covered Code or modification must reproduce the 70*3446Smrj * above Copyright Notice, and the following Disclaimer and Export Compliance 71*3446Smrj * provision in the documentation and/or other materials provided with the 72*3446Smrj * distribution. 73*3446Smrj * 74*3446Smrj * 3.4. Intel retains all right, title, and interest in and to the Original 75*3446Smrj * Intel Code. 76*3446Smrj * 77*3446Smrj * 3.5. Neither the name Intel nor any other trademark owned or controlled by 78*3446Smrj * Intel shall be used in advertising or otherwise to promote the sale, use or 79*3446Smrj * other dealings in products derived from or relating to the Covered Code 80*3446Smrj * without prior written authorization from Intel. 81*3446Smrj * 82*3446Smrj * 4. Disclaimer and Export Compliance 83*3446Smrj * 84*3446Smrj * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 85*3446Smrj * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 86*3446Smrj * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 87*3446Smrj * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 88*3446Smrj * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 89*3446Smrj * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 90*3446Smrj * PARTICULAR PURPOSE. 91*3446Smrj * 92*3446Smrj * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 93*3446Smrj * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 94*3446Smrj * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 95*3446Smrj * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 96*3446Smrj * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 97*3446Smrj * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 98*3446Smrj * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 99*3446Smrj * LIMITED REMEDY. 100*3446Smrj * 101*3446Smrj * 4.3. Licensee shall not export, either directly or indirectly, any of this 102*3446Smrj * software or system incorporating such software without first obtaining any 103*3446Smrj * required license or other approval from the U. S. Department of Commerce or 104*3446Smrj * any other agency or department of the United States Government. In the 105*3446Smrj * event Licensee exports any such software from the United States or 106*3446Smrj * re-exports any such software from a foreign destination, Licensee shall 107*3446Smrj * ensure that the distribution and export/re-export of the software is in 108*3446Smrj * compliance with all laws, regulations, orders, or other restrictions of the 109*3446Smrj * U.S. Export Administration Regulations. Licensee agrees that neither it nor 110*3446Smrj * any of its subsidiaries will export/re-export any technical data, process, 111*3446Smrj * software, or service, directly or indirectly, to any country for which the 112*3446Smrj * United States government or any agency thereof requires an export license, 113*3446Smrj * other governmental approval, or letter of assurance, without first obtaining 114*3446Smrj * such license, approval or letter. 115*3446Smrj * 116*3446Smrj *****************************************************************************/ 117*3446Smrj 118*3446Smrj #define __NSDUMPDV_C__ 119*3446Smrj 120*3446Smrj #include "acpi.h" 121*3446Smrj 122*3446Smrj 123*3446Smrj /* TBD: This entire module is apparently obsolete and should be removed */ 124*3446Smrj 125*3446Smrj #define _COMPONENT ACPI_NAMESPACE 126*3446Smrj ACPI_MODULE_NAME ("nsdumpdv") 127*3446Smrj 128*3446Smrj #ifdef ACPI_OBSOLETE_FUNCTIONS 129*3446Smrj #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) 130*3446Smrj 131*3446Smrj #include "acnamesp.h" 132*3446Smrj 133*3446Smrj /******************************************************************************* 134*3446Smrj * 135*3446Smrj * FUNCTION: AcpiNsDumpOneDevice 136*3446Smrj * 137*3446Smrj * PARAMETERS: Handle - Node to be dumped 138*3446Smrj * Level - Nesting level of the handle 139*3446Smrj * Context - Passed into WalkNamespace 140*3446Smrj * ReturnValue - Not used 141*3446Smrj * 142*3446Smrj * RETURN: Status 143*3446Smrj * 144*3446Smrj * DESCRIPTION: Dump a single Node that represents a device 145*3446Smrj * This procedure is a UserFunction called by AcpiNsWalkNamespace. 146*3446Smrj * 147*3446Smrj ******************************************************************************/ 148*3446Smrj 149*3446Smrj static ACPI_STATUS 150*3446Smrj AcpiNsDumpOneDevice ( 151*3446Smrj ACPI_HANDLE ObjHandle, 152*3446Smrj UINT32 Level, 153*3446Smrj void *Context, 154*3446Smrj void **ReturnValue) 155*3446Smrj { 156*3446Smrj ACPI_BUFFER Buffer; 157*3446Smrj ACPI_DEVICE_INFO *Info; 158*3446Smrj ACPI_STATUS Status; 159*3446Smrj UINT32 i; 160*3446Smrj 161*3446Smrj 162*3446Smrj ACPI_FUNCTION_NAME (NsDumpOneDevice); 163*3446Smrj 164*3446Smrj 165*3446Smrj Status = AcpiNsDumpOneObject (ObjHandle, Level, Context, ReturnValue); 166*3446Smrj 167*3446Smrj Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER; 168*3446Smrj Status = AcpiGetObjectInfo (ObjHandle, &Buffer); 169*3446Smrj if (ACPI_SUCCESS (Status)) 170*3446Smrj { 171*3446Smrj Info = Buffer.Pointer; 172*3446Smrj for (i = 0; i < Level; i++) 173*3446Smrj { 174*3446Smrj ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " ")); 175*3446Smrj } 176*3446Smrj 177*3446Smrj ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, 178*3446Smrj " HID: %s, ADR: %8.8X%8.8X, Status: %X\n", 179*3446Smrj Info->HardwareId.Value, ACPI_FORMAT_UINT64 (Info->Address), 180*3446Smrj Info->CurrentStatus)); 181*3446Smrj ACPI_FREE (Info); 182*3446Smrj } 183*3446Smrj 184*3446Smrj return (Status); 185*3446Smrj } 186*3446Smrj 187*3446Smrj 188*3446Smrj /******************************************************************************* 189*3446Smrj * 190*3446Smrj * FUNCTION: AcpiNsDumpRootDevices 191*3446Smrj * 192*3446Smrj * PARAMETERS: None 193*3446Smrj * 194*3446Smrj * RETURN: None 195*3446Smrj * 196*3446Smrj * DESCRIPTION: Dump all objects of type "device" 197*3446Smrj * 198*3446Smrj ******************************************************************************/ 199*3446Smrj 200*3446Smrj void 201*3446Smrj AcpiNsDumpRootDevices ( 202*3446Smrj void) 203*3446Smrj { 204*3446Smrj ACPI_HANDLE SysBusHandle; 205*3446Smrj ACPI_STATUS Status; 206*3446Smrj 207*3446Smrj 208*3446Smrj ACPI_FUNCTION_NAME (NsDumpRootDevices); 209*3446Smrj 210*3446Smrj 211*3446Smrj /* Only dump the table if tracing is enabled */ 212*3446Smrj 213*3446Smrj if (!(ACPI_LV_TABLES & AcpiDbgLevel)) 214*3446Smrj { 215*3446Smrj return; 216*3446Smrj } 217*3446Smrj 218*3446Smrj Status = AcpiGetHandle (NULL, ACPI_NS_SYSTEM_BUS, &SysBusHandle); 219*3446Smrj if (ACPI_FAILURE (Status)) 220*3446Smrj { 221*3446Smrj return; 222*3446Smrj } 223*3446Smrj 224*3446Smrj ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, 225*3446Smrj "Display of all devices in the namespace:\n")); 226*3446Smrj 227*3446Smrj Status = AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, SysBusHandle, 228*3446Smrj ACPI_UINT32_MAX, ACPI_NS_WALK_NO_UNLOCK, 229*3446Smrj AcpiNsDumpOneDevice, NULL, NULL); 230*3446Smrj } 231*3446Smrj 232*3446Smrj #endif 233*3446Smrj #endif 234*3446Smrj 235*3446Smrj 236