printk_foo -> printk(BIOS_FOO, ...)
[coreboot.git] / src / arch / i386 / lib / exception.c
index a3306520b40608802aea6d0b22d974f2b71545e1..eb1df20e2611cca6e033bdf34653014c0d1c81cb 100644 (file)
@@ -1,7 +1,7 @@
 #include <console/console.h>
 #include <string.h>
 
-#if CONFIG_GDB_STUB == 1
+#if defined(CONFIG_GDB_STUB) && CONFIG_GDB_STUB == 1
 
 /* BUFMAX defines the maximum number of characters in inbound/outbound buffers.
  * At least NUM_REGBYTES*2 are needed for register packets 
@@ -359,14 +359,9 @@ static void put_packet(char *buffer)
 }
 #endif /* CONFIG_GDB_STUB */
 
-struct eregs {
-       uint32_t eax, ecx, edx, ebx, esp, ebp, esi, edi;
-       uint32_t vector;
-       uint32_t error_code;
-       uint32_t eip;
-       uint32_t cs;
-       uint32_t eflags;
-};
+#include <arch/registers.h>
+
+void x86_exception(struct eregs *info);
 
 void x86_exception(struct eregs *info)
 {
@@ -480,7 +475,7 @@ void x86_exception(struct eregs *info)
                put_packet(out_buffer);
        }
 #else /* !CONFIG_GDB_STUB */
-       printk_emerg(
+       printk(BIOS_EMERG, 
                "Unexpected Exception: %d @ %02x:%08x - Halting\n"
                "Code: %d eflags: %08x\n"
                "eax: %08x ebx: %08x ecx: %08x edx: %08x\n"