utmisc.c (104470) | utmisc.c (107325) |
---|---|
1/******************************************************************************* 2 * 3 * Module Name: utmisc - common utility procedures | 1/******************************************************************************* 2 * 3 * Module Name: utmisc - common utility procedures |
4 * $Revision: 84 $ | 4 * $Revision: 86 $ |
5 * 6 ******************************************************************************/ 7 8/****************************************************************************** 9 * 10 * 1. Copyright Notice 11 * 12 * Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp. --- 109 unchanged lines hidden (view full) --- 122 123 124#define _COMPONENT ACPI_UTILITIES 125 ACPI_MODULE_NAME ("utmisc") 126 127 128/******************************************************************************* 129 * | 5 * 6 ******************************************************************************/ 7 8/****************************************************************************** 9 * 10 * 1. Copyright Notice 11 * 12 * Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp. --- 109 unchanged lines hidden (view full) --- 122 123 124#define _COMPONENT ACPI_UTILITIES 125 ACPI_MODULE_NAME ("utmisc") 126 127 128/******************************************************************************* 129 * |
130 * FUNCTION: AcpiUtPrintString 131 * 132 * PARAMETERS: String - Null terminated ASCII string 133 * 134 * RETURN: None 135 * 136 * DESCRIPTION: Dump an ASCII string with support for ACPI-defined escape 137 * sequences. 138 * 139 ******************************************************************************/ 140 141void 142AcpiUtPrintString ( 143 char *String, 144 UINT8 MaxLength) 145{ 146 UINT32 i; 147 148 149 if (!String) 150 { 151 AcpiOsPrintf ("<\"NULL STRING PTR\">"); 152 return; 153 } 154 155 AcpiOsPrintf ("\""); 156 for (i = 0; String[i] && (i < MaxLength); i++) 157 { 158 /* Escape sequences */ 159 160 switch (String[i]) 161 { 162 case 0x07: 163 AcpiOsPrintf ("\\a"); /* BELL */ 164 break; 165 166 case 0x08: 167 AcpiOsPrintf ("\\b"); /* BACKSPACE */ 168 break; 169 170 case 0x0C: 171 AcpiOsPrintf ("\\f"); /* FORMFEED */ 172 break; 173 174 case 0x0A: 175 AcpiOsPrintf ("\\n"); /* LINEFEED */ 176 break; 177 178 case 0x0D: 179 AcpiOsPrintf ("\\r"); /* CARRIAGE RETURN*/ 180 break; 181 182 case 0x09: 183 AcpiOsPrintf ("\\t"); /* HORIZONTAL TAB */ 184 break; 185 186 case 0x0B: 187 AcpiOsPrintf ("\\v"); /* VERTICAL TAB */ 188 break; 189 190 case '\'': /* Single Quote */ 191 case '\"': /* Double Quote */ 192 case '\\': /* Backslash */ 193 AcpiOsPrintf ("\\%c", (int) String[i]); 194 break; 195 196 default: 197 198 /* Check for printable character or hex escape */ 199 200 if (ACPI_IS_PRINT (String[i])) 201 { 202 /* This is a normal character */ 203 204 AcpiOsPrintf ("%c", (int) String[i]); 205 } 206 else 207 { 208 /* All others will be Hex escapes */ 209 210 AcpiOsPrintf ("\\x%2.2X", (INT32) String[i]); 211 } 212 break; 213 } 214 } 215 AcpiOsPrintf ("\""); 216 217 if (i == MaxLength && String[i]) 218 { 219 AcpiOsPrintf ("..."); 220 } 221} 222 223 224/******************************************************************************* 225 * |
|
130 * FUNCTION: AcpiUtDwordByteSwap 131 * 132 * PARAMETERS: Value - Value to be converted 133 * 134 * DESCRIPTION: Convert a 32-bit value to big-endian (swap the bytes) 135 * 136 ******************************************************************************/ 137 --- 580 unchanged lines hidden (view full) --- 718 } 719 720 721 ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, 722 "Thread %X attempting to acquire Mutex [%s]\n", 723 ThisThreadId, AcpiUtGetMutexName (MutexId))); 724 725 Status = AcpiOsWaitSemaphore (AcpiGbl_AcpiMutexInfo[MutexId].Mutex, | 226 * FUNCTION: AcpiUtDwordByteSwap 227 * 228 * PARAMETERS: Value - Value to be converted 229 * 230 * DESCRIPTION: Convert a 32-bit value to big-endian (swap the bytes) 231 * 232 ******************************************************************************/ 233 --- 580 unchanged lines hidden (view full) --- 814 } 815 816 817 ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, 818 "Thread %X attempting to acquire Mutex [%s]\n", 819 ThisThreadId, AcpiUtGetMutexName (MutexId))); 820 821 Status = AcpiOsWaitSemaphore (AcpiGbl_AcpiMutexInfo[MutexId].Mutex, |
726 1, WAIT_FOREVER); | 822 1, ACPI_WAIT_FOREVER); |
727 if (ACPI_SUCCESS (Status)) 728 { 729 ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Thread %X acquired Mutex [%s]\n", 730 ThisThreadId, AcpiUtGetMutexName (MutexId))); 731 732 AcpiGbl_AcpiMutexInfo[MutexId].UseCount++; 733 AcpiGbl_AcpiMutexInfo[MutexId].OwnerId = ThisThreadId; 734 } --- 803 unchanged lines hidden --- | 823 if (ACPI_SUCCESS (Status)) 824 { 825 ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Thread %X acquired Mutex [%s]\n", 826 ThisThreadId, AcpiUtGetMutexName (MutexId))); 827 828 AcpiGbl_AcpiMutexInfo[MutexId].UseCount++; 829 AcpiGbl_AcpiMutexInfo[MutexId].OwnerId = ThisThreadId; 830 } --- 803 unchanged lines hidden --- |