Add support for 32bit PCI BIOS entry.
[seabios.git] / src / output.c
index e49010da0a1fe2a5f4a403d98ca569f3c5728b14..2e7175e4f90195b095dde6da3899004ed1a8406c 100644 (file)
@@ -84,11 +84,13 @@ putc_debug(struct putcinfo *action, char c)
     debug_serial(c);
 }
 
-// In 16bit mode just need a dummy variable (putc_debug is always used
-// anyway), and in 32bit mode need a pointer to the 32bit instance of
-// putc_debug().
+// In segmented mode just need a dummy variable (putc_debug is always
+// used anyway), and in 32bit flat mode need a pointer to the 32bit
+// instance of putc_debug().
 #if MODE16
 static struct putcinfo debuginfo VAR16;
+#elif MODESEGMENT
+static struct putcinfo debuginfo VAR32SEG;
 #else
 static struct putcinfo debuginfo = { putc_debug };
 #endif
@@ -132,8 +134,8 @@ static struct putcinfo screeninfo = { putc_screen };
 static void
 putc(struct putcinfo *action, char c)
 {
-    if (MODE16) {
-        // Only debugging output supported in 16bit mode.
+    if (MODESEGMENT) {
+        // Only debugging output supported in segmented mode.
         putc_debug(action, c);
         return;
     }
@@ -325,7 +327,7 @@ panic(const char *fmt, ...)
 void
 __dprintf(const char *fmt, ...)
 {
-    if (!MODE16 && CONFIG_THREADS && CONFIG_DEBUG_LEVEL >= DEBUG_thread
+    if (!MODESEGMENT && CONFIG_THREADS && CONFIG_DEBUG_LEVEL >= DEBUG_thread
         && *fmt != '\\' && *fmt != '/') {
         struct thread_info *cur = getCurThread();
         if (cur != &MainThread) {
@@ -347,7 +349,7 @@ __dprintf(const char *fmt, ...)
 void
 printf(const char *fmt, ...)
 {
-    ASSERT32();
+    ASSERT32FLAT();
     va_list args;
     va_start(args, fmt);
     bvprintf(&screeninfo, fmt, args);
@@ -382,7 +384,7 @@ putc_str(struct putcinfo *info, char c)
 int
 snprintf(char *str, size_t size, const char *fmt, ...)
 {
-    ASSERT32();
+    ASSERT32FLAT();
     if (!size)
         return 0;
     struct snprintfinfo sinfo = { { putc_str }, str, str + size };