You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

172 lines
4.3 KiB

  1. /*
  2. * This file is part of the coreboot project.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. */
  14. #ifndef LOGLEVEL_H
  15. #define LOGLEVEL_H
  16. /**
  17. * @file loglevel.h
  18. *
  19. * \brief Definitions of the log levels to be used in printk calls.
  20. *
  21. * Safe for inclusion in assembly.
  22. *
  23. */
  24. /**
  25. * \brief BIOS_EMERG - Emergency / Fatal
  26. *
  27. * Log level for when the system is entirely unusable. To be used when execution
  28. * is halting as a result of the failure. No further instructions should run.
  29. *
  30. * Example - End of all debug output / death notice.
  31. *
  32. * @{
  33. */
  34. #define BIOS_EMERG 0
  35. /** @} */
  36. /**
  37. * \brief BIOS_ALERT - Dying / Unrecoverable
  38. *
  39. * Log level for when the system is certainly in the process of dying.
  40. * To be used when execution will eventually halt as a result of the
  41. * failure, but the system can still output valuable debugging
  42. * information.
  43. *
  44. * Example - Ram initialization fails, dumping relevant POST codes and
  45. * information
  46. *
  47. * @{
  48. */
  49. #define BIOS_ALERT 1
  50. /** @} */
  51. /**
  52. * \brief BIOS_CRIT - Recovery unlikely
  53. *
  54. * Log level for when the system has experienced a dire issue in essential
  55. * components. To be used when boot will probably be unsuccessful as a
  56. * result of the failure, but recovery/retry can be attempted.
  57. *
  58. * Example - MSR failures, SMM/SMI failures.
  59. * or
  60. *
  61. * @{
  62. */
  63. #define BIOS_CRIT 2
  64. /** @} */
  65. /**
  66. * \brief BIOS_ERR - System in incomplete state.
  67. *
  68. * Log level for when the system has experienced an issue that may not preclude
  69. * a successful boot. To be used when coreboot execution may still succeed,
  70. * but the error places some non-essential portion of the machine in a broken
  71. * state that will be noticed downstream.
  72. *
  73. * Example - Payload could still load, but will be missing access to integral
  74. * components such as drives.
  75. *
  76. * @{
  77. */
  78. #define BIOS_ERR 3
  79. /** @} */
  80. /**
  81. * \brief BIOS_WARNING - Bad configuration
  82. *
  83. * Log level for when the system has noticed an issue that most likely will
  84. * not preclude a successful boot. To be used when something is wrong, and
  85. * would likely be noticed by an end user.
  86. *
  87. * Example - Bad ME firmware, bad microcode, mis-clocked CPU
  88. *
  89. * @{
  90. */
  91. #define BIOS_WARNING 4
  92. /** @} */
  93. /**
  94. * \brief BIOS_NOTICE - Unexpected but relatively insignificant
  95. *
  96. * Log level for when the system has noticed an issue that is an edge case,
  97. * but is handled and is recoverable. To be used when an end-user would likely
  98. * not notice.
  99. *
  100. * Example - Hardware was misconfigured, but is promptly fixed.
  101. *
  102. * @{
  103. */
  104. #define BIOS_NOTICE 5
  105. /** @} */
  106. /**
  107. * \brief BIOS_INFO - Expected events.
  108. *
  109. * Log level for when the system has experienced some typical event.
  110. * Messages should be superficial in nature.
  111. *
  112. * Example - Success messages. Status messages.
  113. *
  114. * @{
  115. */
  116. #define BIOS_INFO 6
  117. /** @} */
  118. /**
  119. * \brief BIOS_DEBUG - Verbose output
  120. *
  121. * Log level for details of a method. Messages may be dense,
  122. * but should not be excessive. Messages should be detailed enough
  123. * that this level provides sufficient details to diagnose a problem,
  124. * but not necessarily enough to fix it.
  125. *
  126. * Example - Printing of important variables.
  127. *
  128. * @{
  129. */
  130. #define BIOS_DEBUG 7
  131. /** @} */
  132. /**
  133. * \brief BIOS_SPEW - Excessively verbose output
  134. *
  135. * Log level for intricacies of a method. Messages might contain raw
  136. * data and will produce large logs. Developers should try to make sure
  137. * that this level is not useful to anyone besides developers.
  138. *
  139. * Example - Data dumps.
  140. *
  141. * @{
  142. */
  143. #define BIOS_SPEW 8
  144. /** @} */
  145. /**
  146. * \brief BIOS_NEVER - Muted log level.
  147. *
  148. * Roughly equal to commenting out a printk statement. Because a user
  149. * should not set their log level higher than 8, these statements
  150. * are never printed.
  151. *
  152. * Example - A developer might locally define MY_LOGLEVEL to BIOS_SPEW,
  153. * and later replace it with BIOS_NEVER as to mute their debug output.
  154. *
  155. * @{
  156. */
  157. #define BIOS_NEVER 9
  158. /** @} */
  159. #endif /* LOGLEVEL_H */