vgabios: Use standard VGA IO wrappers in clext.c.
[seabios.git] / vgasrc / vgahw.h
index 23b4f135b310e9c459c77081b2067b9ef80b8ac6..1101e510737a1f9510be364f9fc8334d47fd7009 100644 (file)
@@ -9,6 +9,14 @@
 #include "stdvga.h" // stdvga_set_mode
 #include "geodevga.h" // geodevga_init
 
+static inline struct vgamode_s *vgahw_find_mode(int mode) {
+    if (CONFIG_VGA_CIRRUS)
+        return clext_find_mode(mode);
+    if (CONFIG_VGA_BOCHS)
+        return bochsvga_find_mode(mode);
+    return stdvga_find_mode(mode);
+}
+
 static inline int vgahw_set_mode(int mode, int flags) {
     if (CONFIG_VGA_CIRRUS)
         return clext_set_mode(mode, flags);
@@ -17,6 +25,15 @@ static inline int vgahw_set_mode(int mode, int flags) {
     return stdvga_set_mode(mode, flags);
 }
 
+static inline void vgahw_list_modes(u16 seg, u16 *dest, u16 *last) {
+    if (CONFIG_VGA_CIRRUS)
+        clext_list_modes(seg, dest, last);
+    else if (CONFIG_VGA_BOCHS)
+        bochsvga_list_modes(seg, dest, last);
+    else
+        stdvga_list_modes(seg, dest, last);
+}
+
 static inline int vgahw_init(void) {
     if (CONFIG_VGA_CIRRUS)
         return clext_init();