17c478bd9Sstevel@tonic-gate /****************************************************************************** 27c478bd9Sstevel@tonic-gate * 37c478bd9Sstevel@tonic-gate * Module Name: nsdump - table dumping routines for debug 47c478bd9Sstevel@tonic-gate * 57c478bd9Sstevel@tonic-gate *****************************************************************************/ 67c478bd9Sstevel@tonic-gate 7*35786f68SRobert Mustacchi /****************************************************************************** 8*35786f68SRobert Mustacchi * 9*35786f68SRobert Mustacchi * 1. Copyright Notice 10*35786f68SRobert Mustacchi * 11*35786f68SRobert Mustacchi * Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp. 127c478bd9Sstevel@tonic-gate * All rights reserved. 137c478bd9Sstevel@tonic-gate * 14*35786f68SRobert Mustacchi * 2. License 15*35786f68SRobert Mustacchi * 16*35786f68SRobert Mustacchi * 2.1. This is your license from Intel Corp. under its intellectual property 17*35786f68SRobert Mustacchi * rights. You may have additional license terms from the party that provided 18*35786f68SRobert Mustacchi * you this software, covering your right to use that party's intellectual 19*35786f68SRobert Mustacchi * property rights. 20*35786f68SRobert Mustacchi * 21*35786f68SRobert Mustacchi * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 22*35786f68SRobert Mustacchi * copy of the source code appearing in this file ("Covered Code") an 23*35786f68SRobert Mustacchi * irrevocable, perpetual, worldwide license under Intel's copyrights in the 24*35786f68SRobert Mustacchi * base code distributed originally by Intel ("Original Intel Code") to copy, 25*35786f68SRobert Mustacchi 26*35786f68SRobert Mustacchi * make derivatives, distribute, use and display any portion of the Covered 27*35786f68SRobert Mustacchi * Code in any form, with the right to sublicense such rights; and 28*35786f68SRobert Mustacchi * 29*35786f68SRobert Mustacchi * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 30*35786f68SRobert Mustacchi * license (with the right to sublicense), under only those claims of Intel 31*35786f68SRobert Mustacchi * patents that are infringed by the Original Intel Code, to make, use, sell, 32*35786f68SRobert Mustacchi * offer to sell, and import the Covered Code and derivative works thereof 33*35786f68SRobert Mustacchi * solely to the minimum extent necessary to exercise the above copyright 34*35786f68SRobert Mustacchi * license, and in no event shall the patent license extend to any additions 35*35786f68SRobert Mustacchi * to or modifications of the Original Intel Code. No other license or right 36*35786f68SRobert Mustacchi * is granted directly or by implication, estoppel or otherwise; 37*35786f68SRobert Mustacchi * 38*35786f68SRobert Mustacchi * The above copyright and patent license is granted only if the following 39*35786f68SRobert Mustacchi * conditions are met: 40*35786f68SRobert Mustacchi * 41*35786f68SRobert Mustacchi * 3. Conditions 42*35786f68SRobert Mustacchi * 43*35786f68SRobert Mustacchi * 3.1. Redistribution of Source with Rights to Further Distribute Source. 44*35786f68SRobert Mustacchi * Redistribution of source code of any substantial portion of the Covered 45*35786f68SRobert Mustacchi * Code or modification with rights to further distribute source must include 46*35786f68SRobert Mustacchi * the above Copyright Notice, the above License, this list of Conditions, 47*35786f68SRobert Mustacchi * and the following Disclaimer and Export Compliance provision. In addition, 48*35786f68SRobert Mustacchi * Licensee must cause all Covered Code to which Licensee contributes to 49*35786f68SRobert Mustacchi * contain a file documenting the changes Licensee made to create that Covered 50*35786f68SRobert Mustacchi * Code and the date of any change. Licensee must include in that file the 51*35786f68SRobert Mustacchi * documentation of any changes made by any predecessor Licensee. Licensee 52*35786f68SRobert Mustacchi * must include a prominent statement that the modification is derived, 53*35786f68SRobert Mustacchi * directly or indirectly, from Original Intel Code. 54*35786f68SRobert Mustacchi * 55*35786f68SRobert Mustacchi * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 56*35786f68SRobert Mustacchi * Redistribution of source code of any substantial portion of the Covered 57*35786f68SRobert Mustacchi * Code or modification without rights to further distribute source must 58*35786f68SRobert Mustacchi * include the following Disclaimer and Export Compliance provision in the 59*35786f68SRobert Mustacchi * documentation and/or other materials provided with distribution. In 60*35786f68SRobert Mustacchi * addition, Licensee may not authorize further sublicense of source of any 61*35786f68SRobert Mustacchi * portion of the Covered Code, and must include terms to the effect that the 62*35786f68SRobert Mustacchi * license from Licensee to its licensee is limited to the intellectual 63*35786f68SRobert Mustacchi * property embodied in the software Licensee provides to its licensee, and 64*35786f68SRobert Mustacchi * not to intellectual property embodied in modifications its licensee may 65*35786f68SRobert Mustacchi * make. 66*35786f68SRobert Mustacchi * 67*35786f68SRobert Mustacchi * 3.3. Redistribution of Executable. Redistribution in executable form of any 68*35786f68SRobert Mustacchi * substantial portion of the Covered Code or modification must reproduce the 69*35786f68SRobert Mustacchi * above Copyright Notice, and the following Disclaimer and Export Compliance 70*35786f68SRobert Mustacchi * provision in the documentation and/or other materials provided with the 71*35786f68SRobert Mustacchi * distribution. 72*35786f68SRobert Mustacchi * 73*35786f68SRobert Mustacchi * 3.4. Intel retains all right, title, and interest in and to the Original 74*35786f68SRobert Mustacchi * Intel Code. 75*35786f68SRobert Mustacchi * 76*35786f68SRobert Mustacchi * 3.5. Neither the name Intel nor any other trademark owned or controlled by 77*35786f68SRobert Mustacchi * Intel shall be used in advertising or otherwise to promote the sale, use or 78*35786f68SRobert Mustacchi * other dealings in products derived from or relating to the Covered Code 79*35786f68SRobert Mustacchi * without prior written authorization from Intel. 80*35786f68SRobert Mustacchi * 81*35786f68SRobert Mustacchi * 4. Disclaimer and Export Compliance 82*35786f68SRobert Mustacchi * 83*35786f68SRobert Mustacchi * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 84*35786f68SRobert Mustacchi * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 85*35786f68SRobert Mustacchi * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 86*35786f68SRobert Mustacchi * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 87*35786f68SRobert Mustacchi * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 88*35786f68SRobert Mustacchi * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 89*35786f68SRobert Mustacchi * PARTICULAR PURPOSE. 90*35786f68SRobert Mustacchi * 91*35786f68SRobert Mustacchi * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 92*35786f68SRobert Mustacchi * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 93*35786f68SRobert Mustacchi * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 94*35786f68SRobert Mustacchi * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 95*35786f68SRobert Mustacchi * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 96*35786f68SRobert Mustacchi * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 97*35786f68SRobert Mustacchi * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 98*35786f68SRobert Mustacchi * LIMITED REMEDY. 99*35786f68SRobert Mustacchi * 100*35786f68SRobert Mustacchi * 4.3. Licensee shall not export, either directly or indirectly, any of this 101*35786f68SRobert Mustacchi * software or system incorporating such software without first obtaining any 102*35786f68SRobert Mustacchi * required license or other approval from the U. S. Department of Commerce or 103*35786f68SRobert Mustacchi * any other agency or department of the United States Government. In the 104*35786f68SRobert Mustacchi * event Licensee exports any such software from the United States or 105*35786f68SRobert Mustacchi * re-exports any such software from a foreign destination, Licensee shall 106*35786f68SRobert Mustacchi * ensure that the distribution and export/re-export of the software is in 107*35786f68SRobert Mustacchi * compliance with all laws, regulations, orders, or other restrictions of the 108*35786f68SRobert Mustacchi * U.S. Export Administration Regulations. Licensee agrees that neither it nor 109*35786f68SRobert Mustacchi * any of its subsidiaries will export/re-export any technical data, process, 110*35786f68SRobert Mustacchi * software, or service, directly or indirectly, to any country for which the 111*35786f68SRobert Mustacchi * United States government or any agency thereof requires an export license, 112*35786f68SRobert Mustacchi * other governmental approval, or letter of assurance, without first obtaining 113*35786f68SRobert Mustacchi * such license, approval or letter. 114*35786f68SRobert Mustacchi * 115*35786f68SRobert Mustacchi ***************************************************************************** 116*35786f68SRobert Mustacchi * 117*35786f68SRobert Mustacchi * Alternatively, you may choose to be licensed under the terms of the 118*35786f68SRobert Mustacchi * following license: 119*35786f68SRobert Mustacchi * 12026f3cdf0SGordon Ross * Redistribution and use in source and binary forms, with or without 12126f3cdf0SGordon Ross * modification, are permitted provided that the following conditions 12226f3cdf0SGordon Ross * are met: 12326f3cdf0SGordon Ross * 1. Redistributions of source code must retain the above copyright 12426f3cdf0SGordon Ross * notice, this list of conditions, and the following disclaimer, 12526f3cdf0SGordon Ross * without modification. 12626f3cdf0SGordon Ross * 2. Redistributions in binary form must reproduce at minimum a disclaimer 12726f3cdf0SGordon Ross * substantially similar to the "NO WARRANTY" disclaimer below 12826f3cdf0SGordon Ross * ("Disclaimer") and any redistribution must be conditioned upon 12926f3cdf0SGordon Ross * including a substantially similar Disclaimer requirement for further 13026f3cdf0SGordon Ross * binary redistribution. 13126f3cdf0SGordon Ross * 3. Neither the names of the above-listed copyright holders nor the names 13226f3cdf0SGordon Ross * of any contributors may be used to endorse or promote products derived 13326f3cdf0SGordon Ross * from this software without specific prior written permission. 13426f3cdf0SGordon Ross * 13526f3cdf0SGordon Ross * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 13626f3cdf0SGordon Ross * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 137*35786f68SRobert Mustacchi * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 13826f3cdf0SGordon Ross * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 139*35786f68SRobert Mustacchi * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 140*35786f68SRobert Mustacchi * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 141*35786f68SRobert Mustacchi * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 142*35786f68SRobert Mustacchi * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 143*35786f68SRobert Mustacchi * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 144*35786f68SRobert Mustacchi * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 145*35786f68SRobert Mustacchi * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 146*35786f68SRobert Mustacchi * 147*35786f68SRobert Mustacchi * Alternatively, you may choose to be licensed under the terms of the 148*35786f68SRobert Mustacchi * GNU General Public License ("GPL") version 2 as published by the Free 149*35786f68SRobert Mustacchi * Software Foundation. 150*35786f68SRobert Mustacchi * 151*35786f68SRobert Mustacchi *****************************************************************************/ 1527c478bd9Sstevel@tonic-gate 1537c478bd9Sstevel@tonic-gate #include "acpi.h" 154aa2aa9a6SDana Myers #include "accommon.h" 1557c478bd9Sstevel@tonic-gate #include "acnamesp.h" 1567b1019a6SJerry Jelinek #include "acoutput.h" 1577c478bd9Sstevel@tonic-gate 1587c478bd9Sstevel@tonic-gate 1597c478bd9Sstevel@tonic-gate #define _COMPONENT ACPI_NAMESPACE 1607c478bd9Sstevel@tonic-gate ACPI_MODULE_NAME ("nsdump") 1617c478bd9Sstevel@tonic-gate 1627c478bd9Sstevel@tonic-gate /* Local prototypes */ 1637c478bd9Sstevel@tonic-gate 1647c478bd9Sstevel@tonic-gate #ifdef ACPI_OBSOLETE_FUNCTIONS 1657c478bd9Sstevel@tonic-gate void 1667c478bd9Sstevel@tonic-gate AcpiNsDumpRootDevices ( 1677c478bd9Sstevel@tonic-gate void); 1687c478bd9Sstevel@tonic-gate 1697c478bd9Sstevel@tonic-gate static ACPI_STATUS 1707c478bd9Sstevel@tonic-gate AcpiNsDumpOneDevice ( 1717c478bd9Sstevel@tonic-gate ACPI_HANDLE ObjHandle, 1727c478bd9Sstevel@tonic-gate UINT32 Level, 1737c478bd9Sstevel@tonic-gate void *Context, 1747c478bd9Sstevel@tonic-gate void **ReturnValue); 1757c478bd9Sstevel@tonic-gate #endif 1767c478bd9Sstevel@tonic-gate 1777c478bd9Sstevel@tonic-gate 1787c478bd9Sstevel@tonic-gate #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) 1797b1019a6SJerry Jelinek 1807b1019a6SJerry Jelinek static ACPI_STATUS 1817b1019a6SJerry Jelinek AcpiNsDumpOneObjectPath ( 1827b1019a6SJerry Jelinek ACPI_HANDLE ObjHandle, 1837b1019a6SJerry Jelinek UINT32 Level, 1847b1019a6SJerry Jelinek void *Context, 1857b1019a6SJerry Jelinek void **ReturnValue); 1867b1019a6SJerry Jelinek 1877b1019a6SJerry Jelinek static ACPI_STATUS 1887b1019a6SJerry Jelinek AcpiNsGetMaxDepth ( 1897b1019a6SJerry Jelinek ACPI_HANDLE ObjHandle, 1907b1019a6SJerry Jelinek UINT32 Level, 1917b1019a6SJerry Jelinek void *Context, 1927b1019a6SJerry Jelinek void **ReturnValue); 1937b1019a6SJerry Jelinek 1947b1019a6SJerry Jelinek 1957c478bd9Sstevel@tonic-gate /******************************************************************************* 1967c478bd9Sstevel@tonic-gate * 1977c478bd9Sstevel@tonic-gate * FUNCTION: AcpiNsPrintPathname 1987c478bd9Sstevel@tonic-gate * 1997c478bd9Sstevel@tonic-gate * PARAMETERS: NumSegments - Number of ACPI name segments 2007c478bd9Sstevel@tonic-gate * Pathname - The compressed (internal) path 2017c478bd9Sstevel@tonic-gate * 2027c478bd9Sstevel@tonic-gate * RETURN: None 2037c478bd9Sstevel@tonic-gate * 2047c478bd9Sstevel@tonic-gate * DESCRIPTION: Print an object's full namespace pathname 2057c478bd9Sstevel@tonic-gate * 2067c478bd9Sstevel@tonic-gate ******************************************************************************/ 2077c478bd9Sstevel@tonic-gate 2087c478bd9Sstevel@tonic-gate void 2097c478bd9Sstevel@tonic-gate AcpiNsPrintPathname ( 2107c478bd9Sstevel@tonic-gate UINT32 NumSegments, 2117b1019a6SJerry Jelinek const char *Pathname) 2127c478bd9Sstevel@tonic-gate { 213db2bae30SDana Myers UINT32 i; 214186507a7Smyers 215186507a7Smyers 21627f7c583Smyers ACPI_FUNCTION_NAME (NsPrintPathname); 2177c478bd9Sstevel@tonic-gate 2187c478bd9Sstevel@tonic-gate 2197b1019a6SJerry Jelinek /* Check if debug output enabled */ 2207b1019a6SJerry Jelinek 2217b1019a6SJerry Jelinek if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_NAMES, ACPI_NAMESPACE)) 2227c478bd9Sstevel@tonic-gate { 2237c478bd9Sstevel@tonic-gate return; 2247c478bd9Sstevel@tonic-gate } 2257c478bd9Sstevel@tonic-gate 2267c478bd9Sstevel@tonic-gate /* Print the entire name */ 2277c478bd9Sstevel@tonic-gate 2287c478bd9Sstevel@tonic-gate ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "[")); 2297c478bd9Sstevel@tonic-gate 2307c478bd9Sstevel@tonic-gate while (NumSegments) 2317c478bd9Sstevel@tonic-gate { 232186507a7Smyers for (i = 0; i < 4; i++) 233186507a7Smyers { 2347b1019a6SJerry Jelinek isprint ((int) Pathname[i]) ? 235186507a7Smyers AcpiOsPrintf ("%c", Pathname[i]) : 236186507a7Smyers AcpiOsPrintf ("?"); 237186507a7Smyers } 2387c478bd9Sstevel@tonic-gate 239186507a7Smyers Pathname += ACPI_NAME_SIZE; 2407c478bd9Sstevel@tonic-gate NumSegments--; 2417c478bd9Sstevel@tonic-gate if (NumSegments) 2427c478bd9Sstevel@tonic-gate { 2437c478bd9Sstevel@tonic-gate AcpiOsPrintf ("."); 2447c478bd9Sstevel@tonic-gate } 2457c478bd9Sstevel@tonic-gate } 2467c478bd9Sstevel@tonic-gate 2477c478bd9Sstevel@tonic-gate AcpiOsPrintf ("]\n"); 2487c478bd9Sstevel@tonic-gate } 2497c478bd9Sstevel@tonic-gate 2507c478bd9Sstevel@tonic-gate 2517b1019a6SJerry Jelinek #ifdef ACPI_OBSOLETE_FUNCTIONS 2527b1019a6SJerry Jelinek /* Not used at this time, perhaps later */ 2537b1019a6SJerry Jelinek 2547c478bd9Sstevel@tonic-gate /******************************************************************************* 2557c478bd9Sstevel@tonic-gate * 2567c478bd9Sstevel@tonic-gate * FUNCTION: AcpiNsDumpPathname 2577c478bd9Sstevel@tonic-gate * 2587c478bd9Sstevel@tonic-gate * PARAMETERS: Handle - Object 2597c478bd9Sstevel@tonic-gate * Msg - Prefix message 2607c478bd9Sstevel@tonic-gate * Level - Desired debug level 2617c478bd9Sstevel@tonic-gate * Component - Caller's component ID 2627c478bd9Sstevel@tonic-gate * 2637c478bd9Sstevel@tonic-gate * RETURN: None 2647c478bd9Sstevel@tonic-gate * 2657c478bd9Sstevel@tonic-gate * DESCRIPTION: Print an object's full namespace pathname 2667c478bd9Sstevel@tonic-gate * Manages allocation/freeing of a pathname buffer 2677c478bd9Sstevel@tonic-gate * 2687c478bd9Sstevel@tonic-gate ******************************************************************************/ 2697c478bd9Sstevel@tonic-gate 2707c478bd9Sstevel@tonic-gate void 2717c478bd9Sstevel@tonic-gate AcpiNsDumpPathname ( 2727c478bd9Sstevel@tonic-gate ACPI_HANDLE Handle, 2737b1019a6SJerry Jelinek const char *Msg, 2747c478bd9Sstevel@tonic-gate UINT32 Level, 2757c478bd9Sstevel@tonic-gate UINT32 Component) 2767c478bd9Sstevel@tonic-gate { 2777c478bd9Sstevel@tonic-gate 27827f7c583Smyers ACPI_FUNCTION_TRACE (NsDumpPathname); 2797c478bd9Sstevel@tonic-gate 2807c478bd9Sstevel@tonic-gate 2817c478bd9Sstevel@tonic-gate /* Do this only if the requested debug level and component are enabled */ 2827c478bd9Sstevel@tonic-gate 2837b1019a6SJerry Jelinek if (!ACPI_IS_DEBUG_ENABLED (Level, Component)) 2847c478bd9Sstevel@tonic-gate { 2857c478bd9Sstevel@tonic-gate return_VOID; 2867c478bd9Sstevel@tonic-gate } 2877c478bd9Sstevel@tonic-gate 2887c478bd9Sstevel@tonic-gate /* Convert handle to a full pathname and print it (with supplied message) */ 2897c478bd9Sstevel@tonic-gate 2907c478bd9Sstevel@tonic-gate AcpiNsPrintNodePathname (Handle, Msg); 2917c478bd9Sstevel@tonic-gate AcpiOsPrintf ("\n"); 2927c478bd9Sstevel@tonic-gate return_VOID; 2937c478bd9Sstevel@tonic-gate } 2947b1019a6SJerry Jelinek #endif 2957c478bd9Sstevel@tonic-gate 296*35786f68SRobert Mustacchi 2977c478bd9Sstevel@tonic-gate /******************************************************************************* 2987c478bd9Sstevel@tonic-gate * 2997c478bd9Sstevel@tonic-gate * FUNCTION: AcpiNsDumpOneObject 3007c478bd9Sstevel@tonic-gate * 3017c478bd9Sstevel@tonic-gate * PARAMETERS: ObjHandle - Node to be dumped 3027c478bd9Sstevel@tonic-gate * Level - Nesting level of the handle 3037c478bd9Sstevel@tonic-gate * Context - Passed into WalkNamespace 3047c478bd9Sstevel@tonic-gate * ReturnValue - Not used 3057c478bd9Sstevel@tonic-gate * 3067c478bd9Sstevel@tonic-gate * RETURN: Status 3077c478bd9Sstevel@tonic-gate * 3087c478bd9Sstevel@tonic-gate * DESCRIPTION: Dump a single Node 3097c478bd9Sstevel@tonic-gate * This procedure is a UserFunction called by AcpiNsWalkNamespace. 3107c478bd9Sstevel@tonic-gate * 3117c478bd9Sstevel@tonic-gate ******************************************************************************/ 3127c478bd9Sstevel@tonic-gate 3137c478bd9Sstevel@tonic-gate ACPI_STATUS 3147c478bd9Sstevel@tonic-gate AcpiNsDumpOneObject ( 3157c478bd9Sstevel@tonic-gate ACPI_HANDLE ObjHandle, 3167c478bd9Sstevel@tonic-gate UINT32 Level, 3177c478bd9Sstevel@tonic-gate void *Context, 3187c478bd9Sstevel@tonic-gate void **ReturnValue) 3197c478bd9Sstevel@tonic-gate { 3207c478bd9Sstevel@tonic-gate ACPI_WALK_INFO *Info = (ACPI_WALK_INFO *) Context; 3217c478bd9Sstevel@tonic-gate ACPI_NAMESPACE_NODE *ThisNode; 3227c478bd9Sstevel@tonic-gate ACPI_OPERAND_OBJECT *ObjDesc = NULL; 3237c478bd9Sstevel@tonic-gate ACPI_OBJECT_TYPE ObjType; 3247c478bd9Sstevel@tonic-gate ACPI_OBJECT_TYPE Type; 3257c478bd9Sstevel@tonic-gate UINT32 BytesToDump; 3267c478bd9Sstevel@tonic-gate UINT32 DbgLevel; 3277c478bd9Sstevel@tonic-gate UINT32 i; 3287c478bd9Sstevel@tonic-gate 3297c478bd9Sstevel@tonic-gate 33027f7c583Smyers ACPI_FUNCTION_NAME (NsDumpOneObject); 3317c478bd9Sstevel@tonic-gate 3327c478bd9Sstevel@tonic-gate 3337c478bd9Sstevel@tonic-gate /* Is output enabled? */ 3347c478bd9Sstevel@tonic-gate 3357c478bd9Sstevel@tonic-gate if (!(AcpiDbgLevel & Info->DebugLevel)) 3367c478bd9Sstevel@tonic-gate { 3377c478bd9Sstevel@tonic-gate return (AE_OK); 3387c478bd9Sstevel@tonic-gate } 3397c478bd9Sstevel@tonic-gate 3407c478bd9Sstevel@tonic-gate if (!ObjHandle) 3417c478bd9Sstevel@tonic-gate { 3427c478bd9Sstevel@tonic-gate ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Null object handle\n")); 3437c478bd9Sstevel@tonic-gate return (AE_OK); 3447c478bd9Sstevel@tonic-gate } 3457c478bd9Sstevel@tonic-gate 34626f3cdf0SGordon Ross ThisNode = AcpiNsValidateHandle (ObjHandle); 347aa2aa9a6SDana Myers if (!ThisNode) 348aa2aa9a6SDana Myers { 349aa2aa9a6SDana Myers ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Invalid object handle %p\n", 350aa2aa9a6SDana Myers ObjHandle)); 351aa2aa9a6SDana Myers return (AE_OK); 352aa2aa9a6SDana Myers } 353aa2aa9a6SDana Myers 3547c478bd9Sstevel@tonic-gate Type = ThisNode->Type; 355*35786f68SRobert Mustacchi Info->Count++; 3567c478bd9Sstevel@tonic-gate 3577c478bd9Sstevel@tonic-gate /* Check if the owner matches */ 3587c478bd9Sstevel@tonic-gate 359450d6964Smyers if ((Info->OwnerId != ACPI_OWNER_ID_MAX) && 3607c478bd9Sstevel@tonic-gate (Info->OwnerId != ThisNode->OwnerId)) 3617c478bd9Sstevel@tonic-gate { 3627c478bd9Sstevel@tonic-gate return (AE_OK); 3637c478bd9Sstevel@tonic-gate } 3647c478bd9Sstevel@tonic-gate 365450d6964Smyers if (!(Info->DisplayType & ACPI_DISPLAY_SHORT)) 366450d6964Smyers { 367450d6964Smyers /* Indent the object according to the level */ 3687c478bd9Sstevel@tonic-gate 369450d6964Smyers AcpiOsPrintf ("%2d%*s", (UINT32) Level - 1, (int) Level * 2, " "); 3707c478bd9Sstevel@tonic-gate 371450d6964Smyers /* Check the node type and name */ 3727c478bd9Sstevel@tonic-gate 373450d6964Smyers if (Type > ACPI_TYPE_LOCAL_MAX) 374450d6964Smyers { 3757b1019a6SJerry Jelinek ACPI_WARNING ((AE_INFO, 3767b1019a6SJerry Jelinek "Invalid ACPI Object Type 0x%08X", Type)); 377450d6964Smyers } 3787c478bd9Sstevel@tonic-gate 379450d6964Smyers AcpiOsPrintf ("%4.4s", AcpiUtGetNodeName (ThisNode)); 3807c478bd9Sstevel@tonic-gate } 3817c478bd9Sstevel@tonic-gate 382aa2aa9a6SDana Myers /* Now we can print out the pertinent information */ 383aa2aa9a6SDana Myers 38430082d0cSmyers AcpiOsPrintf (" %-12s %p %2.2X ", 3857b1019a6SJerry Jelinek AcpiUtGetTypeName (Type), ThisNode, ThisNode->OwnerId); 3867c478bd9Sstevel@tonic-gate 3877c478bd9Sstevel@tonic-gate DbgLevel = AcpiDbgLevel; 3887c478bd9Sstevel@tonic-gate AcpiDbgLevel = 0; 3897c478bd9Sstevel@tonic-gate ObjDesc = AcpiNsGetAttachedObject (ThisNode); 3907c478bd9Sstevel@tonic-gate AcpiDbgLevel = DbgLevel; 3917c478bd9Sstevel@tonic-gate 392db2bae30SDana Myers /* Temp nodes are those nodes created by a control method */ 393db2bae30SDana Myers 394db2bae30SDana Myers if (ThisNode->Flags & ANOBJ_TEMPORARY) 395db2bae30SDana Myers { 396db2bae30SDana Myers AcpiOsPrintf ("(T) "); 397db2bae30SDana Myers } 398db2bae30SDana Myers 399450d6964Smyers switch (Info->DisplayType & ACPI_DISPLAY_MASK) 4007c478bd9Sstevel@tonic-gate { 4017c478bd9Sstevel@tonic-gate case ACPI_DISPLAY_SUMMARY: 4027c478bd9Sstevel@tonic-gate 4037c478bd9Sstevel@tonic-gate if (!ObjDesc) 4047c478bd9Sstevel@tonic-gate { 4057b1019a6SJerry Jelinek /* No attached object. Some types should always have an object */ 4067b1019a6SJerry Jelinek 4077b1019a6SJerry Jelinek switch (Type) 4087b1019a6SJerry Jelinek { 4097b1019a6SJerry Jelinek case ACPI_TYPE_INTEGER: 4107b1019a6SJerry Jelinek case ACPI_TYPE_PACKAGE: 4117b1019a6SJerry Jelinek case ACPI_TYPE_BUFFER: 4127b1019a6SJerry Jelinek case ACPI_TYPE_STRING: 4137b1019a6SJerry Jelinek case ACPI_TYPE_METHOD: 4147b1019a6SJerry Jelinek 4157b1019a6SJerry Jelinek AcpiOsPrintf ("<No attached object>"); 4167b1019a6SJerry Jelinek break; 4177b1019a6SJerry Jelinek 4187b1019a6SJerry Jelinek default: 4197b1019a6SJerry Jelinek 4207b1019a6SJerry Jelinek break; 4217b1019a6SJerry Jelinek } 4227c478bd9Sstevel@tonic-gate 4237c478bd9Sstevel@tonic-gate AcpiOsPrintf ("\n"); 4247c478bd9Sstevel@tonic-gate return (AE_OK); 4257c478bd9Sstevel@tonic-gate } 4267c478bd9Sstevel@tonic-gate 4277c478bd9Sstevel@tonic-gate switch (Type) 4287c478bd9Sstevel@tonic-gate { 4297c478bd9Sstevel@tonic-gate case ACPI_TYPE_PROCESSOR: 4307c478bd9Sstevel@tonic-gate 4317b1019a6SJerry Jelinek AcpiOsPrintf ("ID %02X Len %02X Addr %8.8X%8.8X\n", 4327c478bd9Sstevel@tonic-gate ObjDesc->Processor.ProcId, ObjDesc->Processor.Length, 4337b1019a6SJerry Jelinek ACPI_FORMAT_UINT64 (ObjDesc->Processor.Address)); 4347c478bd9Sstevel@tonic-gate break; 4357c478bd9Sstevel@tonic-gate 4367c478bd9Sstevel@tonic-gate case ACPI_TYPE_DEVICE: 4377c478bd9Sstevel@tonic-gate 4387c478bd9Sstevel@tonic-gate AcpiOsPrintf ("Notify Object: %p\n", ObjDesc); 4397c478bd9Sstevel@tonic-gate break; 4407c478bd9Sstevel@tonic-gate 4417c478bd9Sstevel@tonic-gate case ACPI_TYPE_METHOD: 4427c478bd9Sstevel@tonic-gate 4437c478bd9Sstevel@tonic-gate AcpiOsPrintf ("Args %X Len %.4X Aml %p\n", 4447c478bd9Sstevel@tonic-gate (UINT32) ObjDesc->Method.ParamCount, 4457c478bd9Sstevel@tonic-gate ObjDesc->Method.AmlLength, ObjDesc->Method.AmlStart); 4467c478bd9Sstevel@tonic-gate break; 4477c478bd9Sstevel@tonic-gate 4487c478bd9Sstevel@tonic-gate case ACPI_TYPE_INTEGER: 4497c478bd9Sstevel@tonic-gate 4507c478bd9Sstevel@tonic-gate AcpiOsPrintf ("= %8.8X%8.8X\n", 4517c478bd9Sstevel@tonic-gate ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value)); 4527c478bd9Sstevel@tonic-gate break; 4537c478bd9Sstevel@tonic-gate 4547c478bd9Sstevel@tonic-gate case ACPI_TYPE_PACKAGE: 4557c478bd9Sstevel@tonic-gate 4567c478bd9Sstevel@tonic-gate if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID) 4577c478bd9Sstevel@tonic-gate { 4587c478bd9Sstevel@tonic-gate AcpiOsPrintf ("Elements %.2X\n", 4597c478bd9Sstevel@tonic-gate ObjDesc->Package.Count); 4607c478bd9Sstevel@tonic-gate } 4617c478bd9Sstevel@tonic-gate else 4627c478bd9Sstevel@tonic-gate { 4637c478bd9Sstevel@tonic-gate AcpiOsPrintf ("[Length not yet evaluated]\n"); 4647c478bd9Sstevel@tonic-gate } 4657c478bd9Sstevel@tonic-gate break; 4667c478bd9Sstevel@tonic-gate 4677c478bd9Sstevel@tonic-gate case ACPI_TYPE_BUFFER: 4687c478bd9Sstevel@tonic-gate 4697c478bd9Sstevel@tonic-gate if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID) 4707c478bd9Sstevel@tonic-gate { 4717c478bd9Sstevel@tonic-gate AcpiOsPrintf ("Len %.2X", 4727b1019a6SJerry Jelinek ObjDesc->Buffer.Length); 4737c478bd9Sstevel@tonic-gate 4747c478bd9Sstevel@tonic-gate /* Dump some of the buffer */ 4757c478bd9Sstevel@tonic-gate 4767c478bd9Sstevel@tonic-gate if (ObjDesc->Buffer.Length > 0) 4777c478bd9Sstevel@tonic-gate { 4787c478bd9Sstevel@tonic-gate AcpiOsPrintf (" ="); 4797c478bd9Sstevel@tonic-gate for (i = 0; (i < ObjDesc->Buffer.Length && i < 12); i++) 4807c478bd9Sstevel@tonic-gate { 4817c478bd9Sstevel@tonic-gate AcpiOsPrintf (" %.2hX", ObjDesc->Buffer.Pointer[i]); 4827c478bd9Sstevel@tonic-gate } 4837c478bd9Sstevel@tonic-gate } 4847c478bd9Sstevel@tonic-gate AcpiOsPrintf ("\n"); 4857c478bd9Sstevel@tonic-gate } 4867c478bd9Sstevel@tonic-gate else 4877c478bd9Sstevel@tonic-gate { 4887c478bd9Sstevel@tonic-gate AcpiOsPrintf ("[Length not yet evaluated]\n"); 4897c478bd9Sstevel@tonic-gate } 4907c478bd9Sstevel@tonic-gate break; 4917c478bd9Sstevel@tonic-gate 4927c478bd9Sstevel@tonic-gate case ACPI_TYPE_STRING: 4937c478bd9Sstevel@tonic-gate 4947c478bd9Sstevel@tonic-gate AcpiOsPrintf ("Len %.2X ", ObjDesc->String.Length); 4957b1019a6SJerry Jelinek AcpiUtPrintString (ObjDesc->String.Pointer, 80); 4967c478bd9Sstevel@tonic-gate AcpiOsPrintf ("\n"); 4977c478bd9Sstevel@tonic-gate break; 4987c478bd9Sstevel@tonic-gate 4997c478bd9Sstevel@tonic-gate case ACPI_TYPE_REGION: 5007c478bd9Sstevel@tonic-gate 5017c478bd9Sstevel@tonic-gate AcpiOsPrintf ("[%s]", 5027c478bd9Sstevel@tonic-gate AcpiUtGetRegionName (ObjDesc->Region.SpaceId)); 5037c478bd9Sstevel@tonic-gate if (ObjDesc->Region.Flags & AOPOBJ_DATA_VALID) 5047c478bd9Sstevel@tonic-gate { 5057c478bd9Sstevel@tonic-gate AcpiOsPrintf (" Addr %8.8X%8.8X Len %.4X\n", 5067b1019a6SJerry Jelinek ACPI_FORMAT_UINT64 (ObjDesc->Region.Address), 5077c478bd9Sstevel@tonic-gate ObjDesc->Region.Length); 5087c478bd9Sstevel@tonic-gate } 5097c478bd9Sstevel@tonic-gate else 5107c478bd9Sstevel@tonic-gate { 5117c478bd9Sstevel@tonic-gate AcpiOsPrintf (" [Address/Length not yet evaluated]\n"); 5127c478bd9Sstevel@tonic-gate } 5137c478bd9Sstevel@tonic-gate break; 5147c478bd9Sstevel@tonic-gate 5157c478bd9Sstevel@tonic-gate case ACPI_TYPE_LOCAL_REFERENCE: 5167c478bd9Sstevel@tonic-gate 517db2bae30SDana Myers AcpiOsPrintf ("[%s]\n", AcpiUtGetReferenceName (ObjDesc)); 5187c478bd9Sstevel@tonic-gate break; 5197c478bd9Sstevel@tonic-gate 5207c478bd9Sstevel@tonic-gate case ACPI_TYPE_BUFFER_FIELD: 5217c478bd9Sstevel@tonic-gate 5227c478bd9Sstevel@tonic-gate if (ObjDesc->BufferField.BufferObj && 5237c478bd9Sstevel@tonic-gate ObjDesc->BufferField.BufferObj->Buffer.Node) 5247c478bd9Sstevel@tonic-gate { 5257c478bd9Sstevel@tonic-gate AcpiOsPrintf ("Buf [%4.4s]", 526aa2aa9a6SDana Myers AcpiUtGetNodeName ( 527aa2aa9a6SDana Myers ObjDesc->BufferField.BufferObj->Buffer.Node)); 5287c478bd9Sstevel@tonic-gate } 5297c478bd9Sstevel@tonic-gate break; 5307c478bd9Sstevel@tonic-gate 5317c478bd9Sstevel@tonic-gate case ACPI_TYPE_LOCAL_REGION_FIELD: 5327c478bd9Sstevel@tonic-gate 5337c478bd9Sstevel@tonic-gate AcpiOsPrintf ("Rgn [%4.4s]", 534aa2aa9a6SDana Myers AcpiUtGetNodeName ( 535aa2aa9a6SDana Myers ObjDesc->CommonField.RegionObj->Region.Node)); 5367c478bd9Sstevel@tonic-gate break; 5377c478bd9Sstevel@tonic-gate 5387c478bd9Sstevel@tonic-gate case ACPI_TYPE_LOCAL_BANK_FIELD: 5397c478bd9Sstevel@tonic-gate 5407c478bd9Sstevel@tonic-gate AcpiOsPrintf ("Rgn [%4.4s] Bnk [%4.4s]", 541aa2aa9a6SDana Myers AcpiUtGetNodeName ( 542aa2aa9a6SDana Myers ObjDesc->CommonField.RegionObj->Region.Node), 543aa2aa9a6SDana Myers AcpiUtGetNodeName ( 544aa2aa9a6SDana Myers ObjDesc->BankField.BankObj->CommonField.Node)); 5457c478bd9Sstevel@tonic-gate break; 5467c478bd9Sstevel@tonic-gate 5477c478bd9Sstevel@tonic-gate case ACPI_TYPE_LOCAL_INDEX_FIELD: 5487c478bd9Sstevel@tonic-gate 5497c478bd9Sstevel@tonic-gate AcpiOsPrintf ("Idx [%4.4s] Dat [%4.4s]", 550aa2aa9a6SDana Myers AcpiUtGetNodeName ( 551aa2aa9a6SDana Myers ObjDesc->IndexField.IndexObj->CommonField.Node), 552aa2aa9a6SDana Myers AcpiUtGetNodeName ( 553aa2aa9a6SDana Myers ObjDesc->IndexField.DataObj->CommonField.Node)); 5547c478bd9Sstevel@tonic-gate break; 5557c478bd9Sstevel@tonic-gate 5567c478bd9Sstevel@tonic-gate case ACPI_TYPE_LOCAL_ALIAS: 5577c478bd9Sstevel@tonic-gate case ACPI_TYPE_LOCAL_METHOD_ALIAS: 5587c478bd9Sstevel@tonic-gate 5597c478bd9Sstevel@tonic-gate AcpiOsPrintf ("Target %4.4s (%p)\n", 5607c478bd9Sstevel@tonic-gate AcpiUtGetNodeName (ObjDesc), ObjDesc); 5617c478bd9Sstevel@tonic-gate break; 5627c478bd9Sstevel@tonic-gate 5637c478bd9Sstevel@tonic-gate default: 5647c478bd9Sstevel@tonic-gate 5657c478bd9Sstevel@tonic-gate AcpiOsPrintf ("Object %p\n", ObjDesc); 5667c478bd9Sstevel@tonic-gate break; 5677c478bd9Sstevel@tonic-gate } 5687c478bd9Sstevel@tonic-gate 5697c478bd9Sstevel@tonic-gate /* Common field handling */ 5707c478bd9Sstevel@tonic-gate 5717c478bd9Sstevel@tonic-gate switch (Type) 5727c478bd9Sstevel@tonic-gate { 5737c478bd9Sstevel@tonic-gate case ACPI_TYPE_BUFFER_FIELD: 5747c478bd9Sstevel@tonic-gate case ACPI_TYPE_LOCAL_REGION_FIELD: 5757c478bd9Sstevel@tonic-gate case ACPI_TYPE_LOCAL_BANK_FIELD: 5767c478bd9Sstevel@tonic-gate case ACPI_TYPE_LOCAL_INDEX_FIELD: 5777c478bd9Sstevel@tonic-gate 5787c478bd9Sstevel@tonic-gate AcpiOsPrintf (" Off %.3X Len %.2X Acc %.2hd\n", 5797c478bd9Sstevel@tonic-gate (ObjDesc->CommonField.BaseByteOffset * 8) 5807c478bd9Sstevel@tonic-gate + ObjDesc->CommonField.StartFieldBitOffset, 5817c478bd9Sstevel@tonic-gate ObjDesc->CommonField.BitLength, 5827c478bd9Sstevel@tonic-gate ObjDesc->CommonField.AccessByteWidth); 5837c478bd9Sstevel@tonic-gate break; 5847c478bd9Sstevel@tonic-gate 5857c478bd9Sstevel@tonic-gate default: 5867b1019a6SJerry Jelinek 5877c478bd9Sstevel@tonic-gate break; 5887c478bd9Sstevel@tonic-gate } 5897c478bd9Sstevel@tonic-gate break; 5907c478bd9Sstevel@tonic-gate 5917c478bd9Sstevel@tonic-gate case ACPI_DISPLAY_OBJECTS: 5927c478bd9Sstevel@tonic-gate 5937c478bd9Sstevel@tonic-gate AcpiOsPrintf ("O:%p", ObjDesc); 5947c478bd9Sstevel@tonic-gate if (!ObjDesc) 5957c478bd9Sstevel@tonic-gate { 5967c478bd9Sstevel@tonic-gate /* No attached object, we are done */ 5977c478bd9Sstevel@tonic-gate 5987c478bd9Sstevel@tonic-gate AcpiOsPrintf ("\n"); 5997c478bd9Sstevel@tonic-gate return (AE_OK); 6007c478bd9Sstevel@tonic-gate } 6017c478bd9Sstevel@tonic-gate 60226f3cdf0SGordon Ross AcpiOsPrintf ("(R%u)", ObjDesc->Common.ReferenceCount); 6037c478bd9Sstevel@tonic-gate 6047c478bd9Sstevel@tonic-gate switch (Type) 6057c478bd9Sstevel@tonic-gate { 6067c478bd9Sstevel@tonic-gate case ACPI_TYPE_METHOD: 6077c478bd9Sstevel@tonic-gate 6087c478bd9Sstevel@tonic-gate /* Name is a Method and its AML offset/length are set */ 6097c478bd9Sstevel@tonic-gate 6107c478bd9Sstevel@tonic-gate AcpiOsPrintf (" M:%p-%X\n", ObjDesc->Method.AmlStart, 611aa2aa9a6SDana Myers ObjDesc->Method.AmlLength); 6127c478bd9Sstevel@tonic-gate break; 6137c478bd9Sstevel@tonic-gate 6147c478bd9Sstevel@tonic-gate case ACPI_TYPE_INTEGER: 6157c478bd9Sstevel@tonic-gate 6167c478bd9Sstevel@tonic-gate AcpiOsPrintf (" I:%8.8X8.8%X\n", 617aa2aa9a6SDana Myers ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value)); 6187c478bd9Sstevel@tonic-gate break; 6197c478bd9Sstevel@tonic-gate 6207c478bd9Sstevel@tonic-gate case ACPI_TYPE_STRING: 6217c478bd9Sstevel@tonic-gate 6227c478bd9Sstevel@tonic-gate AcpiOsPrintf (" S:%p-%X\n", ObjDesc->String.Pointer, 623aa2aa9a6SDana Myers ObjDesc->String.Length); 6247c478bd9Sstevel@tonic-gate break; 6257c478bd9Sstevel@tonic-gate 6267c478bd9Sstevel@tonic-gate case ACPI_TYPE_BUFFER: 6277c478bd9Sstevel@tonic-gate 6287c478bd9Sstevel@tonic-gate AcpiOsPrintf (" B:%p-%X\n", ObjDesc->Buffer.Pointer, 629aa2aa9a6SDana Myers ObjDesc->Buffer.Length); 6307c478bd9Sstevel@tonic-gate break; 6317c478bd9Sstevel@tonic-gate 6327c478bd9Sstevel@tonic-gate default: 6337c478bd9Sstevel@tonic-gate 6347c478bd9Sstevel@tonic-gate AcpiOsPrintf ("\n"); 6357c478bd9Sstevel@tonic-gate break; 6367c478bd9Sstevel@tonic-gate } 6377c478bd9Sstevel@tonic-gate break; 6387c478bd9Sstevel@tonic-gate 6397c478bd9Sstevel@tonic-gate default: 6407c478bd9Sstevel@tonic-gate AcpiOsPrintf ("\n"); 6417c478bd9Sstevel@tonic-gate break; 6427c478bd9Sstevel@tonic-gate } 6437c478bd9Sstevel@tonic-gate 6447c478bd9Sstevel@tonic-gate /* If debug turned off, done */ 6457c478bd9Sstevel@tonic-gate 6467c478bd9Sstevel@tonic-gate if (!(AcpiDbgLevel & ACPI_LV_VALUES)) 6477c478bd9Sstevel@tonic-gate { 6487c478bd9Sstevel@tonic-gate return (AE_OK); 6497c478bd9Sstevel@tonic-gate } 6507c478bd9Sstevel@tonic-gate 6517c478bd9Sstevel@tonic-gate /* If there is an attached object, display it */ 6527c478bd9Sstevel@tonic-gate 6537b1019a6SJerry Jelinek DbgLevel = AcpiDbgLevel; 6547c478bd9Sstevel@tonic-gate AcpiDbgLevel = 0; 6557b1019a6SJerry Jelinek ObjDesc = AcpiNsGetAttachedObject (ThisNode); 6567c478bd9Sstevel@tonic-gate AcpiDbgLevel = DbgLevel; 6577c478bd9Sstevel@tonic-gate 6587c478bd9Sstevel@tonic-gate /* Dump attached objects */ 6597c478bd9Sstevel@tonic-gate 6607c478bd9Sstevel@tonic-gate while (ObjDesc) 6617c478bd9Sstevel@tonic-gate { 6627c478bd9Sstevel@tonic-gate ObjType = ACPI_TYPE_INVALID; 663450d6964Smyers AcpiOsPrintf ("Attached Object %p: ", ObjDesc); 6647c478bd9Sstevel@tonic-gate 6657c478bd9Sstevel@tonic-gate /* Decode the type of attached object and dump the contents */ 6667c478bd9Sstevel@tonic-gate 6677c478bd9Sstevel@tonic-gate switch (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc)) 6687c478bd9Sstevel@tonic-gate { 6697c478bd9Sstevel@tonic-gate case ACPI_DESC_TYPE_NAMED: 6707c478bd9Sstevel@tonic-gate 6717c478bd9Sstevel@tonic-gate AcpiOsPrintf ("(Ptr to Node)\n"); 6727c478bd9Sstevel@tonic-gate BytesToDump = sizeof (ACPI_NAMESPACE_NODE); 673450d6964Smyers ACPI_DUMP_BUFFER (ObjDesc, BytesToDump); 6747c478bd9Sstevel@tonic-gate break; 6757c478bd9Sstevel@tonic-gate 6767c478bd9Sstevel@tonic-gate case ACPI_DESC_TYPE_OPERAND: 6777c478bd9Sstevel@tonic-gate 678aa2aa9a6SDana Myers ObjType = ObjDesc->Common.Type; 6797c478bd9Sstevel@tonic-gate 6807c478bd9Sstevel@tonic-gate if (ObjType > ACPI_TYPE_LOCAL_MAX) 6817c478bd9Sstevel@tonic-gate { 6827b1019a6SJerry Jelinek AcpiOsPrintf ( 6837b1019a6SJerry Jelinek "(Pointer to ACPI Object type %.2X [UNKNOWN])\n", 6847c478bd9Sstevel@tonic-gate ObjType); 6857b1019a6SJerry Jelinek 6867c478bd9Sstevel@tonic-gate BytesToDump = 32; 6877c478bd9Sstevel@tonic-gate } 6887c478bd9Sstevel@tonic-gate else 6897c478bd9Sstevel@tonic-gate { 6907b1019a6SJerry Jelinek AcpiOsPrintf ( 6917b1019a6SJerry Jelinek "(Pointer to ACPI Object type %.2X [%s])\n", 692450d6964Smyers ObjType, AcpiUtGetTypeName (ObjType)); 6937b1019a6SJerry Jelinek 6947c478bd9Sstevel@tonic-gate BytesToDump = sizeof (ACPI_OPERAND_OBJECT); 6957c478bd9Sstevel@tonic-gate } 6967c478bd9Sstevel@tonic-gate 697450d6964Smyers ACPI_DUMP_BUFFER (ObjDesc, BytesToDump); 698450d6964Smyers break; 6997c478bd9Sstevel@tonic-gate 7007c478bd9Sstevel@tonic-gate default: 7017c478bd9Sstevel@tonic-gate 7027c478bd9Sstevel@tonic-gate break; 7037c478bd9Sstevel@tonic-gate } 7047c478bd9Sstevel@tonic-gate 7057c478bd9Sstevel@tonic-gate /* If value is NOT an internal object, we are done */ 7067c478bd9Sstevel@tonic-gate 7077c478bd9Sstevel@tonic-gate if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND) 7087c478bd9Sstevel@tonic-gate { 7097c478bd9Sstevel@tonic-gate goto Cleanup; 7107c478bd9Sstevel@tonic-gate } 7117c478bd9Sstevel@tonic-gate 712aa2aa9a6SDana Myers /* Valid object, get the pointer to next level, if any */ 713aa2aa9a6SDana Myers 7147c478bd9Sstevel@tonic-gate switch (ObjType) 7157c478bd9Sstevel@tonic-gate { 716450d6964Smyers case ACPI_TYPE_BUFFER: 7177c478bd9Sstevel@tonic-gate case ACPI_TYPE_STRING: 718450d6964Smyers /* 719450d6964Smyers * NOTE: takes advantage of common fields between string/buffer 720450d6964Smyers */ 721450d6964Smyers BytesToDump = ObjDesc->String.Length; 7227c478bd9Sstevel@tonic-gate ObjDesc = (void *) ObjDesc->String.Pointer; 7237b1019a6SJerry Jelinek 7247b1019a6SJerry Jelinek AcpiOsPrintf ("(Buffer/String pointer %p length %X)\n", 725450d6964Smyers ObjDesc, BytesToDump); 726450d6964Smyers ACPI_DUMP_BUFFER (ObjDesc, BytesToDump); 727450d6964Smyers goto Cleanup; 7287c478bd9Sstevel@tonic-gate 7297c478bd9Sstevel@tonic-gate case ACPI_TYPE_BUFFER_FIELD: 7307b1019a6SJerry Jelinek 7317c478bd9Sstevel@tonic-gate ObjDesc = (ACPI_OPERAND_OBJECT *) ObjDesc->BufferField.BufferObj; 7327c478bd9Sstevel@tonic-gate break; 7337c478bd9Sstevel@tonic-gate 7347c478bd9Sstevel@tonic-gate case ACPI_TYPE_PACKAGE: 7357b1019a6SJerry Jelinek 7367c478bd9Sstevel@tonic-gate ObjDesc = (void *) ObjDesc->Package.Elements; 7377c478bd9Sstevel@tonic-gate break; 7387c478bd9Sstevel@tonic-gate 7397c478bd9Sstevel@tonic-gate case ACPI_TYPE_METHOD: 7407b1019a6SJerry Jelinek 7417c478bd9Sstevel@tonic-gate ObjDesc = (void *) ObjDesc->Method.AmlStart; 7427c478bd9Sstevel@tonic-gate break; 7437c478bd9Sstevel@tonic-gate 7447c478bd9Sstevel@tonic-gate case ACPI_TYPE_LOCAL_REGION_FIELD: 7457b1019a6SJerry Jelinek 7467c478bd9Sstevel@tonic-gate ObjDesc = (void *) ObjDesc->Field.RegionObj; 7477c478bd9Sstevel@tonic-gate break; 7487c478bd9Sstevel@tonic-gate 7497c478bd9Sstevel@tonic-gate case ACPI_TYPE_LOCAL_BANK_FIELD: 7507b1019a6SJerry Jelinek 7517c478bd9Sstevel@tonic-gate ObjDesc = (void *) ObjDesc->BankField.RegionObj; 7527c478bd9Sstevel@tonic-gate break; 7537c478bd9Sstevel@tonic-gate 7547c478bd9Sstevel@tonic-gate case ACPI_TYPE_LOCAL_INDEX_FIELD: 7557b1019a6SJerry Jelinek 7567c478bd9Sstevel@tonic-gate ObjDesc = (void *) ObjDesc->IndexField.IndexObj; 7577c478bd9Sstevel@tonic-gate break; 7587c478bd9Sstevel@tonic-gate 7597c478bd9Sstevel@tonic-gate default: 7607b1019a6SJerry Jelinek 7617c478bd9Sstevel@tonic-gate goto Cleanup; 7627c478bd9Sstevel@tonic-gate } 7637c478bd9Sstevel@tonic-gate 7647c478bd9Sstevel@tonic-gate ObjType = ACPI_TYPE_INVALID; /* Terminate loop after next pass */ 7657c478bd9Sstevel@tonic-gate } 7667c478bd9Sstevel@tonic-gate 7677c478bd9Sstevel@tonic-gate Cleanup: 7687c478bd9Sstevel@tonic-gate AcpiOsPrintf ("\n"); 7697c478bd9Sstevel@tonic-gate return (AE_OK); 7707c478bd9Sstevel@tonic-gate } 7717c478bd9Sstevel@tonic-gate 7727c478bd9Sstevel@tonic-gate 7737c478bd9Sstevel@tonic-gate /******************************************************************************* 7747c478bd9Sstevel@tonic-gate * 7757c478bd9Sstevel@tonic-gate * FUNCTION: AcpiNsDumpObjects 7767c478bd9Sstevel@tonic-gate * 7777c478bd9Sstevel@tonic-gate * PARAMETERS: Type - Object type to be dumped 7787c478bd9Sstevel@tonic-gate * DisplayType - 0 or ACPI_DISPLAY_SUMMARY 7797c478bd9Sstevel@tonic-gate * MaxDepth - Maximum depth of dump. Use ACPI_UINT32_MAX 7807c478bd9Sstevel@tonic-gate * for an effectively unlimited depth. 781aa2aa9a6SDana Myers * OwnerId - Dump only objects owned by this ID. Use 7827c478bd9Sstevel@tonic-gate * ACPI_UINT32_MAX to match all owners. 7837c478bd9Sstevel@tonic-gate * StartHandle - Where in namespace to start/end search 7847c478bd9Sstevel@tonic-gate * 7857c478bd9Sstevel@tonic-gate * RETURN: None 7867c478bd9Sstevel@tonic-gate * 787aa2aa9a6SDana Myers * DESCRIPTION: Dump typed objects within the loaded namespace. Uses 788aa2aa9a6SDana Myers * AcpiNsWalkNamespace in conjunction with AcpiNsDumpOneObject. 7897c478bd9Sstevel@tonic-gate * 7907c478bd9Sstevel@tonic-gate ******************************************************************************/ 7917c478bd9Sstevel@tonic-gate 7927c478bd9Sstevel@tonic-gate void 7937c478bd9Sstevel@tonic-gate AcpiNsDumpObjects ( 7947c478bd9Sstevel@tonic-gate ACPI_OBJECT_TYPE Type, 7957c478bd9Sstevel@tonic-gate UINT8 DisplayType, 7967c478bd9Sstevel@tonic-gate UINT32 MaxDepth, 797450d6964Smyers ACPI_OWNER_ID OwnerId, 7987c478bd9Sstevel@tonic-gate ACPI_HANDLE StartHandle) 7997c478bd9Sstevel@tonic-gate { 8007c478bd9Sstevel@tonic-gate ACPI_WALK_INFO Info; 80126f3cdf0SGordon Ross ACPI_STATUS Status; 8027c478bd9Sstevel@tonic-gate 8037c478bd9Sstevel@tonic-gate 8047c478bd9Sstevel@tonic-gate ACPI_FUNCTION_ENTRY (); 8057c478bd9Sstevel@tonic-gate 8067c478bd9Sstevel@tonic-gate 80726f3cdf0SGordon Ross /* 80826f3cdf0SGordon Ross * Just lock the entire namespace for the duration of the dump. 80926f3cdf0SGordon Ross * We don't want any changes to the namespace during this time, 81026f3cdf0SGordon Ross * especially the temporary nodes since we are going to display 81126f3cdf0SGordon Ross * them also. 81226f3cdf0SGordon Ross */ 81326f3cdf0SGordon Ross Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); 81426f3cdf0SGordon Ross if (ACPI_FAILURE (Status)) 81526f3cdf0SGordon Ross { 81626f3cdf0SGordon Ross AcpiOsPrintf ("Could not acquire namespace mutex\n"); 81726f3cdf0SGordon Ross return; 81826f3cdf0SGordon Ross } 81926f3cdf0SGordon Ross 820*35786f68SRobert Mustacchi Info.Count = 0; 8217c478bd9Sstevel@tonic-gate Info.DebugLevel = ACPI_LV_TABLES; 8227c478bd9Sstevel@tonic-gate Info.OwnerId = OwnerId; 8237c478bd9Sstevel@tonic-gate Info.DisplayType = DisplayType; 8247c478bd9Sstevel@tonic-gate 8257c478bd9Sstevel@tonic-gate (void) AcpiNsWalkNamespace (Type, StartHandle, MaxDepth, 8267b1019a6SJerry Jelinek ACPI_NS_WALK_NO_UNLOCK | ACPI_NS_WALK_TEMP_NODES, 8277b1019a6SJerry Jelinek AcpiNsDumpOneObject, NULL, (void *) &Info, NULL); 8287b1019a6SJerry Jelinek 829*35786f68SRobert Mustacchi AcpiOsPrintf ("\nNamespace node count: %u\n\n", Info.Count); 8307b1019a6SJerry Jelinek (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); 8317b1019a6SJerry Jelinek } 8327b1019a6SJerry Jelinek 8337b1019a6SJerry Jelinek 8347b1019a6SJerry Jelinek /******************************************************************************* 8357b1019a6SJerry Jelinek * 8367b1019a6SJerry Jelinek * FUNCTION: AcpiNsDumpOneObjectPath, AcpiNsGetMaxDepth 8377b1019a6SJerry Jelinek * 8387b1019a6SJerry Jelinek * PARAMETERS: ObjHandle - Node to be dumped 8397b1019a6SJerry Jelinek * Level - Nesting level of the handle 8407b1019a6SJerry Jelinek * Context - Passed into WalkNamespace 8417b1019a6SJerry Jelinek * ReturnValue - Not used 8427b1019a6SJerry Jelinek * 8437b1019a6SJerry Jelinek * RETURN: Status 8447b1019a6SJerry Jelinek * 8457b1019a6SJerry Jelinek * DESCRIPTION: Dump the full pathname to a namespace object. AcpNsGetMaxDepth 8467b1019a6SJerry Jelinek * computes the maximum nesting depth in the namespace tree, in 8477b1019a6SJerry Jelinek * order to simplify formatting in AcpiNsDumpOneObjectPath. 8487b1019a6SJerry Jelinek * These procedures are UserFunctions called by AcpiNsWalkNamespace. 8497b1019a6SJerry Jelinek * 8507b1019a6SJerry Jelinek ******************************************************************************/ 8517b1019a6SJerry Jelinek 8527b1019a6SJerry Jelinek static ACPI_STATUS 8537b1019a6SJerry Jelinek AcpiNsDumpOneObjectPath ( 8547b1019a6SJerry Jelinek ACPI_HANDLE ObjHandle, 8557b1019a6SJerry Jelinek UINT32 Level, 8567b1019a6SJerry Jelinek void *Context, 8577b1019a6SJerry Jelinek void **ReturnValue) 8587b1019a6SJerry Jelinek { 8597b1019a6SJerry Jelinek UINT32 MaxLevel = *((UINT32 *) Context); 8607b1019a6SJerry Jelinek char *Pathname; 8617b1019a6SJerry Jelinek ACPI_NAMESPACE_NODE *Node; 8627b1019a6SJerry Jelinek int PathIndent; 8637b1019a6SJerry Jelinek 8647b1019a6SJerry Jelinek 8657b1019a6SJerry Jelinek if (!ObjHandle) 8667b1019a6SJerry Jelinek { 8677b1019a6SJerry Jelinek return (AE_OK); 8687b1019a6SJerry Jelinek } 8697b1019a6SJerry Jelinek 8707b1019a6SJerry Jelinek Node = AcpiNsValidateHandle (ObjHandle); 8717b1019a6SJerry Jelinek if (!Node) 8727b1019a6SJerry Jelinek { 8737b1019a6SJerry Jelinek /* Ignore bad node during namespace walk */ 8747b1019a6SJerry Jelinek 8757b1019a6SJerry Jelinek return (AE_OK); 8767b1019a6SJerry Jelinek } 8777b1019a6SJerry Jelinek 8787b1019a6SJerry Jelinek Pathname = AcpiNsGetNormalizedPathname (Node, TRUE); 8797b1019a6SJerry Jelinek 8807b1019a6SJerry Jelinek PathIndent = 1; 8817b1019a6SJerry Jelinek if (Level <= MaxLevel) 8827b1019a6SJerry Jelinek { 8837b1019a6SJerry Jelinek PathIndent = MaxLevel - Level + 1; 8847b1019a6SJerry Jelinek } 8857b1019a6SJerry Jelinek 8867b1019a6SJerry Jelinek AcpiOsPrintf ("%2d%*s%-12s%*s", 8877b1019a6SJerry Jelinek Level, Level, " ", AcpiUtGetTypeName (Node->Type), 8887b1019a6SJerry Jelinek PathIndent, " "); 8897b1019a6SJerry Jelinek 8907b1019a6SJerry Jelinek AcpiOsPrintf ("%s\n", &Pathname[1]); 8917b1019a6SJerry Jelinek ACPI_FREE (Pathname); 8927b1019a6SJerry Jelinek return (AE_OK); 8937b1019a6SJerry Jelinek } 8947b1019a6SJerry Jelinek 8957b1019a6SJerry Jelinek 8967b1019a6SJerry Jelinek static ACPI_STATUS 8977b1019a6SJerry Jelinek AcpiNsGetMaxDepth ( 8987b1019a6SJerry Jelinek ACPI_HANDLE ObjHandle, 8997b1019a6SJerry Jelinek UINT32 Level, 9007b1019a6SJerry Jelinek void *Context, 9017b1019a6SJerry Jelinek void **ReturnValue) 9027b1019a6SJerry Jelinek { 9037b1019a6SJerry Jelinek UINT32 *MaxLevel = (UINT32 *) Context; 9047b1019a6SJerry Jelinek 9057b1019a6SJerry Jelinek 9067b1019a6SJerry Jelinek if (Level > *MaxLevel) 9077b1019a6SJerry Jelinek { 9087b1019a6SJerry Jelinek *MaxLevel = Level; 9097b1019a6SJerry Jelinek } 9107b1019a6SJerry Jelinek return (AE_OK); 9117b1019a6SJerry Jelinek } 9127b1019a6SJerry Jelinek 9137b1019a6SJerry Jelinek 9147b1019a6SJerry Jelinek /******************************************************************************* 9157b1019a6SJerry Jelinek * 9167b1019a6SJerry Jelinek * FUNCTION: AcpiNsDumpObjectPaths 9177b1019a6SJerry Jelinek * 9187b1019a6SJerry Jelinek * PARAMETERS: Type - Object type to be dumped 9197b1019a6SJerry Jelinek * DisplayType - 0 or ACPI_DISPLAY_SUMMARY 9207b1019a6SJerry Jelinek * MaxDepth - Maximum depth of dump. Use ACPI_UINT32_MAX 9217b1019a6SJerry Jelinek * for an effectively unlimited depth. 9227b1019a6SJerry Jelinek * OwnerId - Dump only objects owned by this ID. Use 9237b1019a6SJerry Jelinek * ACPI_UINT32_MAX to match all owners. 9247b1019a6SJerry Jelinek * StartHandle - Where in namespace to start/end search 9257b1019a6SJerry Jelinek * 9267b1019a6SJerry Jelinek * RETURN: None 9277b1019a6SJerry Jelinek * 9287b1019a6SJerry Jelinek * DESCRIPTION: Dump full object pathnames within the loaded namespace. Uses 9297b1019a6SJerry Jelinek * AcpiNsWalkNamespace in conjunction with AcpiNsDumpOneObjectPath. 9307b1019a6SJerry Jelinek * 9317b1019a6SJerry Jelinek ******************************************************************************/ 9327b1019a6SJerry Jelinek 9337b1019a6SJerry Jelinek void 9347b1019a6SJerry Jelinek AcpiNsDumpObjectPaths ( 9357b1019a6SJerry Jelinek ACPI_OBJECT_TYPE Type, 9367b1019a6SJerry Jelinek UINT8 DisplayType, 9377b1019a6SJerry Jelinek UINT32 MaxDepth, 9387b1019a6SJerry Jelinek ACPI_OWNER_ID OwnerId, 9397b1019a6SJerry Jelinek ACPI_HANDLE StartHandle) 9407b1019a6SJerry Jelinek { 9417b1019a6SJerry Jelinek ACPI_STATUS Status; 9427b1019a6SJerry Jelinek UINT32 MaxLevel = 0; 9437b1019a6SJerry Jelinek 9447b1019a6SJerry Jelinek 9457b1019a6SJerry Jelinek ACPI_FUNCTION_ENTRY (); 9467b1019a6SJerry Jelinek 9477b1019a6SJerry Jelinek 9487b1019a6SJerry Jelinek /* 9497b1019a6SJerry Jelinek * Just lock the entire namespace for the duration of the dump. 9507b1019a6SJerry Jelinek * We don't want any changes to the namespace during this time, 9517b1019a6SJerry Jelinek * especially the temporary nodes since we are going to display 9527b1019a6SJerry Jelinek * them also. 9537b1019a6SJerry Jelinek */ 9547b1019a6SJerry Jelinek Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); 9557b1019a6SJerry Jelinek if (ACPI_FAILURE (Status)) 9567b1019a6SJerry Jelinek { 9577b1019a6SJerry Jelinek AcpiOsPrintf ("Could not acquire namespace mutex\n"); 9587b1019a6SJerry Jelinek return; 9597b1019a6SJerry Jelinek } 9607b1019a6SJerry Jelinek 9617b1019a6SJerry Jelinek /* Get the max depth of the namespace tree, for formatting later */ 9627b1019a6SJerry Jelinek 9637b1019a6SJerry Jelinek (void) AcpiNsWalkNamespace (Type, StartHandle, MaxDepth, 9647b1019a6SJerry Jelinek ACPI_NS_WALK_NO_UNLOCK | ACPI_NS_WALK_TEMP_NODES, 9657b1019a6SJerry Jelinek AcpiNsGetMaxDepth, NULL, (void *) &MaxLevel, NULL); 9667b1019a6SJerry Jelinek 9677b1019a6SJerry Jelinek /* Now dump the entire namespace */ 9687b1019a6SJerry Jelinek 9697b1019a6SJerry Jelinek (void) AcpiNsWalkNamespace (Type, StartHandle, MaxDepth, 9707b1019a6SJerry Jelinek ACPI_NS_WALK_NO_UNLOCK | ACPI_NS_WALK_TEMP_NODES, 9717b1019a6SJerry Jelinek AcpiNsDumpOneObjectPath, NULL, (void *) &MaxLevel, NULL); 97226f3cdf0SGordon Ross 97326f3cdf0SGordon Ross (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); 9747c478bd9Sstevel@tonic-gate } 9757c478bd9Sstevel@tonic-gate 9767c478bd9Sstevel@tonic-gate 9777c478bd9Sstevel@tonic-gate /******************************************************************************* 9787c478bd9Sstevel@tonic-gate * 9797c478bd9Sstevel@tonic-gate * FUNCTION: AcpiNsDumpEntry 9807c478bd9Sstevel@tonic-gate * 9817c478bd9Sstevel@tonic-gate * PARAMETERS: Handle - Node to be dumped 9827c478bd9Sstevel@tonic-gate * DebugLevel - Output level 9837c478bd9Sstevel@tonic-gate * 9847c478bd9Sstevel@tonic-gate * RETURN: None 9857c478bd9Sstevel@tonic-gate * 9867c478bd9Sstevel@tonic-gate * DESCRIPTION: Dump a single Node 9877c478bd9Sstevel@tonic-gate * 9887c478bd9Sstevel@tonic-gate ******************************************************************************/ 9897c478bd9Sstevel@tonic-gate 9907c478bd9Sstevel@tonic-gate void 9917c478bd9Sstevel@tonic-gate AcpiNsDumpEntry ( 9927c478bd9Sstevel@tonic-gate ACPI_HANDLE Handle, 9937c478bd9Sstevel@tonic-gate UINT32 DebugLevel) 9947c478bd9Sstevel@tonic-gate { 9957c478bd9Sstevel@tonic-gate ACPI_WALK_INFO Info; 9967c478bd9Sstevel@tonic-gate 9977c478bd9Sstevel@tonic-gate 9987c478bd9Sstevel@tonic-gate ACPI_FUNCTION_ENTRY (); 9997c478bd9Sstevel@tonic-gate 10007c478bd9Sstevel@tonic-gate 10017c478bd9Sstevel@tonic-gate Info.DebugLevel = DebugLevel; 1002450d6964Smyers Info.OwnerId = ACPI_OWNER_ID_MAX; 10037c478bd9Sstevel@tonic-gate Info.DisplayType = ACPI_DISPLAY_SUMMARY; 10047c478bd9Sstevel@tonic-gate 10057c478bd9Sstevel@tonic-gate (void) AcpiNsDumpOneObject (Handle, 1, &Info, NULL); 10067c478bd9Sstevel@tonic-gate } 10077c478bd9Sstevel@tonic-gate 10087c478bd9Sstevel@tonic-gate 1009450d6964Smyers #ifdef ACPI_ASL_COMPILER 10107c478bd9Sstevel@tonic-gate /******************************************************************************* 10117c478bd9Sstevel@tonic-gate * 10127c478bd9Sstevel@tonic-gate * FUNCTION: AcpiNsDumpTables 10137c478bd9Sstevel@tonic-gate * 10147c478bd9Sstevel@tonic-gate * PARAMETERS: SearchBase - Root of subtree to be dumped, or 10157c478bd9Sstevel@tonic-gate * NS_ALL to dump the entire namespace 10167b1019a6SJerry Jelinek * MaxDepth - Maximum depth of dump. Use INT_MAX 10177c478bd9Sstevel@tonic-gate * for an effectively unlimited depth. 10187c478bd9Sstevel@tonic-gate * 10197c478bd9Sstevel@tonic-gate * RETURN: None 10207c478bd9Sstevel@tonic-gate * 10217c478bd9Sstevel@tonic-gate * DESCRIPTION: Dump the name space, or a portion of it. 10227c478bd9Sstevel@tonic-gate * 10237c478bd9Sstevel@tonic-gate ******************************************************************************/ 10247c478bd9Sstevel@tonic-gate 10257c478bd9Sstevel@tonic-gate void 10267c478bd9Sstevel@tonic-gate AcpiNsDumpTables ( 10277c478bd9Sstevel@tonic-gate ACPI_HANDLE SearchBase, 10287c478bd9Sstevel@tonic-gate UINT32 MaxDepth) 10297c478bd9Sstevel@tonic-gate { 10307c478bd9Sstevel@tonic-gate ACPI_HANDLE SearchHandle = SearchBase; 10317c478bd9Sstevel@tonic-gate 10327c478bd9Sstevel@tonic-gate 103327f7c583Smyers ACPI_FUNCTION_TRACE (NsDumpTables); 10347c478bd9Sstevel@tonic-gate 10357c478bd9Sstevel@tonic-gate 10367c478bd9Sstevel@tonic-gate if (!AcpiGbl_RootNode) 10377c478bd9Sstevel@tonic-gate { 10387c478bd9Sstevel@tonic-gate /* 10397c478bd9Sstevel@tonic-gate * If the name space has not been initialized, 10407c478bd9Sstevel@tonic-gate * there is nothing to dump. 10417c478bd9Sstevel@tonic-gate */ 10427b1019a6SJerry Jelinek ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, 10437b1019a6SJerry Jelinek "namespace not initialized!\n")); 10447c478bd9Sstevel@tonic-gate return_VOID; 10457c478bd9Sstevel@tonic-gate } 10467c478bd9Sstevel@tonic-gate 10477c478bd9Sstevel@tonic-gate if (ACPI_NS_ALL == SearchBase) 10487c478bd9Sstevel@tonic-gate { 10497c478bd9Sstevel@tonic-gate /* Entire namespace */ 10507c478bd9Sstevel@tonic-gate 10517c478bd9Sstevel@tonic-gate SearchHandle = AcpiGbl_RootNode; 10527c478bd9Sstevel@tonic-gate ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "\\\n")); 10537c478bd9Sstevel@tonic-gate } 10547c478bd9Sstevel@tonic-gate 10557c478bd9Sstevel@tonic-gate AcpiNsDumpObjects (ACPI_TYPE_ANY, ACPI_DISPLAY_OBJECTS, MaxDepth, 10567b1019a6SJerry Jelinek ACPI_OWNER_ID_MAX, SearchHandle); 10577c478bd9Sstevel@tonic-gate return_VOID; 10587c478bd9Sstevel@tonic-gate } 10597c478bd9Sstevel@tonic-gate #endif 10607c478bd9Sstevel@tonic-gate #endif 1061