]> xenbits.xensource.com Git - people/andrewcoop/seabios.git/commitdiff
vgautil: Add new header file with misc function and variable definitions
authorKevin O'Connor <kevin@koconnor.net>
Fri, 5 Aug 2016 15:14:58 +0000 (11:14 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Fri, 5 Aug 2016 15:28:19 +0000 (11:28 -0400)
Move the generic function and variable definitions from vgabios.h to a
new file vgautil.h.  This reduces the size and complexity of
vgabios.h.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 files changed:
vgasrc/bochsvga.c
vgasrc/cbvga.c
vgasrc/clext.c
vgasrc/geodevga.c
vgasrc/stdvgamodes.c
vgasrc/swcursor.c
vgasrc/vbe.c
vgasrc/vgabios.c
vgasrc/vgabios.h
vgasrc/vgafb.c
vgasrc/vgafonts.c
vgasrc/vgainit.c
vgasrc/vgautil.h [new file with mode: 0644]

index aa82fc5a53301d5450021e607ce5bbbaf4bcf5df..5658031294579acf6e437b1be78960b44430aa57 100644 (file)
@@ -14,7 +14,8 @@
 #include "output.h" // dprintf
 #include "std/vbe.h" // VBE_CAPABILITY_8BIT_DAC
 #include "stdvga.h" // VGAREG_SEQU_ADDRESS
-#include "vgabios.h" // struct vbe_modeinfo
+#include "vgabios.h" // SET_VGA
+#include "vgautil.h" // VBE_total_memory
 #include "x86.h" // outw
 
 
index b4d7d36bc2677086f19a95a585dd904f0cb418d9..9d0adef5ed3ef5a118566339c5837e540edc7bb2 100644 (file)
@@ -10,8 +10,9 @@
 #include "stdvga.h" // SEG_CTEXT
 #include "string.h" // memset16_far
 #include "util.h" // find_cb_table
-#include "vgabios.h" // VGAREG_*
+#include "vgabios.h" // SET_VGA
 #include "vgafb.h" // handle_gfx_op
+#include "vgautil.h" // VBE_total_memory
 
 static int CBmode VAR16;
 static struct vgamode_s CBmodeinfo VAR16;
index fc5b42f62bf989f450aed592c672fdf9e78edc9d..45b5de3991937cd74e9038bc7cd5a110e2bd25a9 100644 (file)
@@ -13,7 +13,8 @@
 #include "output.h" // dprintf
 #include "stdvga.h" // VGAREG_SEQU_ADDRESS
 #include "string.h" // memset16_far
-#include "vgabios.h" // VBE_VENDOR_STRING
+#include "vgabios.h" // SET_VGA
+#include "vgautil.h" // VBE_total_memory
 
 
 /****************************************************************
index f8f61c3a1334a8d124739a5488bbde01acfe0647..a5a58cdbe003be5848424743d2d634528a5873e9 100644 (file)
@@ -13,7 +13,8 @@
 #include "hw/pci_regs.h" // PCI_BASE_ADDRESS_0
 #include "output.h" // dprintf
 #include "stdvga.h" // stdvga_crtc_write
-#include "vgabios.h" // VGAREG_*
+#include "vgabios.h" // SET_VGA
+#include "vgautil.h" // VBE_total_memory
 
 
 /****************************************************************
index f61d52fe1a85e5e8a7a360f76c21d3865e6439f1..173dd4f7bd291eb05254a26a81e83c1a467e9e21 100644 (file)
@@ -10,7 +10,8 @@
 #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
+#include "vgabios.h" // SET_VGA
+#include "vgautil.h" // vgafont16
 
 
 /****************************************************************
index b7b32506517e03d09c1eb407a71b163923f284b1..f2212d5af8ce9f8712405298ab804b48934b4691 100644 (file)
@@ -8,6 +8,7 @@
 #include "bregs.h" // struct bregs
 #include "vgabios.h" // get_cursor_pos
 #include "vgafb.h" // handle_gfx_op
+#include "vgautil.h" // swcursor_check_event
 
 // Draw/undraw a cursor on the framebuffer by xor'ing the cursor cell
 static void
index af3d0ccb8a31b70757747777756210288e459cb8..facad1982b9b56a1b58987887b68f6963bd13cdb 100644 (file)
 #include "output.h" // dprintf
 #include "std/vbe.h" // struct vbe_info
 #include "string.h" // memset_far
-#include "vgabios.h" // handle_104f
+#include "vgabios.h" // get_current_mode
 #include "vgahw.h" // vgahw_set_mode
+#include "vgautil.h" // handle_104f
+
+#define VBE_OEM_STRING "SeaBIOS VBE(C) 2011"
+#define VBE_VENDOR_STRING "SeaBIOS Developers"
+#define VBE_PRODUCT_STRING "SeaBIOS VBE Adapter"
+#define VBE_REVISION_STRING "Rev. 1"
 
 u32 VBE_total_memory VAR16 = 256 * 1024;
 u32 VBE_capabilities VAR16;
index b980da5d426bb1c1bfac1cbf5f424d01fe3abb48..db4f8684bd80501503c3d9a3919ff1ba03cf08a0 100644 (file)
@@ -17,6 +17,7 @@
 #include "vgabios.h" // calc_page_size
 #include "vgafb.h" // vgafb_write_char
 #include "vgahw.h" // vgahw_set_mode
+#include "vgautil.h" // swcursor_pre_handle10
 
 
 /****************************************************************
index 2176ec61b1225e56dbcd976ac1b27b53576b2be9..3d5bbfe55f8bfe822a420fd266d2f11c67aa2233 100644 (file)
@@ -68,23 +68,14 @@ static inline int vga_emulate_text(void) {
     return CONFIG_VGA_EMULATE_TEXT && GET_BDA_EXT(flags) & BF_EMULATE_TEXT;
 }
 
+// Write to global variables (during "post" phase only)
+#define SET_VGA(var, val) SET_FARVAR(get_global_seg(), (var), (val))
+
 // Debug settings
 #define DEBUG_VGA_POST 1
 #define DEBUG_VGA_10 3
 
-// vgafonts.c
-extern u8 vgafont8[];
-extern u8 vgafont14[];
-extern u8 vgafont16[];
-extern u8 vgafont14alt[];
-extern u8 vgafont16alt[];
-
-// vgainit.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);
 u16 get_cursor_shape(void);
@@ -94,20 +85,4 @@ struct vgamode_s *get_current_mode(void);
 int vga_set_mode(int mode, int flags);
 extern struct video_func_static static_functionality;
 
-// swcursor.c
-struct bregs;
-void swcursor_pre_handle10(struct bregs *regs);
-void swcursor_check_event(void);
-
-// vbe.c
-extern u32 VBE_total_memory;
-extern u32 VBE_capabilities;
-extern u32 VBE_framebuffer;
-extern u16 VBE_win_granularity;
-#define VBE_OEM_STRING "SeaBIOS VBE(C) 2011"
-#define VBE_VENDOR_STRING "SeaBIOS Developers"
-#define VBE_PRODUCT_STRING "SeaBIOS VBE Adapter"
-#define VBE_REVISION_STRING "Rev. 1"
-void handle_104f(struct bregs *regs);
-
 #endif // vgabios.h
index 04d543eed2978f443e58d72a99958b8eaff90cd4..46adfb5e06143d63eeb46ddb122bae2892c4c949 100644 (file)
 #include "output.h" // dprintf
 #include "stdvga.h" // stdvga_planar4_plane
 #include "string.h" // memset_far
-#include "vgabios.h" // vgafb_scroll
+#include "vgabios.h" // get_current_mode
 #include "vgafb.h" // vgafb_write_char
 #include "vgahw.h" // vgahw_get_linelength
+#include "vgautil.h" // VBE_framebuffer
 
 static inline void
 memmove_stride(u16 seg, void *dst, void *src, int copylen, int stride, int lines)
index 47a6437f2a1b6b51558df0fd9086c922d266b9c4..e64ef6c936a4893a2cbc953f8aedaa1097e1c5b3 100644 (file)
@@ -1,4 +1,4 @@
-#include "vgabios.h" // vgafont8
+#include "vgautil.h" // vgafont8
 
 /*
  * These fonts come from ftp://ftp.simtel.net/pub/simtelnet/msdos/screen/fntcol16.zip
index f003026c93895f0b5a66114c77a8b3c6895f772d..4050c96a1c70560e9c9dca33b619510ad9591dd5 100644 (file)
@@ -15,8 +15,9 @@
 #include "std/pmm.h" // struct pmmheader
 #include "string.h" // checksum_far
 #include "util.h" // VERSION
-#include "vgabios.h" // video_save_pointer_table
+#include "vgabios.h" // SET_VGA
 #include "vgahw.h" // vgahw_setup
+#include "vgautil.h" // swcursor_check_event
 
 // Type of emulator platform - for dprintf with certain compile options.
 int PlatformRunningOn VAR16;
diff --git a/vgasrc/vgautil.h b/vgasrc/vgautil.h
new file mode 100644 (file)
index 0000000..9e4debb
--- /dev/null
@@ -0,0 +1,30 @@
+// Misc function and variable declarations.
+#ifndef __VGAUTIL_H
+#define __VGAUTIL_H
+
+#include "types.h" // u8
+
+// swcursor.c
+struct bregs;
+void swcursor_pre_handle10(struct bregs *regs);
+void swcursor_check_event(void);
+
+// vbe.c
+extern u32 VBE_total_memory;
+extern u32 VBE_capabilities;
+extern u32 VBE_framebuffer;
+extern u16 VBE_win_granularity;
+void handle_104f(struct bregs *regs);
+
+// vgafonts.c
+extern u8 vgafont8[];
+extern u8 vgafont14[];
+extern u8 vgafont16[];
+extern u8 vgafont14alt[];
+extern u8 vgafont16alt[];
+
+// vgainit.c
+extern int VgaBDF;
+extern int HaveRunInit;
+
+#endif // vgautil.h