fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / acpi / utilities / utdebug.c
index 35f3d58..9e9054e 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 u32 acpi_gbl_prev_thread_id = 0xFFFFFFFF;
+static acpi_thread_id acpi_gbl_prev_thread_id;
 static char *acpi_gbl_fn_entry_str = "----Entry";
 static char *acpi_gbl_fn_exit_str = "----Exit-";
 
@@ -123,12 +121,14 @@ 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, ...)
 {
-       u32 thread_id;
+       acpi_thread_id thread_id;
        va_list args;
 
        /*
@@ -177,12 +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",
-                            acpi_gbl_prev_thread_id, thread_id);
+                           ("\n**** Context Switch from TID %lX to TID %lX ****\n\n",
+                            (unsigned long) acpi_gbl_prev_thread_id,
+                            (unsigned long) thread_id);
                }
 
                acpi_gbl_prev_thread_id = thread_id;
@@ -206,7 +206,7 @@ acpi_ut_debug_print(u32 requested_debug_level,
        acpi_os_vprintf(format, args);
 }
 
-EXPORT_SYMBOL(acpi_ut_debug_print);
+ACPI_EXPORT_SYMBOL(acpi_ut_debug_print)
 
 /*******************************************************************************
  *
@@ -226,7 +226,6 @@ 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,
@@ -244,7 +243,7 @@ acpi_ut_debug_print_raw(u32 requested_debug_level,
        acpi_os_vprintf(format, args);
 }
 
-EXPORT_SYMBOL(acpi_ut_debug_print_raw);
+ACPI_EXPORT_SYMBOL(acpi_ut_debug_print_raw)
 
 /*******************************************************************************
  *
@@ -261,7 +260,6 @@ 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)
@@ -275,7 +273,7 @@ acpi_ut_trace(u32 line_number,
                            component_id, "%s\n", acpi_gbl_fn_entry_str);
 }
 
-EXPORT_SYMBOL(acpi_ut_trace);
+ACPI_EXPORT_SYMBOL(acpi_ut_trace)
 
 /*******************************************************************************
  *
@@ -293,7 +291,6 @@ EXPORT_SYMBOL(acpi_ut_trace);
  *              set in debug_level
  *
  ******************************************************************************/
-
 void
 acpi_ut_trace_ptr(u32 line_number,
                  const char *function_name,
@@ -400,7 +397,7 @@ acpi_ut_exit(u32 line_number,
        acpi_gbl_nesting_level--;
 }
 
-EXPORT_SYMBOL(acpi_ut_exit);
+ACPI_EXPORT_SYMBOL(acpi_ut_exit)
 
 /*******************************************************************************
  *
@@ -418,7 +415,6 @@ 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,
@@ -442,7 +438,7 @@ acpi_ut_status_exit(u32 line_number,
        acpi_gbl_nesting_level--;
 }
 
-EXPORT_SYMBOL(acpi_ut_status_exit);
+ACPI_EXPORT_SYMBOL(acpi_ut_status_exit)
 
 /*******************************************************************************
  *
@@ -460,7 +456,6 @@ 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,
@@ -475,7 +470,7 @@ acpi_ut_value_exit(u32 line_number,
        acpi_gbl_nesting_level--;
 }
 
-EXPORT_SYMBOL(acpi_ut_value_exit);
+ACPI_EXPORT_SYMBOL(acpi_ut_value_exit)
 
 /*******************************************************************************
  *
@@ -493,7 +488,6 @@ 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,
@@ -524,20 +518,13 @@ acpi_ut_ptr_exit(u32 line_number,
  *
  ******************************************************************************/
 
-void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id)
+void acpi_ut_dump_buffer2(u8 * buffer, u32 count, u32 display)
 {
        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;
        }
@@ -545,6 +532,7 @@ void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id)
        /* Nasty little dump buffer routine! */
 
        while (i < count) {
+
                /* Print current offset */
 
                acpi_os_printf("%6.4X: ", (u32) i);
@@ -553,6 +541,7 @@ void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id)
 
                for (j = 0; j < 16;) {
                        if (i + j >= count) {
+
                                /* Dump fill spaces */
 
                                acpi_os_printf("%*s", ((display * 2) + 1), " ");
@@ -561,6 +550,7 @@ void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id)
                        }
 
                        switch (display) {
+                       case DB_BYTE_DISPLAY:
                        default:        /* Default is BYTE display */
 
                                acpi_os_printf("%02X ", buffer[i + j]);
@@ -618,3 +608,31 @@ void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id)
 
        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);
+}