aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2014-01-15 13:42:50 -0500
committerKevin O'Connor <kevin@koconnor.net>2014-01-22 17:30:30 -0500
commit940fc1fc58b4f2a1c3baa8a5bb907f7b22ba0a31 (patch)
tree1cb35b18dd6695877ff2908631a2867bc892d995
parentcf85418f7825a2a6712f8feb0ab7e37c55323eb3 (diff)
downloadseabios-940fc1fc58b4f2a1c3baa8a5bb907f7b22ba0a31.tar.gz
debug: Only call serial_debug_preinit() at startup.
The serial_debug_preinit() function disables serial interrupts so that the OS doesn't get confused by "transmit buffer empty" interrupts caused when seabios writes to the serial port. It's unnecessary paranoia to keep rechecking that interrupts are disabled. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r--src/boot.c2
-rw-r--r--src/optionroms.c2
-rw-r--r--src/output.c7
-rw-r--r--src/output.h1
-rw-r--r--src/post.c3
-rw-r--r--src/resume.c1
-rw-r--r--vgasrc/vgainit.c3
7 files changed, 4 insertions, 15 deletions
diff --git a/src/boot.c b/src/boot.c
index ad799f94..183f4f37 100644
--- a/src/boot.c
+++ b/src/boot.c
@@ -743,7 +743,6 @@ int BootSequence VARLOW = -1;
void VISIBLE32FLAT
handle_18(void)
{
- debug_preinit();
debug_enter(NULL, DEBUG_HDL_18);
int seq = BootSequence + 1;
BootSequence = seq;
@@ -754,7 +753,6 @@ handle_18(void)
void VISIBLE32FLAT
handle_19(void)
{
- debug_preinit();
debug_enter(NULL, DEBUG_HDL_19);
BootSequence = 0;
do_boot(0);
diff --git a/src/optionroms.c b/src/optionroms.c
index 1ff73c46..93d9d2fe 100644
--- a/src/optionroms.c
+++ b/src/optionroms.c
@@ -44,8 +44,6 @@ __callrom(struct rom_header *rom, u16 offset, u16 bdf)
start_preempt();
farcall16big(&br);
finish_preempt();
-
- debug_preinit();
}
// Execute a given option rom at the standard entry vector.
diff --git a/src/output.c b/src/output.c
index 1d882fa6..06d42a27 100644
--- a/src/output.c
+++ b/src/output.c
@@ -26,13 +26,6 @@ struct putcinfo {
* Debug output
****************************************************************/
-// Setup debugging port(s).
-void
-debug_preinit(void)
-{
- serial_debug_preinit();
-}
-
// Write a character to debug port(s).
static void
debug_putc(struct putcinfo *action, char c)
diff --git a/src/output.h b/src/output.h
index a13d55b7..66010359 100644
--- a/src/output.h
+++ b/src/output.h
@@ -4,7 +4,6 @@
#include "types.h" // u32
// output.c
-void debug_preinit(void);
void panic(const char *fmt, ...)
__attribute__ ((format (printf, 1, 2))) __noreturn;
void printf(const char *fmt, ...)
diff --git a/src/post.c b/src/post.c
index ace6f4cc..ec3271e3 100644
--- a/src/post.c
+++ b/src/post.c
@@ -19,6 +19,7 @@
#include "hw/pic.h" // pic_setup
#include "hw/ps2port.h" // ps2port_setup
#include "hw/rtc.h" // rtc_write
+#include "hw/serialio.h" // serial_debug_preinit
#include "hw/usb.h" // usb_setup
#include "hw/virtio-blk.h" // virtio_blk_setup
#include "hw/virtio-scsi.h" // virtio_scsi_setup
@@ -317,7 +318,7 @@ handle_post(void)
if (!CONFIG_QEMU && !CONFIG_COREBOOT)
return;
- debug_preinit();
+ serial_debug_preinit();
dprintf(1, "Start bios (version %s)\n", VERSION);
// Check if we are running under Xen.
diff --git a/src/resume.c b/src/resume.c
index 9ad2e4fe..e2ceef14 100644
--- a/src/resume.c
+++ b/src/resume.c
@@ -25,7 +25,6 @@ void VISIBLE16
handle_resume(void)
{
ASSERT16();
- debug_preinit();
int status = rtc_read(CMOS_RESET_CODE);
rtc_write(CMOS_RESET_CODE, 0);
dprintf(1, "In resume (status=%d)\n", status);
diff --git a/vgasrc/vgainit.c b/vgasrc/vgainit.c
index 7b01e03c..13221fdd 100644
--- a/vgasrc/vgainit.c
+++ b/vgasrc/vgainit.c
@@ -9,6 +9,7 @@
#include "bregs.h" // struct bregs
#include "hw/pci.h" // pci_config_readw
#include "hw/pci_regs.h" // PCI_VENDOR_ID
+#include "hw/serialio.h" // serial_debug_preinit
#include "output.h" // dprintf
#include "std/optionrom.h" // struct pci_data
#include "std/pmm.h" // struct pmmheader
@@ -126,7 +127,7 @@ int HaveRunInit VAR16;
void VISIBLE16
vga_post(struct bregs *regs)
{
- debug_preinit();
+ serial_debug_preinit();
dprintf(1, "Start SeaVGABIOS (version %s)\n", VERSION);
debug_enter(regs, DEBUG_VGA_POST);