nsdump.c revision 26f3cdf03f1adcc98f6d3d99843ee71e9229a8c0
2N/A/****************************************************************************** 2N/A * Module Name: nsdump - table dumping routines for debug 2N/A *****************************************************************************/ 2N/A * Copyright (C) 2000 - 2011, Intel Corp. 2N/A * All rights reserved. 2N/A * Redistribution and use in source and binary forms, with or without 2N/A * modification, are permitted provided that the following conditions 2N/A * 1. Redistributions of source code must retain the above copyright 2N/A * notice, this list of conditions, and the following disclaimer, 2N/A * without modification. 2N/A * 2. Redistributions in binary form must reproduce at minimum a disclaimer 2N/A * substantially similar to the "NO WARRANTY" disclaimer below 2N/A * ("Disclaimer") and any redistribution must be conditioned upon 2N/A * including a substantially similar Disclaimer requirement for further 2N/A * binary redistribution. 2N/A * 3. Neither the names of the above-listed copyright holders nor the names 2N/A * of any contributors may be used to endorse or promote products derived 2N/A * from this software without specific prior written permission. 2N/A * Alternatively, this software may be distributed under the terms of the 2N/A * GNU General Public License ("GPL") version 2 as published by the Free 2N/A * Software Foundation. 2N/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 2N/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 2N/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR 2N/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 2N/A * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2N/A * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2N/A * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2N/A * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 2N/A * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 2N/A * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 2N/A * POSSIBILITY OF SUCH DAMAGES. 2N/A/* Local prototypes */ 2N/A/******************************************************************************* 2N/A * FUNCTION: AcpiNsPrintPathname 2N/A * PARAMETERS: NumSegments - Number of ACPI name segments 2N/A * Pathname - The compressed (internal) path 2N/A * DESCRIPTION: Print an object's full namespace pathname 2N/A ******************************************************************************/ 2N/A /* Print the entire name */ 2N/A for (i = 0; i <
4; i++)
2N/A/******************************************************************************* 2N/A * FUNCTION: AcpiNsDumpPathname 2N/A * PARAMETERS: Handle - Object 2N/A * Msg - Prefix message 2N/A * Level - Desired debug level 2N/A * Component - Caller's component ID 2N/A * DESCRIPTION: Print an object's full namespace pathname 2N/A ******************************************************************************/ 2N/A /* Do this only if the requested debug level and component are enabled */ 2N/A /* Convert handle to a full pathname and print it (with supplied message) */ /******************************************************************************* * FUNCTION: AcpiNsDumpOneObject * PARAMETERS: ObjHandle - Node to be dumped * Level - Nesting level of the handle * Context - Passed into WalkNamespace * DESCRIPTION: Dump a single Node * This procedure is a UserFunction called by AcpiNsWalkNamespace. ******************************************************************************/ /* Check if the owner matches */ /* Indent the object according to the level */ /* Check the node type and name */ /* Now we can print out the pertinent information */ /* Temp nodes are those nodes created by a control method */ /* No attached object, we are done */ /* Dump some of the buffer */ /* Common field handling */ /* No attached object, we are done */ /* If debug turned off, done */ /* If there is an attached object, display it */ /* Dump attached objects */ /* Decode the type of attached object and dump the contents */ AcpiOsPrintf (
"(Pointer to ACPI Object type %.2X [UNKNOWN])\n",
/* If value is NOT an internal object, we are done */ /* Valid object, get the pointer to next level, if any */ * NOTE: takes advantage of common fields between string/buffer /******************************************************************************* * FUNCTION: AcpiNsDumpObjects * PARAMETERS: Type - Object type to be dumped * DisplayType - 0 or ACPI_DISPLAY_SUMMARY * MaxDepth - Maximum depth of dump. Use ACPI_UINT32_MAX * for an effectively unlimited depth. * OwnerId - Dump only objects owned by this ID. Use * ACPI_UINT32_MAX to match all owners. * StartHandle - Where in namespace to start/end search * DESCRIPTION: Dump typed objects within the loaded namespace. Uses * AcpiNsWalkNamespace in conjunction with AcpiNsDumpOneObject. ******************************************************************************/ * Just lock the entire namespace for the duration of the dump. * We don't want any changes to the namespace during this time, * especially the temporary nodes since we are going to display /******************************************************************************* * FUNCTION: AcpiNsDumpEntry * PARAMETERS: Handle - Node to be dumped * DebugLevel - Output level * DESCRIPTION: Dump a single Node ******************************************************************************/ /******************************************************************************* * FUNCTION: AcpiNsDumpTables * PARAMETERS: SearchBase - Root of subtree to be dumped, or * NS_ALL to dump the entire namespace * MaxDepth - Maximum depth of dump. Use INT_MAX * for an effectively unlimited depth. * DESCRIPTION: Dump the name space, or a portion of it. ******************************************************************************/ * If the name space has not been initialized, * there is nothing to dump.