vgabios: Unify X_set_mode() functions.

Use the same function signature for cirrus, bochsvga, and stdvga
set_mode code.

Make both the int1000 interface and the VBE 104f02 interface use the
same set_mode function.

Where clext and bochsvga need to fallback to the standard vga mode
switching, have them call vgastd_mode_switch directly.

Signed-off-by: Kevin O'Connor <>
diff --git a/vgasrc/vgahw.h b/vgasrc/vgahw.h
new file mode 100644
index 0000000..57e41c3
--- /dev/null
+++ b/vgasrc/vgahw.h
@@ -0,0 +1,19 @@
+#ifndef __VGAHW_H
+#define __VGAHW_H
+#include "types.h" // u8
+#include "config.h" // CONFIG_*
+#include "clext.h" // clext_set_mode
+#include "bochsvga.h" // bochsvga_set_mode
+#include "stdvga.h" // stdvga_set_mode
+static inline int vgahw_set_mode(int mode, int flags) {
+        return clext_set_mode(mode, flags);
+        return bochsvga_set_mode(mode, flags);
+    return stdvga_set_mode(mode, flags);
+#endif // vgahw.h