utmisc.c 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856
  1. /*******************************************************************************
  2. *
  3. * Module Name: utmisc - common utility procedures
  4. *
  5. ******************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2005, R. Byron Moore
  8. * All rights reserved.
  9. *
  10. * Redistribution and use in source and binary forms, with or without
  11. * modification, are permitted provided that the following conditions
  12. * are met:
  13. * 1. Redistributions of source code must retain the above copyright
  14. * notice, this list of conditions, and the following disclaimer,
  15. * without modification.
  16. * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  17. * substantially similar to the "NO WARRANTY" disclaimer below
  18. * ("Disclaimer") and any redistribution must be conditioned upon
  19. * including a substantially similar Disclaimer requirement for further
  20. * binary redistribution.
  21. * 3. Neither the names of the above-listed copyright holders nor the names
  22. * of any contributors may be used to endorse or promote products derived
  23. * from this software without specific prior written permission.
  24. *
  25. * Alternatively, this software may be distributed under the terms of the
  26. * GNU General Public License ("GPL") version 2 as published by the Free
  27. * Software Foundation.
  28. *
  29. * NO WARRANTY
  30. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  31. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  32. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
  33. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  34. * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  35. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  36. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  37. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  38. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  39. * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  40. * POSSIBILITY OF SUCH DAMAGES.
  41. */
  42. #include <acpi/acpi.h>
  43. #include <acpi/acnamesp.h>
  44. #define _COMPONENT ACPI_UTILITIES
  45. ACPI_MODULE_NAME ("utmisc")
  46. /*******************************************************************************
  47. *
  48. * FUNCTION: acpi_ut_strupr (strupr)
  49. *
  50. * PARAMETERS: src_string - The source string to convert
  51. *
  52. * RETURN: Converted src_string (same as input pointer)
  53. *
  54. * DESCRIPTION: Convert string to uppercase
  55. *
  56. * NOTE: This is not a POSIX function, so it appears here, not in utclib.c
  57. *
  58. ******************************************************************************/
  59. char *
  60. acpi_ut_strupr (
  61. char *src_string)
  62. {
  63. char *string;
  64. ACPI_FUNCTION_ENTRY ();
  65. if (!src_string) {
  66. return (NULL);
  67. }
  68. /* Walk entire string, uppercasing the letters */
  69. for (string = src_string; *string; string++) {
  70. *string = (char) ACPI_TOUPPER (*string);
  71. }
  72. return (src_string);
  73. }
  74. /*******************************************************************************
  75. *
  76. * FUNCTION: acpi_ut_print_string
  77. *
  78. * PARAMETERS: String - Null terminated ASCII string
  79. * max_length - Maximum output length
  80. *
  81. * RETURN: None
  82. *
  83. * DESCRIPTION: Dump an ASCII string with support for ACPI-defined escape
  84. * sequences.
  85. *
  86. ******************************************************************************/
  87. void
  88. acpi_ut_print_string (
  89. char *string,
  90. u8 max_length)
  91. {
  92. u32 i;
  93. if (!string) {
  94. acpi_os_printf ("<\"NULL STRING PTR\">");
  95. return;
  96. }
  97. acpi_os_printf ("\"");
  98. for (i = 0; string[i] && (i < max_length); i++) {
  99. /* Escape sequences */
  100. switch (string[i]) {
  101. case 0x07:
  102. acpi_os_printf ("\\a"); /* BELL */
  103. break;
  104. case 0x08:
  105. acpi_os_printf ("\\b"); /* BACKSPACE */
  106. break;
  107. case 0x0C:
  108. acpi_os_printf ("\\f"); /* FORMFEED */
  109. break;
  110. case 0x0A:
  111. acpi_os_printf ("\\n"); /* LINEFEED */
  112. break;
  113. case 0x0D:
  114. acpi_os_printf ("\\r"); /* CARRIAGE RETURN*/
  115. break;
  116. case 0x09:
  117. acpi_os_printf ("\\t"); /* HORIZONTAL TAB */
  118. break;
  119. case 0x0B:
  120. acpi_os_printf ("\\v"); /* VERTICAL TAB */
  121. break;
  122. case '\'': /* Single Quote */
  123. case '\"': /* Double Quote */
  124. case '\\': /* Backslash */
  125. acpi_os_printf ("\\%c", (int) string[i]);
  126. break;
  127. default:
  128. /* Check for printable character or hex escape */
  129. if (ACPI_IS_PRINT (string[i]))
  130. {
  131. /* This is a normal character */
  132. acpi_os_printf ("%c", (int) string[i]);
  133. }
  134. else
  135. {
  136. /* All others will be Hex escapes */
  137. acpi_os_printf ("\\x%2.2X", (s32) string[i]);
  138. }
  139. break;
  140. }
  141. }
  142. acpi_os_printf ("\"");
  143. if (i == max_length && string[i]) {
  144. acpi_os_printf ("...");
  145. }
  146. }
  147. /*******************************************************************************
  148. *
  149. * FUNCTION: acpi_ut_dword_byte_swap
  150. *
  151. * PARAMETERS: Value - Value to be converted
  152. *
  153. * RETURN: u32 integer with bytes swapped
  154. *
  155. * DESCRIPTION: Convert a 32-bit value to big-endian (swap the bytes)
  156. *
  157. ******************************************************************************/
  158. u32
  159. acpi_ut_dword_byte_swap (
  160. u32 value)
  161. {
  162. union {
  163. u32 value;
  164. u8 bytes[4];
  165. } out;
  166. union {
  167. u32 value;
  168. u8 bytes[4];
  169. } in;
  170. ACPI_FUNCTION_ENTRY ();
  171. in.value = value;
  172. out.bytes[0] = in.bytes[3];
  173. out.bytes[1] = in.bytes[2];
  174. out.bytes[2] = in.bytes[1];
  175. out.bytes[3] = in.bytes[0];
  176. return (out.value);
  177. }
  178. /*******************************************************************************
  179. *
  180. * FUNCTION: acpi_ut_set_integer_width
  181. *
  182. * PARAMETERS: Revision From DSDT header
  183. *
  184. * RETURN: None
  185. *
  186. * DESCRIPTION: Set the global integer bit width based upon the revision
  187. * of the DSDT. For Revision 1 and 0, Integers are 32 bits.
  188. * For Revision 2 and above, Integers are 64 bits. Yes, this
  189. * makes a difference.
  190. *
  191. ******************************************************************************/
  192. void
  193. acpi_ut_set_integer_width (
  194. u8 revision)
  195. {
  196. if (revision <= 1) {
  197. acpi_gbl_integer_bit_width = 32;
  198. acpi_gbl_integer_nybble_width = 8;
  199. acpi_gbl_integer_byte_width = 4;
  200. }
  201. else {
  202. acpi_gbl_integer_bit_width = 64;
  203. acpi_gbl_integer_nybble_width = 16;
  204. acpi_gbl_integer_byte_width = 8;
  205. }
  206. }
  207. #ifdef ACPI_DEBUG_OUTPUT
  208. /*******************************************************************************
  209. *
  210. * FUNCTION: acpi_ut_display_init_pathname
  211. *
  212. * PARAMETERS: Type - Object type of the node
  213. * obj_handle - Handle whose pathname will be displayed
  214. * Path - Additional path string to be appended.
  215. * (NULL if no extra path)
  216. *
  217. * RETURN: acpi_status
  218. *
  219. * DESCRIPTION: Display full pathname of an object, DEBUG ONLY
  220. *
  221. ******************************************************************************/
  222. void
  223. acpi_ut_display_init_pathname (
  224. u8 type,
  225. struct acpi_namespace_node *obj_handle,
  226. char *path)
  227. {
  228. acpi_status status;
  229. struct acpi_buffer buffer;
  230. ACPI_FUNCTION_ENTRY ();
  231. /* Only print the path if the appropriate debug level is enabled */
  232. if (!(acpi_dbg_level & ACPI_LV_INIT_NAMES)) {
  233. return;
  234. }
  235. /* Get the full pathname to the node */
  236. buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER;
  237. status = acpi_ns_handle_to_pathname (obj_handle, &buffer);
  238. if (ACPI_FAILURE (status)) {
  239. return;
  240. }
  241. /* Print what we're doing */
  242. switch (type) {
  243. case ACPI_TYPE_METHOD:
  244. acpi_os_printf ("Executing ");
  245. break;
  246. default:
  247. acpi_os_printf ("Initializing ");
  248. break;
  249. }
  250. /* Print the object type and pathname */
  251. acpi_os_printf ("%-12s %s",
  252. acpi_ut_get_type_name (type), (char *) buffer.pointer);
  253. /* Extra path is used to append names like _STA, _INI, etc. */
  254. if (path) {
  255. acpi_os_printf (".%s", path);
  256. }
  257. acpi_os_printf ("\n");
  258. ACPI_MEM_FREE (buffer.pointer);
  259. }
  260. #endif
  261. /*******************************************************************************
  262. *
  263. * FUNCTION: acpi_ut_valid_acpi_name
  264. *
  265. * PARAMETERS: Name - The name to be examined
  266. *
  267. * RETURN: TRUE if the name is valid, FALSE otherwise
  268. *
  269. * DESCRIPTION: Check for a valid ACPI name. Each character must be one of:
  270. * 1) Upper case alpha
  271. * 2) numeric
  272. * 3) underscore
  273. *
  274. ******************************************************************************/
  275. u8
  276. acpi_ut_valid_acpi_name (
  277. u32 name)
  278. {
  279. char *name_ptr = (char *) &name;
  280. char character;
  281. acpi_native_uint i;
  282. ACPI_FUNCTION_ENTRY ();
  283. for (i = 0; i < ACPI_NAME_SIZE; i++) {
  284. character = *name_ptr;
  285. name_ptr++;
  286. if (!((character == '_') ||
  287. (character >= 'A' && character <= 'Z') ||
  288. (character >= '0' && character <= '9'))) {
  289. return (FALSE);
  290. }
  291. }
  292. return (TRUE);
  293. }
  294. /*******************************************************************************
  295. *
  296. * FUNCTION: acpi_ut_valid_acpi_character
  297. *
  298. * PARAMETERS: Character - The character to be examined
  299. *
  300. * RETURN: 1 if Character may appear in a name, else 0
  301. *
  302. * DESCRIPTION: Check for a printable character
  303. *
  304. ******************************************************************************/
  305. u8
  306. acpi_ut_valid_acpi_character (
  307. char character)
  308. {
  309. ACPI_FUNCTION_ENTRY ();
  310. return ((u8) ((character == '_') ||
  311. (character >= 'A' && character <= 'Z') ||
  312. (character >= '0' && character <= '9')));
  313. }
  314. /*******************************************************************************
  315. *
  316. * FUNCTION: acpi_ut_strtoul64
  317. *
  318. * PARAMETERS: String - Null terminated string
  319. * Base - Radix of the string: 10, 16, or ACPI_ANY_BASE
  320. * ret_integer - Where the converted integer is returned
  321. *
  322. * RETURN: Status and Converted value
  323. *
  324. * DESCRIPTION: Convert a string into an unsigned value.
  325. * NOTE: Does not support Octal strings, not needed.
  326. *
  327. ******************************************************************************/
  328. acpi_status
  329. acpi_ut_strtoul64 (
  330. char *string,
  331. u32 base,
  332. acpi_integer *ret_integer)
  333. {
  334. u32 this_digit = 0;
  335. acpi_integer return_value = 0;
  336. acpi_integer quotient;
  337. ACPI_FUNCTION_TRACE ("ut_stroul64");
  338. if ((!string) || !(*string)) {
  339. goto error_exit;
  340. }
  341. switch (base) {
  342. case ACPI_ANY_BASE:
  343. case 10:
  344. case 16:
  345. break;
  346. default:
  347. /* Invalid Base */
  348. return_ACPI_STATUS (AE_BAD_PARAMETER);
  349. }
  350. /* Skip over any white space in the buffer */
  351. while (ACPI_IS_SPACE (*string) || *string == '\t') {
  352. string++;
  353. }
  354. /*
  355. * If the input parameter Base is zero, then we need to
  356. * determine if it is decimal or hexadecimal:
  357. */
  358. if (base == 0) {
  359. if ((*string == '0') &&
  360. (ACPI_TOLOWER (*(string + 1)) == 'x')) {
  361. base = 16;
  362. string += 2;
  363. }
  364. else {
  365. base = 10;
  366. }
  367. }
  368. /*
  369. * For hexadecimal base, skip over the leading
  370. * 0 or 0x, if they are present.
  371. */
  372. if ((base == 16) &&
  373. (*string == '0') &&
  374. (ACPI_TOLOWER (*(string + 1)) == 'x')) {
  375. string += 2;
  376. }
  377. /* Any string left? */
  378. if (!(*string)) {
  379. goto error_exit;
  380. }
  381. /* Main loop: convert the string to a 64-bit integer */
  382. while (*string) {
  383. if (ACPI_IS_DIGIT (*string)) {
  384. /* Convert ASCII 0-9 to Decimal value */
  385. this_digit = ((u8) *string) - '0';
  386. }
  387. else {
  388. if (base == 10) {
  389. /* Digit is out of range */
  390. goto error_exit;
  391. }
  392. this_digit = (u8) ACPI_TOUPPER (*string);
  393. if (ACPI_IS_XDIGIT ((char) this_digit)) {
  394. /* Convert ASCII Hex char to value */
  395. this_digit = this_digit - 'A' + 10;
  396. }
  397. else {
  398. /*
  399. * We allow non-hex chars, just stop now, same as end-of-string.
  400. * See ACPI spec, string-to-integer conversion.
  401. */
  402. break;
  403. }
  404. }
  405. /* Divide the digit into the correct position */
  406. (void) acpi_ut_short_divide ((ACPI_INTEGER_MAX - (acpi_integer) this_digit),
  407. base, &quotient, NULL);
  408. if (return_value > quotient) {
  409. goto error_exit;
  410. }
  411. return_value *= base;
  412. return_value += this_digit;
  413. string++;
  414. }
  415. /* All done, normal exit */
  416. *ret_integer = return_value;
  417. return_ACPI_STATUS (AE_OK);
  418. error_exit:
  419. /* Base was set/validated above */
  420. if (base == 10) {
  421. return_ACPI_STATUS (AE_BAD_DECIMAL_CONSTANT);
  422. }
  423. else {
  424. return_ACPI_STATUS (AE_BAD_HEX_CONSTANT);
  425. }
  426. }
  427. /*******************************************************************************
  428. *
  429. * FUNCTION: acpi_ut_create_update_state_and_push
  430. *
  431. * PARAMETERS: Object - Object to be added to the new state
  432. * Action - Increment/Decrement
  433. * state_list - List the state will be added to
  434. *
  435. * RETURN: Status
  436. *
  437. * DESCRIPTION: Create a new state and push it
  438. *
  439. ******************************************************************************/
  440. acpi_status
  441. acpi_ut_create_update_state_and_push (
  442. union acpi_operand_object *object,
  443. u16 action,
  444. union acpi_generic_state **state_list)
  445. {
  446. union acpi_generic_state *state;
  447. ACPI_FUNCTION_ENTRY ();
  448. /* Ignore null objects; these are expected */
  449. if (!object) {
  450. return (AE_OK);
  451. }
  452. state = acpi_ut_create_update_state (object, action);
  453. if (!state) {
  454. return (AE_NO_MEMORY);
  455. }
  456. acpi_ut_push_generic_state (state_list, state);
  457. return (AE_OK);
  458. }
  459. /*******************************************************************************
  460. *
  461. * FUNCTION: acpi_ut_walk_package_tree
  462. *
  463. * PARAMETERS: source_object - The package to walk
  464. * target_object - Target object (if package is being copied)
  465. * walk_callback - Called once for each package element
  466. * Context - Passed to the callback function
  467. *
  468. * RETURN: Status
  469. *
  470. * DESCRIPTION: Walk through a package
  471. *
  472. ******************************************************************************/
  473. acpi_status
  474. acpi_ut_walk_package_tree (
  475. union acpi_operand_object *source_object,
  476. void *target_object,
  477. acpi_pkg_callback walk_callback,
  478. void *context)
  479. {
  480. acpi_status status = AE_OK;
  481. union acpi_generic_state *state_list = NULL;
  482. union acpi_generic_state *state;
  483. u32 this_index;
  484. union acpi_operand_object *this_source_obj;
  485. ACPI_FUNCTION_TRACE ("ut_walk_package_tree");
  486. state = acpi_ut_create_pkg_state (source_object, target_object, 0);
  487. if (!state) {
  488. return_ACPI_STATUS (AE_NO_MEMORY);
  489. }
  490. while (state) {
  491. /* Get one element of the package */
  492. this_index = state->pkg.index;
  493. this_source_obj = (union acpi_operand_object *)
  494. state->pkg.source_object->package.elements[this_index];
  495. /*
  496. * Check for:
  497. * 1) An uninitialized package element. It is completely
  498. * legal to declare a package and leave it uninitialized
  499. * 2) Not an internal object - can be a namespace node instead
  500. * 3) Any type other than a package. Packages are handled in else
  501. * case below.
  502. */
  503. if ((!this_source_obj) ||
  504. (ACPI_GET_DESCRIPTOR_TYPE (this_source_obj) != ACPI_DESC_TYPE_OPERAND) ||
  505. (ACPI_GET_OBJECT_TYPE (this_source_obj) != ACPI_TYPE_PACKAGE)) {
  506. status = walk_callback (ACPI_COPY_TYPE_SIMPLE, this_source_obj,
  507. state, context);
  508. if (ACPI_FAILURE (status)) {
  509. return_ACPI_STATUS (status);
  510. }
  511. state->pkg.index++;
  512. while (state->pkg.index >= state->pkg.source_object->package.count) {
  513. /*
  514. * We've handled all of the objects at this level, This means
  515. * that we have just completed a package. That package may
  516. * have contained one or more packages itself.
  517. *
  518. * Delete this state and pop the previous state (package).
  519. */
  520. acpi_ut_delete_generic_state (state);
  521. state = acpi_ut_pop_generic_state (&state_list);
  522. /* Finished when there are no more states */
  523. if (!state) {
  524. /*
  525. * We have handled all of the objects in the top level
  526. * package just add the length of the package objects
  527. * and exit
  528. */
  529. return_ACPI_STATUS (AE_OK);
  530. }
  531. /*
  532. * Go back up a level and move the index past the just
  533. * completed package object.
  534. */
  535. state->pkg.index++;
  536. }
  537. }
  538. else {
  539. /* This is a subobject of type package */
  540. status = walk_callback (ACPI_COPY_TYPE_PACKAGE, this_source_obj,
  541. state, context);
  542. if (ACPI_FAILURE (status)) {
  543. return_ACPI_STATUS (status);
  544. }
  545. /*
  546. * Push the current state and create a new one
  547. * The callback above returned a new target package object.
  548. */
  549. acpi_ut_push_generic_state (&state_list, state);
  550. state = acpi_ut_create_pkg_state (this_source_obj,
  551. state->pkg.this_target_obj, 0);
  552. if (!state) {
  553. return_ACPI_STATUS (AE_NO_MEMORY);
  554. }
  555. }
  556. }
  557. /* We should never get here */
  558. return_ACPI_STATUS (AE_AML_INTERNAL);
  559. }
  560. /*******************************************************************************
  561. *
  562. * FUNCTION: acpi_ut_generate_checksum
  563. *
  564. * PARAMETERS: Buffer - Buffer to be scanned
  565. * Length - number of bytes to examine
  566. *
  567. * RETURN: The generated checksum
  568. *
  569. * DESCRIPTION: Generate a checksum on a raw buffer
  570. *
  571. ******************************************************************************/
  572. u8
  573. acpi_ut_generate_checksum (
  574. u8 *buffer,
  575. u32 length)
  576. {
  577. u32 i;
  578. signed char sum = 0;
  579. for (i = 0; i < length; i++) {
  580. sum = (signed char) (sum + buffer[i]);
  581. }
  582. return ((u8) (0 - sum));
  583. }
  584. /*******************************************************************************
  585. *
  586. * FUNCTION: acpi_ut_get_resource_end_tag
  587. *
  588. * PARAMETERS: obj_desc - The resource template buffer object
  589. *
  590. * RETURN: Pointer to the end tag
  591. *
  592. * DESCRIPTION: Find the END_TAG resource descriptor in a resource template
  593. *
  594. ******************************************************************************/
  595. u8 *
  596. acpi_ut_get_resource_end_tag (
  597. union acpi_operand_object *obj_desc)
  598. {
  599. u8 buffer_byte;
  600. u8 *buffer;
  601. u8 *end_buffer;
  602. buffer = obj_desc->buffer.pointer;
  603. end_buffer = buffer + obj_desc->buffer.length;
  604. while (buffer < end_buffer) {
  605. buffer_byte = *buffer;
  606. if (buffer_byte & ACPI_RDESC_TYPE_MASK) {
  607. /* Large Descriptor - Length is next 2 bytes */
  608. buffer += ((*(buffer+1) | (*(buffer+2) << 8)) + 3);
  609. }
  610. else {
  611. /* Small Descriptor. End Tag will be found here */
  612. if ((buffer_byte & ACPI_RDESC_SMALL_MASK) == ACPI_RDESC_TYPE_END_TAG) {
  613. /* Found the end tag descriptor, all done. */
  614. return (buffer);
  615. }
  616. /* Length is in the header */
  617. buffer += ((buffer_byte & 0x07) + 1);
  618. }
  619. }
  620. /* End tag not found */
  621. return (NULL);
  622. }
  623. /*******************************************************************************
  624. *
  625. * FUNCTION: acpi_ut_report_error
  626. *
  627. * PARAMETERS: module_name - Caller's module name (for error output)
  628. * line_number - Caller's line number (for error output)
  629. * component_id - Caller's component ID (for error output)
  630. *
  631. * RETURN: None
  632. *
  633. * DESCRIPTION: Print error message
  634. *
  635. ******************************************************************************/
  636. void
  637. acpi_ut_report_error (
  638. char *module_name,
  639. u32 line_number,
  640. u32 component_id)
  641. {
  642. acpi_os_printf ("%8s-%04d: *** Error: ", module_name, line_number);
  643. }
  644. /*******************************************************************************
  645. *
  646. * FUNCTION: acpi_ut_report_warning
  647. *
  648. * PARAMETERS: module_name - Caller's module name (for error output)
  649. * line_number - Caller's line number (for error output)
  650. * component_id - Caller's component ID (for error output)
  651. *
  652. * RETURN: None
  653. *
  654. * DESCRIPTION: Print warning message
  655. *
  656. ******************************************************************************/
  657. void
  658. acpi_ut_report_warning (
  659. char *module_name,
  660. u32 line_number,
  661. u32 component_id)
  662. {
  663. acpi_os_printf ("%8s-%04d: *** Warning: ", module_name, line_number);
  664. }
  665. /*******************************************************************************
  666. *
  667. * FUNCTION: acpi_ut_report_info
  668. *
  669. * PARAMETERS: module_name - Caller's module name (for error output)
  670. * line_number - Caller's line number (for error output)
  671. * component_id - Caller's component ID (for error output)
  672. *
  673. * RETURN: None
  674. *
  675. * DESCRIPTION: Print information message
  676. *
  677. ******************************************************************************/
  678. void
  679. acpi_ut_report_info (
  680. char *module_name,
  681. u32 line_number,
  682. u32 component_id)
  683. {
  684. acpi_os_printf ("%8s-%04d: *** Info: ", module_name, line_number);
  685. }