Merge tag 'trace-v5.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt...
[linux/fpc-iii.git] / drivers / acpi / acpica / nsdumpdv.c
blobb691fe20e384ec76ac9a7e16d6d8967bc9636c49
1 // SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
2 /******************************************************************************
4 * Module Name: nsdump - table dumping routines for debug
6 * Copyright (C) 2000 - 2020, Intel Corp.
8 *****************************************************************************/
10 #include <acpi/acpi.h>
12 /* TBD: This entire module is apparently obsolete and should be removed */
14 #define _COMPONENT ACPI_NAMESPACE
15 ACPI_MODULE_NAME("nsdumpdv")
16 #ifdef ACPI_OBSOLETE_FUNCTIONS
17 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
18 #include "acnamesp.h"
19 /*******************************************************************************
21 * FUNCTION: acpi_ns_dump_one_device
23 * PARAMETERS: handle - Node to be dumped
24 * level - Nesting level of the handle
25 * context - Passed into walk_namespace
26 * return_value - Not used
28 * RETURN: Status
30 * DESCRIPTION: Dump a single Node that represents a device
31 * This procedure is a user_function called by acpi_ns_walk_namespace.
33 ******************************************************************************/
34 static acpi_status
35 acpi_ns_dump_one_device(acpi_handle obj_handle,
36 u32 level, void *context, void **return_value)
38 struct acpi_buffer buffer;
39 struct acpi_device_info *info;
40 acpi_status status;
41 u32 i;
43 ACPI_FUNCTION_NAME(ns_dump_one_device);
45 status =
46 acpi_ns_dump_one_object(obj_handle, level, context, return_value);
48 buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER;
49 status = acpi_get_object_info(obj_handle, &buffer);
50 if (ACPI_SUCCESS(status)) {
51 info = buffer.pointer;
52 for (i = 0; i < level; i++) {
53 ACPI_DEBUG_PRINT_RAW((ACPI_DB_TABLES, " "));
56 ACPI_DEBUG_PRINT_RAW((ACPI_DB_TABLES,
57 " HID: %s, ADR: %8.8X%8.8X\n",
58 info->hardware_id.value,
59 ACPI_FORMAT_UINT64(info->address)));
60 ACPI_FREE(info);
63 return (status);
66 /*******************************************************************************
68 * FUNCTION: acpi_ns_dump_root_devices
70 * PARAMETERS: None
72 * RETURN: None
74 * DESCRIPTION: Dump all objects of type "device"
76 ******************************************************************************/
78 void acpi_ns_dump_root_devices(void)
80 acpi_handle sys_bus_handle;
81 acpi_status status;
83 ACPI_FUNCTION_NAME(ns_dump_root_devices);
85 /* Only dump the table if tracing is enabled */
87 if (!(ACPI_LV_TABLES & acpi_dbg_level)) {
88 return;
91 status = acpi_get_handle(NULL, METHOD_NAME__SB_, &sys_bus_handle);
92 if (ACPI_FAILURE(status)) {
93 return;
96 ACPI_DEBUG_PRINT((ACPI_DB_TABLES,
97 "Display of all devices in the namespace:\n"));
99 status = acpi_ns_walk_namespace(ACPI_TYPE_DEVICE, sys_bus_handle,
100 ACPI_UINT32_MAX, ACPI_NS_WALK_NO_UNLOCK,
101 acpi_ns_dump_one_device, NULL, NULL,
102 NULL);
105 #endif
106 #endif