diff options
author | Stefan Reinauer <stepan@coresystems.de> | 2010-04-01 09:50:32 +0000 |
---|---|---|
committer | Stefan Reinauer <stepan@openbios.org> | 2010-04-01 09:50:32 +0000 |
commit | 0c781b2694b2c137d9761704954ea38be5ba8a15 (patch) | |
tree | 55c8bb4ea9f5875da7e4f7ffa6b5e7d2aa87a4b8 /src/include | |
parent | 84b685af5f1e1cf49c2c2f22ae80a8a0df8472f8 (diff) | |
download | coreboot-0c781b2694b2c137d9761704954ea38be5ba8a15.tar.xz |
-Â get rid of ASM_CONSOLE_LOGLEVEL except in two assembler files.
- start naming all versions of post code output "post_code()"
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5344 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/console/console.h | 23 | ||||
-rw-r--r-- | src/include/console/loglevel.h | 5 |
2 files changed, 16 insertions, 12 deletions
diff --git a/src/include/console/console.h b/src/include/console/console.h index fe7ea0b1e6..98ee4581f1 100644 --- a/src/include/console/console.h +++ b/src/include/console/console.h @@ -10,7 +10,7 @@ void console_tx_byte(unsigned char byte); void console_tx_flush(void); unsigned char console_rx_byte(void); int console_tst_byte(void); -void post_code(uint8_t value); +void post_code(u8 value); void __attribute__ ((noreturn)) die(const char *msg); #if CONFIG_CONSOLE_VGA == 1 void vga_console_init(void); @@ -31,7 +31,14 @@ extern struct console_driver console_drivers[]; extern struct console_driver econsole_drivers[]; extern int console_loglevel; -#endif /* !__PRE_RAM__ */ +#else +/* __PRE_RAM__ */ +/* Using a global varible can cause problems when we reset the stack + * from cache as ram to ram. If we make this a define USE_SHARED_STACK + * we could use the same code on all architectures. + */ +#define console_loglevel CONFIG_DEFAULT_CONSOLE_LOGLEVEL +#endif #ifndef __ROMCC__ int do_printk(int msg_level, const char *fmt, ...) __attribute__((format(printf, 2, 3))); @@ -121,6 +128,8 @@ int do_printk(int msg_level, const char *fmt, ...) __attribute__((format(printf, #define print_debug_hex32(HEX) printk(BIOS_DEBUG, "%08x", (HEX)) #define print_spew_hex32(HEX) printk(BIOS_SPEW, "%08x", (HEX)) #else + + /* __ROMCC__ */ static void __console_tx_byte(unsigned char byte) { @@ -139,14 +148,14 @@ static void __console_tx_nibble(unsigned nibble) static void __console_tx_char(int loglevel, unsigned char byte) { - if (ASM_CONSOLE_LOGLEVEL >= loglevel) { + if (console_loglevel >= loglevel) { uart_tx_byte(byte); } } static void __console_tx_hex8(int loglevel, unsigned char value) { - if (ASM_CONSOLE_LOGLEVEL >= loglevel) { + if (console_loglevel >= loglevel) { __console_tx_nibble((value >> 4U) & 0x0fU); __console_tx_nibble(value & 0x0fU); } @@ -154,7 +163,7 @@ static void __console_tx_hex8(int loglevel, unsigned char value) static void __console_tx_hex16(int loglevel, unsigned short value) { - if (ASM_CONSOLE_LOGLEVEL >= loglevel) { + if (console_loglevel >= loglevel) { __console_tx_nibble((value >> 12U) & 0x0fU); __console_tx_nibble((value >> 8U) & 0x0fU); __console_tx_nibble((value >> 4U) & 0x0fU); @@ -164,7 +173,7 @@ static void __console_tx_hex16(int loglevel, unsigned short value) static void __console_tx_hex32(int loglevel, unsigned int value) { - if (ASM_CONSOLE_LOGLEVEL >= loglevel) { + if (console_loglevel >= loglevel) { __console_tx_nibble((value >> 28U) & 0x0fU); __console_tx_nibble((value >> 24U) & 0x0fU); __console_tx_nibble((value >> 20U) & 0x0fU); @@ -178,7 +187,7 @@ static void __console_tx_hex32(int loglevel, unsigned int value) static void __console_tx_string(int loglevel, const char *str) { - if (ASM_CONSOLE_LOGLEVEL >= loglevel) { + if (console_loglevel >= loglevel) { unsigned char ch; while((ch = *str++) != '\0') { if (ch == '\n') diff --git a/src/include/console/loglevel.h b/src/include/console/loglevel.h index f306744d9e..290cd891eb 100644 --- a/src/include/console/loglevel.h +++ b/src/include/console/loglevel.h @@ -2,11 +2,6 @@ #define LOGLEVEL_H /* Safe for inclusion in assembly */ - -#ifndef ASM_CONSOLE_LOGLEVEL -#define ASM_CONSOLE_LOGLEVEL CONFIG_MAXIMUM_CONSOLE_LOGLEVEL -#endif - #define BIOS_EMERG 0 /* system is unusable */ #define BIOS_ALERT 1 /* action must be taken immediately */ #define BIOS_CRIT 2 /* critical conditions */ |