linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / acpi / utilities / utdebug.c
index bb1eaf9..35f3d58 100644 (file)
  * POSSIBILITY OF SUCH DAMAGES.
  */
 
+#include <linux/module.h>
+
 #include <acpi/acpi.h>
 
 #define _COMPONENT          ACPI_UTILITIES
 ACPI_MODULE_NAME("utdebug")
 
 #ifdef ACPI_DEBUG_OUTPUT
-static acpi_thread_id acpi_gbl_prev_thread_id;
+static u32 acpi_gbl_prev_thread_id = 0xFFFFFFFF;
 static char *acpi_gbl_fn_entry_str = "----Entry";
 static char *acpi_gbl_fn_exit_str = "----Exit-";
 
@@ -121,14 +123,12 @@ static const char *acpi_ut_trim_function_name(const char *function_name)
        /* All Function names are longer than 4 chars, check is safe */
 
        if (*(ACPI_CAST_PTR(u32, function_name)) == ACPI_PREFIX_MIXED) {
-
                /* This is the case where the original source has not been modified */
 
                return (function_name + 4);
        }
 
        if (*(ACPI_CAST_PTR(u32, function_name)) == ACPI_PREFIX_LOWER) {
-
                /* This is the case where the source has been 'linuxized' */
 
                return (function_name + 5);
@@ -162,7 +162,7 @@ acpi_ut_debug_print(u32 requested_debug_level,
                    const char *function_name,
                    char *module_name, u32 component_id, char *format, ...)
 {
-       acpi_thread_id thread_id;
+       u32 thread_id;
        va_list args;
 
        /*
@@ -177,11 +177,12 @@ acpi_ut_debug_print(u32 requested_debug_level,
         * 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 %X to TID %X ****\n\n",
-                            (u32) acpi_gbl_prev_thread_id, (u32) thread_id);
+                            acpi_gbl_prev_thread_id, thread_id);
                }
 
                acpi_gbl_prev_thread_id = thread_id;
@@ -205,7 +206,7 @@ acpi_ut_debug_print(u32 requested_debug_level,
        acpi_os_vprintf(format, args);
 }
 
-ACPI_EXPORT_SYMBOL(acpi_ut_debug_print)
+EXPORT_SYMBOL(acpi_ut_debug_print);
 
 /*******************************************************************************
  *
@@ -225,6 +226,7 @@ ACPI_EXPORT_SYMBOL(acpi_ut_debug_print)
  *              debug_print so that the same macros can be used.
  *
  ******************************************************************************/
+
 void ACPI_INTERNAL_VAR_XFACE
 acpi_ut_debug_print_raw(u32 requested_debug_level,
                        u32 line_number,
@@ -242,7 +244,7 @@ acpi_ut_debug_print_raw(u32 requested_debug_level,
        acpi_os_vprintf(format, args);
 }
 
-ACPI_EXPORT_SYMBOL(acpi_ut_debug_print_raw)
+EXPORT_SYMBOL(acpi_ut_debug_print_raw);
 
 /*******************************************************************************
  *
@@ -259,6 +261,7 @@ ACPI_EXPORT_SYMBOL(acpi_ut_debug_print_raw)
  *              set in debug_level
  *
  ******************************************************************************/
+
 void
 acpi_ut_trace(u32 line_number,
              const char *function_name, char *module_name, u32 component_id)
@@ -272,7 +275,7 @@ acpi_ut_trace(u32 line_number,
                            component_id, "%s\n", acpi_gbl_fn_entry_str);
 }
 
-ACPI_EXPORT_SYMBOL(acpi_ut_trace)
+EXPORT_SYMBOL(acpi_ut_trace);
 
 /*******************************************************************************
  *
@@ -290,6 +293,7 @@ ACPI_EXPORT_SYMBOL(acpi_ut_trace)
  *              set in debug_level
  *
  ******************************************************************************/
+
 void
 acpi_ut_trace_ptr(u32 line_number,
                  const char *function_name,
@@ -396,7 +400,7 @@ acpi_ut_exit(u32 line_number,
        acpi_gbl_nesting_level--;
 }
 
-ACPI_EXPORT_SYMBOL(acpi_ut_exit)
+EXPORT_SYMBOL(acpi_ut_exit);
 
 /*******************************************************************************
  *
@@ -414,6 +418,7 @@ ACPI_EXPORT_SYMBOL(acpi_ut_exit)
  *              set in debug_level. Prints exit status also.
  *
  ******************************************************************************/
+
 void
 acpi_ut_status_exit(u32 line_number,
                    const char *function_name,
@@ -437,7 +442,7 @@ acpi_ut_status_exit(u32 line_number,
        acpi_gbl_nesting_level--;
 }
 
-ACPI_EXPORT_SYMBOL(acpi_ut_status_exit)
+EXPORT_SYMBOL(acpi_ut_status_exit);
 
 /*******************************************************************************
  *
@@ -455,6 +460,7 @@ ACPI_EXPORT_SYMBOL(acpi_ut_status_exit)
  *              set in debug_level. Prints exit value also.
  *
  ******************************************************************************/
+
 void
 acpi_ut_value_exit(u32 line_number,
                   const char *function_name,
@@ -469,7 +475,7 @@ acpi_ut_value_exit(u32 line_number,
        acpi_gbl_nesting_level--;
 }
 
-ACPI_EXPORT_SYMBOL(acpi_ut_value_exit)
+EXPORT_SYMBOL(acpi_ut_value_exit);
 
 /*******************************************************************************
  *
@@ -487,6 +493,7 @@ ACPI_EXPORT_SYMBOL(acpi_ut_value_exit)
  *              set in debug_level. Prints exit value also.
  *
  ******************************************************************************/
+
 void
 acpi_ut_ptr_exit(u32 line_number,
                 const char *function_name,
@@ -517,13 +524,20 @@ acpi_ut_ptr_exit(u32 line_number,
  *
  ******************************************************************************/
 
-void acpi_ut_dump_buffer2(u8 * buffer, u32 count, u32 display)
+void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id)
 {
        acpi_native_uint i = 0;
        acpi_native_uint j;
        u32 temp32;
        u8 buf_char;
 
+       /* Only dump the buffer if tracing is enabled */
+
+       if (!((ACPI_LV_TABLES & acpi_dbg_level) &&
+             (component_id & acpi_dbg_layer))) {
+               return;
+       }
+
        if ((count < 4) || (count & 0x01)) {
                display = DB_BYTE_DISPLAY;
        }
@@ -531,7 +545,6 @@ void acpi_ut_dump_buffer2(u8 * buffer, u32 count, u32 display)
        /* Nasty little dump buffer routine! */
 
        while (i < count) {
-
                /* Print current offset */
 
                acpi_os_printf("%6.4X: ", (u32) i);
@@ -540,7 +553,6 @@ void acpi_ut_dump_buffer2(u8 * buffer, u32 count, u32 display)
 
                for (j = 0; j < 16;) {
                        if (i + j >= count) {
-
                                /* Dump fill spaces */
 
                                acpi_os_printf("%*s", ((display * 2) + 1), " ");
@@ -549,7 +561,6 @@ void acpi_ut_dump_buffer2(u8 * buffer, u32 count, u32 display)
                        }
 
                        switch (display) {
-                       case DB_BYTE_DISPLAY:
                        default:        /* Default is BYTE display */
 
                                acpi_os_printf("%02X ", buffer[i + j]);
@@ -607,31 +618,3 @@ void acpi_ut_dump_buffer2(u8 * buffer, u32 count, u32 display)
 
        return;
 }
-
-/*******************************************************************************
- *
- * FUNCTION:    acpi_ut_dump_buffer
- *
- * PARAMETERS:  Buffer              - Buffer to dump
- *              Count               - Amount to dump, in bytes
- *              Display             - BYTE, WORD, DWORD, or QWORD display
- *              component_iD        - Caller's component ID
- *
- * RETURN:      None
- *
- * DESCRIPTION: Generic dump buffer in both hex and ascii.
- *
- ******************************************************************************/
-
-void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id)
-{
-
-       /* Only dump the buffer if tracing is enabled */
-
-       if (!((ACPI_LV_TABLES & acpi_dbg_level) &&
-             (component_id & acpi_dbg_layer))) {
-               return;
-       }
-
-       acpi_ut_dump_buffer2(buffer, count, display);
-}