void AcpiRsDumpIrqList ( UINT8 *RouteTable) { ACPI_PCI_ROUTING_TABLE *PrtElement; UINT8 Count; ACPI_FUNCTION_ENTRY (); /* Check if debug output enabled */ if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_RESOURCES, _COMPONENT)) { return; } PrtElement = ACPI_CAST_PTR (ACPI_PCI_ROUTING_TABLE, RouteTable); /* Dump all table elements, Exit on zero length element */ for (Count = 0; PrtElement->Length; Count++) { AcpiOsPrintf ("\n[%02X] PCI IRQ Routing Table Package\n", Count); AcpiRsDumpDescriptor (PrtElement, AcpiRsDumpPrt); PrtElement = ACPI_ADD_PTR (ACPI_PCI_ROUTING_TABLE, PrtElement, PrtElement->Length); } }
void acpi_ns_print_pathname(u32 num_segments, char *pathname) { u32 i; ACPI_FUNCTION_NAME(ns_print_pathname); /* Check if debug output enabled */ if (!ACPI_IS_DEBUG_ENABLED(ACPI_LV_NAMES, ACPI_NAMESPACE)) { return; } /* Print the entire name */ ACPI_DEBUG_PRINT((ACPI_DB_NAMES, "[")); while (num_segments) { for (i = 0; i < 4; i++) { isprint((int)pathname[i]) ? acpi_os_printf("%c", pathname[i]) : acpi_os_printf("?"); } pathname += ACPI_NAME_SIZE; num_segments--; if (num_segments) { acpi_os_printf("."); } } acpi_os_printf("]\n"); }
void AcpiUtStatusExit ( UINT32 LineNumber, const char *FunctionName, const char *ModuleName, UINT32 ComponentId, ACPI_STATUS Status) { /* Check if enabled up-front for performance */ if (ACPI_IS_DEBUG_ENABLED (ACPI_LV_FUNCTIONS, ComponentId)) { if (ACPI_SUCCESS (Status)) { AcpiDebugPrint (ACPI_LV_FUNCTIONS, LineNumber, FunctionName, ModuleName, ComponentId, "%s %s\n", AcpiGbl_FnExitStr, AcpiFormatException (Status)); } else { AcpiDebugPrint (ACPI_LV_FUNCTIONS, LineNumber, FunctionName, ModuleName, ComponentId, "%s ****Exception****: %s\n", AcpiGbl_FnExitStr, AcpiFormatException (Status)); } } if (AcpiGbl_NestingLevel) { AcpiGbl_NestingLevel--; } }
/******************************************************************************* * * FUNCTION: acpi_ut_status_exit * * PARAMETERS: line_number - Caller's line number * function_name - Caller's procedure name * module_name - Caller's module name * component_id - Caller's component ID * status - Exit status code * * RETURN: None * * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is * set in debug_level. Prints exit status also. * ******************************************************************************/ void acpi_ut_status_exit(u32 line_number, const char *function_name, const char *module_name, u32 component_id, acpi_status status) { /* Check if enabled up-front for performance */ if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { if (ACPI_SUCCESS(status)) { acpi_debug_print(ACPI_LV_FUNCTIONS, line_number, function_name, module_name, component_id, "%s %s\n", acpi_gbl_fn_exit_str, acpi_format_exception(status)); } else { acpi_debug_print(ACPI_LV_FUNCTIONS, line_number, function_name, module_name, component_id, "%s ****Exception****: %s\n", acpi_gbl_fn_exit_str, acpi_format_exception(status)); } } if (acpi_gbl_nesting_level) { acpi_gbl_nesting_level--; } }
void acpi_rs_dump_irq_list(u8 *route_table) { struct acpi_pci_routing_table *prt_element; u8 count; ACPI_FUNCTION_ENTRY(); /* Check if debug output enabled */ if (!ACPI_IS_DEBUG_ENABLED(ACPI_LV_RESOURCES, _COMPONENT)) { return; } prt_element = ACPI_CAST_PTR(struct acpi_pci_routing_table, route_table); /* Dump all table elements, Exit on zero length element */ for (count = 0; prt_element->length; count++) { acpi_os_printf("\n[%02X] PCI IRQ Routing Table Package\n", count); acpi_rs_dump_descriptor(prt_element, acpi_rs_dump_prt); prt_element = ACPI_ADD_PTR(struct acpi_pci_routing_table, prt_element, prt_element->length); } }
void acpi_rs_dump_resource_list(struct acpi_resource *resource_list) { u32 count = 0; u32 type; ACPI_FUNCTION_ENTRY(); /* Check if debug output enabled */ if (!ACPI_IS_DEBUG_ENABLED(ACPI_LV_RESOURCES, _COMPONENT)) { return; } /* Walk list and dump all resource descriptors (END_TAG terminates) */ do { acpi_os_printf("\n[%02X] ", count); count++; /* Validate Type before dispatch */ type = resource_list->type; if (type > ACPI_RESOURCE_TYPE_MAX) { acpi_os_printf ("Invalid descriptor type (%X) in resource list\n", resource_list->type); return; } /* Sanity check the length. It must not be zero, or we loop forever */ if (!resource_list->length) { acpi_os_printf ("Invalid zero length descriptor in resource list\n"); return; } /* Dump the resource descriptor */ if (type == ACPI_RESOURCE_TYPE_SERIAL_BUS) { acpi_rs_dump_descriptor(&resource_list->data, acpi_gbl_dump_serial_bus_dispatch [resource_list->data. common_serial_bus.type]); } else { acpi_rs_dump_descriptor(&resource_list->data, acpi_gbl_dump_resource_dispatch [type]); } /* Point to the next resource structure */ resource_list = ACPI_NEXT_RESOURCE(resource_list); /* Exit when END_TAG descriptor is reached */ } while (type != ACPI_RESOURCE_TYPE_END_TAG); }
void ACPI_INTERNAL_VAR_XFACE acpi_debug_print(u32 requested_debug_level, u32 line_number, const char *function_name, const char *module_name, u32 component_id, const char *format, ...) { acpi_thread_id thread_id; va_list args; /* Check if debug output enabled */ if (!ACPI_IS_DEBUG_ENABLED(requested_debug_level, component_id)) { return; } /* * Thread tracking and context switch notification */ thread_id = acpi_os_get_thread_id(); if (thread_id != acpi_gbl_prev_thread_id) { if (ACPI_LV_THREADS & acpi_dbg_level) { acpi_os_printf ("\n**** Context Switch from TID %u to TID %u ****\n\n", (u32)acpi_gbl_prev_thread_id, (u32)thread_id); } acpi_gbl_prev_thread_id = thread_id; acpi_gbl_nesting_level = 0; } /* * Display the module name, current line number, thread ID (if requested), * current procedure nesting level, and the current procedure name */ acpi_os_printf("%9s-%04ld ", module_name, line_number); #ifdef ACPI_APPLICATION /* * For acpi_exec/iASL only, emit the thread ID and nesting level. * Note: nesting level is really only useful during a single-thread * execution. Otherwise, multiple threads will keep resetting the * level. */ if (ACPI_LV_THREADS & acpi_dbg_level) { acpi_os_printf("[%u] ", (u32)thread_id); } acpi_os_printf("[%02ld] ", acpi_gbl_nesting_level); #endif acpi_os_printf("%-22.22s: ", acpi_ut_trim_function_name(function_name)); va_start(args, format); acpi_os_vprintf(format, args); va_end(args); }
void ACPI_INTERNAL_VAR_XFACE AcpiDebugPrint ( UINT32 RequestedDebugLevel, UINT32 LineNumber, const char *FunctionName, const char *ModuleName, UINT32 ComponentId, const char *Format, ...) { ACPI_THREAD_ID ThreadId; va_list args; /* Check if debug output enabled */ if (!ACPI_IS_DEBUG_ENABLED (RequestedDebugLevel, ComponentId)) { return; } /* * Thread tracking and context switch notification */ ThreadId = AcpiOsGetThreadId (); if (ThreadId != AcpiGbl_PrevThreadId) { if (ACPI_LV_THREADS & AcpiDbgLevel) { AcpiOsPrintf ( "\n**** Context Switch from TID %u to TID %u ****\n\n", (UINT32) AcpiGbl_PrevThreadId, (UINT32) ThreadId); } AcpiGbl_PrevThreadId = ThreadId; } /* * Display the module name, current line number, thread ID (if requested), * current procedure nesting level, and the current procedure name */ AcpiOsPrintf ("%9s-%04ld ", ModuleName, LineNumber); if (ACPI_LV_THREADS & AcpiDbgLevel) { AcpiOsPrintf ("[%u] ", (UINT32) ThreadId); } AcpiOsPrintf ("[%02ld] %-22.22s: ", AcpiGbl_NestingLevel, AcpiUtTrimFunctionName (FunctionName)); va_start (args, Format); AcpiOsVprintf (Format, args); va_end (args); }
/******************************************************************************* * * FUNCTION: acpi_ut_trace * * PARAMETERS: line_number - Caller's line number * function_name - Caller's procedure name * module_name - Caller's module name * component_id - Caller's component ID * * RETURN: None * * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is * set in debug_level * ******************************************************************************/ void acpi_ut_trace(u32 line_number, const char *function_name, const char *module_name, u32 component_id) { acpi_gbl_nesting_level++; acpi_ut_track_stack_ptr(); /* Check if enabled up-front for performance */ if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { acpi_debug_print(ACPI_LV_FUNCTIONS, line_number, function_name, module_name, component_id, "%s\n", acpi_gbl_fn_entry_str); } }
void acpi_ns_dump_pathname(acpi_handle handle, char *msg, u32 level, u32 component) { ACPI_FUNCTION_TRACE(ns_dump_pathname); /* Do this only if the requested debug level and component are enabled */ if (!ACPI_IS_DEBUG_ENABLED(level, component)) { return_VOID; } /* Convert handle to a full pathname and print it (with supplied message) */ acpi_ns_print_node_pathname(handle, msg); acpi_os_printf("\n"); return_VOID; }
/******************************************************************************* * * FUNCTION: acpi_ut_ptr_exit * * PARAMETERS: line_number - Caller's line number * function_name - Caller's procedure name * module_name - Caller's module name * component_id - Caller's component ID * ptr - Pointer to display * * RETURN: None * * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is * set in debug_level. Prints exit value also. * ******************************************************************************/ void acpi_ut_ptr_exit(u32 line_number, const char *function_name, const char *module_name, u32 component_id, u8 *ptr) { /* Check if enabled up-front for performance */ if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { acpi_debug_print(ACPI_LV_FUNCTIONS, line_number, function_name, module_name, component_id, "%s %p\n", acpi_gbl_fn_exit_str, ptr); } if (acpi_gbl_nesting_level) { acpi_gbl_nesting_level--; } }
/******************************************************************************* * * FUNCTION: acpi_debug_print_raw * * PARAMETERS: requested_debug_level - Requested debug print level * line_number - Caller's line number * function_name - Caller's procedure name * module_name - Caller's module name * component_id - Caller's component ID * format - Printf format field * ... - Optional printf arguments * * RETURN: None * * DESCRIPTION: Print message with no headers. Has same interface as * debug_print so that the same macros can be used. * ******************************************************************************/ void ACPI_INTERNAL_VAR_XFACE acpi_debug_print_raw(u32 requested_debug_level, u32 line_number, const char *function_name, const char *module_name, u32 component_id, const char *format, ...) { va_list args; /* Check if debug output enabled */ if (!ACPI_IS_DEBUG_ENABLED(requested_debug_level, component_id)) { return; } va_start(args, format); acpi_os_vprintf(format, args); va_end(args); }
void AcpiUtExit ( UINT32 LineNumber, const char *FunctionName, const char *ModuleName, UINT32 ComponentId) { /* Check if enabled up-front for performance */ if (ACPI_IS_DEBUG_ENABLED (ACPI_LV_FUNCTIONS, ComponentId)) { AcpiDebugPrint (ACPI_LV_FUNCTIONS, LineNumber, FunctionName, ModuleName, ComponentId, "%s\n", AcpiGbl_FnExitStr); } AcpiGbl_NestingLevel--; }
/******************************************************************************* * * FUNCTION: acpi_ut_value_exit * * PARAMETERS: line_number - Caller's line number * function_name - Caller's procedure name * module_name - Caller's module name * component_id - Caller's component ID * value - Value to be printed with exit msg * * RETURN: None * * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is * set in debug_level. Prints exit value also. * ******************************************************************************/ void acpi_ut_value_exit(u32 line_number, const char *function_name, const char *module_name, u32 component_id, u64 value) { /* Check if enabled up-front for performance */ if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { acpi_debug_print(ACPI_LV_FUNCTIONS, line_number, function_name, module_name, component_id, "%s %8.8X%8.8X\n", acpi_gbl_fn_exit_str, ACPI_FORMAT_UINT64(value)); } if (acpi_gbl_nesting_level) { acpi_gbl_nesting_level--; } }
void AcpiUtTrace ( UINT32 LineNumber, const char *FunctionName, const char *ModuleName, UINT32 ComponentId) { AcpiGbl_NestingLevel++; AcpiUtTrackStackPtr (); /* Check if enabled up-front for performance */ if (ACPI_IS_DEBUG_ENABLED (ACPI_LV_FUNCTIONS, ComponentId)) { AcpiDebugPrint (ACPI_LV_FUNCTIONS, LineNumber, FunctionName, ModuleName, ComponentId, "%s\n", AcpiGbl_FunctionEntryPrefix); } }
void AcpiNsPrintPathname ( UINT32 NumSegments, const char *Pathname) { UINT32 i; ACPI_FUNCTION_NAME (NsPrintPathname); /* Check if debug output enabled */ if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_NAMES, ACPI_NAMESPACE)) { return; } /* Print the entire name */ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "[")); while (NumSegments) { for (i = 0; i < 4; i++) { isprint ((int) Pathname[i]) ? AcpiOsPrintf ("%c", Pathname[i]) : AcpiOsPrintf ("?"); } Pathname += ACPI_NAME_SIZE; NumSegments--; if (NumSegments) { AcpiOsPrintf ("."); } } AcpiOsPrintf ("]\n"); }
void AcpiUtValueExit ( UINT32 LineNumber, const char *FunctionName, const char *ModuleName, UINT32 ComponentId, UINT64 Value) { /* Check if enabled up-front for performance */ if (ACPI_IS_DEBUG_ENABLED (ACPI_LV_FUNCTIONS, ComponentId)) { AcpiDebugPrint (ACPI_LV_FUNCTIONS, LineNumber, FunctionName, ModuleName, ComponentId, "%s %8.8X%8.8X\n", AcpiGbl_FnExitStr, ACPI_FORMAT_UINT64 (Value)); } if (AcpiGbl_NestingLevel) { AcpiGbl_NestingLevel--; } }
void ACPI_INTERNAL_VAR_XFACE AcpiDebugPrintRaw ( UINT32 RequestedDebugLevel, UINT32 LineNumber, const char *FunctionName, const char *ModuleName, UINT32 ComponentId, const char *Format, ...) { va_list args; /* Check if debug output enabled */ if (!ACPI_IS_DEBUG_ENABLED (RequestedDebugLevel, ComponentId)) { return; } va_start (args, Format); AcpiOsVprintf (Format, args); va_end (args); }
void AcpiNsDumpPathname ( ACPI_HANDLE Handle, const char *Msg, UINT32 Level, UINT32 Component) { ACPI_FUNCTION_TRACE (NsDumpPathname); /* Do this only if the requested debug level and component are enabled */ if (!ACPI_IS_DEBUG_ENABLED (Level, Component)) { return_VOID; } /* Convert handle to a full pathname and print it (with supplied message) */ AcpiNsPrintNodePathname (Handle, Msg); AcpiOsPrintf ("\n"); return_VOID; }
void ACPI_INTERNAL_VAR_XFACE AcpiDebugPrint ( UINT32 RequestedDebugLevel, UINT32 LineNumber, const char *FunctionName, const char *ModuleName, UINT32 ComponentId, const char *Format, ...) { ACPI_THREAD_ID ThreadId; va_list args; /* Check if debug output enabled */ if (!ACPI_IS_DEBUG_ENABLED (RequestedDebugLevel, ComponentId)) { return; } /* * Thread tracking and context switch notification */ ThreadId = AcpiOsGetThreadId (); if (ThreadId != AcpiGbl_PrevThreadId) { if (ACPI_LV_THREADS & AcpiDbgLevel) { AcpiOsPrintf ( "\n**** Context Switch from TID %u to TID %u ****\n\n", (UINT32) AcpiGbl_PrevThreadId, (UINT32) ThreadId); } AcpiGbl_PrevThreadId = ThreadId; AcpiGbl_NestingLevel = 0; } /* * Display the module name, current line number, thread ID (if requested), * current procedure nesting level, and the current procedure name */ AcpiOsPrintf ("%9s-%04ld ", ModuleName, LineNumber); #ifdef ACPI_APPLICATION /* * For AcpiExec/iASL only, emit the thread ID and nesting level. * Note: nesting level is really only useful during a single-thread * execution. Otherwise, multiple threads will keep resetting the * level. */ if (ACPI_LV_THREADS & AcpiDbgLevel) { AcpiOsPrintf ("[%u] ", (UINT32) ThreadId); } AcpiOsPrintf ("[%02ld] ", AcpiGbl_NestingLevel); #endif AcpiOsPrintf ("%-22.22s: ", AcpiUtTrimFunctionName (FunctionName)); va_start (args, Format); AcpiOsVprintf (Format, args); va_end (args); }
void AcpiRsDumpResourceList ( ACPI_RESOURCE *ResourceList) { UINT32 Count = 0; UINT32 Type; ACPI_FUNCTION_ENTRY (); /* Check if debug output enabled */ if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_RESOURCES, _COMPONENT)) { return; } /* Walk list and dump all resource descriptors (END_TAG terminates) */ do { AcpiOsPrintf ("\n[%02X] ", Count); Count++; /* Validate Type before dispatch */ Type = ResourceList->Type; if (Type > ACPI_RESOURCE_TYPE_MAX) { AcpiOsPrintf ( "Invalid descriptor type (%X) in resource list\n", ResourceList->Type); return; } /* Sanity check the length. It must not be zero, or we loop forever */ if (!ResourceList->Length) { AcpiOsPrintf ( "Invalid zero length descriptor in resource list\n"); return; } /* Dump the resource descriptor */ if (Type == ACPI_RESOURCE_TYPE_SERIAL_BUS) { AcpiRsDumpDescriptor (&ResourceList->Data, AcpiGbl_DumpSerialBusDispatch[ ResourceList->Data.CommonSerialBus.Type]); } else { AcpiRsDumpDescriptor (&ResourceList->Data, AcpiGbl_DumpResourceDispatch[Type]); } /* Point to the next resource structure */ ResourceList = ACPI_NEXT_RESOURCE (ResourceList); /* Exit when END_TAG descriptor is reached */ } while (Type != ACPI_RESOURCE_TYPE_END_TAG); }