summaryrefslogtreecommitdiff
path: root/src/include/console
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2015-09-08 13:34:43 -0500
committerAaron Durbin <adurbin@chromium.org>2015-09-22 21:21:34 +0000
commitdc9f5cd54661e5ba3fffee7af0ba17dde9367b95 (patch)
tree43b5eca98ba0b09390ff9a6d1174c2e0cce94e1b /src/include/console
parent4b93a4f47a7457162d1be20eeffe57f81d5cd6af (diff)
coreboot: introduce commonlib
Instead of reaching into src/include and re-writing code allow for cleaner code sharing within coreboot and its utilities. The additional thing needed at this point is for the utilities to provide a printk() declaration within a <console/console.h> file. That way code which uses printk() can than be mapped properly to verbosity of utility parameters. Change-Id: I9e46a279569733336bc0a018aed96bc924c07cdd Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/11592 Tested-by: build bot (Jenkins) Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Diffstat (limited to 'src/include/console')
-rw-r--r--src/include/console/console.h2
-rw-r--r--src/include/console/early_print.h2
-rw-r--r--src/include/console/loglevel.h178
3 files changed, 2 insertions, 180 deletions
diff --git a/src/include/console/console.h b/src/include/console/console.h
index d8e7ffe60a..4428bdbc43 100644
--- a/src/include/console/console.h
+++ b/src/include/console/console.h
@@ -23,7 +23,7 @@
#include <stdint.h>
#include <rules.h>
#include <console/post_codes.h>
-#include <console/loglevel.h>
+#include <commonlib/loglevel.h>
#ifndef __ROMCC__
struct console_driver {
diff --git a/src/include/console/early_print.h b/src/include/console/early_print.h
index 4771a430ae..d852cbd53a 100644
--- a/src/include/console/early_print.h
+++ b/src/include/console/early_print.h
@@ -24,7 +24,7 @@
#include <console/console.h>
#include <console/streams.h>
-#include <console/loglevel.h>
+#include <commonlib/loglevel.h>
/* While in romstage, console loglevel is built-time constant.
* With ROMCC we inline this test with help from preprocessor.
diff --git a/src/include/console/loglevel.h b/src/include/console/loglevel.h
deleted file mode 100644
index e147490f7b..0000000000
--- a/src/include/console/loglevel.h
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2015 Nicholas Sielicki <sielicki@nicky.io>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc.
- */
-
-#ifndef LOGLEVEL_H
-#define LOGLEVEL_H
-
-/**
- * @file loglevel.h
- *
- * \brief Definitions of the log levels to be used in printk calls.
- *
- * Safe for inclusion in assembly.
- *
- */
-
-/**
- * \brief BIOS_EMERG - Emergency / Fatal
- *
- * Log level for when the system is entirely unusable. To be used when execution
- * is halting as a result of the failure. No further instructions should run.
- *
- * Example - End of all debug output / death notice.
- *
- * @{
- */
-#define BIOS_EMERG 0
-/** @} */
-
-/**
- * \brief BIOS_ALERT - Dying / Unrecoverable
- *
- * Log level for when the system is certainly in the process of dying.
- * To be used when execution will eventually halt as a result of the
- * failure, but the system can still output valuable debugging
- * information.
- *
- * Example - Ram initialization fails, dumping relevant POST codes and
- * information
- *
- * @{
- */
-#define BIOS_ALERT 1
-/** @} */
-
-/**
- * \brief BIOS_CRIT - Recovery unlikely
- *
- * Log level for when the system has experienced a dire issue in essential
- * components. To be used when boot will probably be unsuccessful as a
- * result of the failure, but recovery/retry can be attempted.
- *
- * Example - MSR failures, SMM/SMI failures.
- * or
- *
- * @{
- */
-#define BIOS_CRIT 2
-/** @} */
-
-/**
- * \brief BIOS_ERR - System in incomplete state.
- *
- * Log level for when the system has experienced an issue that may not preclude
- * a successful boot. To be used when coreboot execution may still succeed,
- * but the error places some non-essential portion of the machine in a broken
- * state that will be noticed downstream.
- *
- * Example - Payload could still load, but will be missing access to integral
- * components such as drives.
- *
- * @{
- */
-#define BIOS_ERR 3
-/** @} */
-
-/**
- * \brief BIOS_WARNING - Bad configuration
- *
- * Log level for when the system has noticed an issue that most likely will
- * not preclude a successful boot. To be used when something is wrong, and
- * would likely be noticed by an end user.
- *
- * Example - Bad ME firmware, bad microcode, mis-clocked CPU
- *
- * @{
- */
-#define BIOS_WARNING 4
-/** @} */
-
-/**
- * \brief BIOS_NOTICE - Unexpected but relatively insignificant
- *
- * Log level for when the system has noticed an issue that is an edge case,
- * but is handled and is recoverable. To be used when an end-user would likely
- * not notice.
- *
- * Example - Hardware was misconfigured, but is promptly fixed.
- *
- * @{
- */
-#define BIOS_NOTICE 5
-/** @} */
-
-/**
- * \brief BIOS_INFO - Expected events.
- *
- * Log level for when the system has experienced some typical event.
- * Messages should be superficial in nature.
- *
- * Example - Success messages. Status messages.
- *
- * @{
- */
-#define BIOS_INFO 6
-/** @} */
-
-/**
- * \brief BIOS_DEBUG - Verbose output
- *
- * Log level for details of a method. Messages may be dense,
- * but should not be excessive. Messages should be detailed enough
- * that this level provides sufficient details to diagnose a problem,
- * but not necessarily enough to fix it.
- *
- * Example - Printing of important variables.
- *
- * @{
- */
-#define BIOS_DEBUG 7
-/** @} */
-
-/**
- * \brief BIOS_SPEW - Excessively verbose output
- *
- * Log level for intricacies of a method. Messages might contain raw
- * data and will produce large logs. Developers should try to make sure
- * that this level is not useful to anyone besides developers.
- *
- * Example - Data dumps.
- *
- * @{
- */
-#define BIOS_SPEW 8
-/** @} */
-
-/**
- * \brief BIOS_NEVER - Muted log level.
- *
- * Roughly equal to commenting out a printk statement. Because a user
- * should not set their log level higher than 8, these statements
- * are never printed.
- *
- * Example - A developer might locally define MY_LOGLEVEL to BIOS_SPEW,
- * and later replace it with BIOS_NEVER as to mute their debug output.
- *
- * @{
- */
-#define BIOS_NEVER 9
-/** @} */
-
-#endif /* LOGLEVEL_H */