Move the full video_param_table[] setup (including the updating of the
BDA) to stdvga_build_video_param().

Signed-off-by: Kevin O'Connor <ke...@koconnor.net>
---
 vgasrc/stdvgamodes.c | 10 ++++++++++
 vgasrc/vgabios.c     |  1 +
 vgasrc/vgabios.h     |  9 +++------
 vgasrc/vgainit.c     |  8 --------
 4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/vgasrc/stdvgamodes.c b/vgasrc/stdvgamodes.c
index c553514..f61d52f 100644
--- a/vgasrc/stdvgamodes.c
+++ b/vgasrc/stdvgamodes.c
@@ -7,6 +7,7 @@
 
 #include "biosvar.h" // GET_GLOBAL
 #include "output.h" // warn_internalerror
+#include "std/vga.h" // struct video_param_s
 #include "stdvga.h" // stdvga_find_mode
 #include "string.h" // memcpy_far
 #include "vgabios.h" // video_param_table
@@ -348,9 +349,18 @@ stdvga_list_modes(u16 seg, u16 *dest, u16 *last)
     SET_FARVAR(seg, *dest, 0xffff);
 }
 
+static struct video_save_pointer_s video_save_pointer_table VAR16;
+
+static struct video_param_s video_param_table[29] VAR16;
+
 void
 stdvga_build_video_param(void)
 {
+    SET_BDA(video_savetable
+            , SEGOFF(get_global_seg(), (u32)&video_save_pointer_table));
+    SET_VGA(video_save_pointer_table.videoparam
+            , SEGOFF(get_global_seg(), (u32)video_param_table));
+
     static u8 parammodes[] VAR16 = {
         0, 0, 0, 0, 0x04, 0x05, 0x06, 0x07,
         0, 0, 0, 0, 0, 0x0d, 0x0e, 0,
diff --git a/vgasrc/vgabios.c b/vgasrc/vgabios.c
index 44ce312..b980da5 100644
--- a/vgasrc/vgabios.c
+++ b/vgasrc/vgabios.c
@@ -11,6 +11,7 @@
 #include "config.h" // CONFIG_*
 #include "output.h" // dprintf
 #include "std/vbe.h" // VBE_RETURN_STATUS_FAILED
+#include "std/vga.h" // struct video_func_static
 #include "stdvga.h" // stdvga_set_cursor_shape
 #include "string.h" // memset_far
 #include "vgabios.h" // calc_page_size
diff --git a/vgasrc/vgabios.h b/vgasrc/vgabios.h
index 0e988bd..2176ec6 100644
--- a/vgasrc/vgabios.h
+++ b/vgasrc/vgabios.h
@@ -2,9 +2,8 @@
 #define __VGABIOS_H
 
 #include "config.h" // CONFIG_VGA_EMULATE_TEXT
+#include "farptr.h" // GET_FARVAR
 #include "types.h" // u8
-#include "farptr.h" // struct segoff_s
-#include "std/vga.h" // struct video_param_s
 
 // Save/Restore flags
 #define SR_HARDWARE   0x0001
@@ -81,12 +80,10 @@ extern u8 vgafont14alt[];
 extern u8 vgafont16alt[];
 
 // vgainit.c
-extern struct video_save_pointer_s video_save_pointer_table;
-extern struct video_param_s video_param_table[29];
-
-// vgabios.c
 extern int VgaBDF;
 extern int HaveRunInit;
+
+// vgabios.c
 #define SET_VGA(var, val) SET_FARVAR(get_global_seg(), (var), (val))
 int vga_bpp(struct vgamode_s *vmode_g);
 u16 calc_page_size(u8 memmodel, u16 width, u16 height);
diff --git a/vgasrc/vgainit.c b/vgasrc/vgainit.c
index 6249e66..f003026 100644
--- a/vgasrc/vgainit.c
+++ b/vgasrc/vgainit.c
@@ -18,10 +18,6 @@
 #include "vgabios.h" // video_save_pointer_table
 #include "vgahw.h" // vgahw_setup
 
-struct video_save_pointer_s video_save_pointer_table VAR16;
-
-struct video_param_s video_param_table[29] VAR16;
-
 // Type of emulator platform - for dprintf with certain compile options.
 int PlatformRunningOn VAR16;
 
@@ -132,8 +128,6 @@ init_bios_area(void)
     SET_BDA(modeset_ctl, 0x51);
 
     SET_BDA(dcc_index, CONFIG_VGA_STDVGA_PORTS ? 0x08 : 0xff);
-    SET_BDA(video_savetable
-            , SEGOFF(get_global_seg(), (u32)&video_save_pointer_table));
 
     // FIXME
     SET_BDA(video_msr, 0x00); // Unavailable on vanilla vga, but...
@@ -171,8 +165,6 @@ vga_post(struct bregs *regs)
 
     init_bios_area();
 
-    SET_VGA(video_save_pointer_table.videoparam
-            , SEGOFF(get_global_seg(), (u32)video_param_table));
     if (CONFIG_VGA_STDVGA_PORTS)
         stdvga_build_video_param();
 
-- 
2.5.5


_______________________________________________
SeaBIOS mailing list
SeaBIOS@seabios.org
https://www.coreboot.org/mailman/listinfo/seabios

Reply via email to