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.

174 lines
4.4 KiB

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