[SeaBIOS] [PATCH 08/10] vgabios: Add VBE power management (10h) stub function.

Kevin O'Connor kevin at koconnor.net
Sat Jan 28 05:30:06 CET 2012


Signed-off-by: Kevin O'Connor <kevin at koconnor.net>
---
 vgasrc/clext.c |   64 +++++++++----------------------------------------------
 vgasrc/vbe.c   |   21 ++++++++++++++++++
 2 files changed, 32 insertions(+), 53 deletions(-)

diff --git a/vgasrc/clext.c b/vgasrc/clext.c
index 0640752..45fab80 100644
--- a/vgasrc/clext.c
+++ b/vgasrc/clext.c
@@ -315,6 +315,17 @@ is_cirrus_mode(struct vgamode_s *vmode_g)
             && vmode_g <= &cirrus_modes[ARRAY_SIZE(cirrus_modes)-1].info);
 }
 
+void
+clext_list_modes(u16 seg, u16 *dest, u16 *last)
+{
+    int i;
+    for (i=0; i<ARRAY_SIZE(cirrus_vesa_modelist) && dest<last; i++) {
+        SET_FARVAR(seg, *dest, GET_GLOBAL(cirrus_vesa_modelist[i].vesamode));
+        dest++;
+    }
+    stdvga_list_modes(seg, dest, last);
+}
+
 static u16
 cirrus_vesamode_to_mode(u16 vesamode)
 {
@@ -613,59 +624,6 @@ clext_1012(struct bregs *regs)
 
 
 /****************************************************************
- * vesa calls
- ****************************************************************/
-
-void
-clext_list_modes(u16 seg, u16 *dest, u16 *last)
-{
-    int i;
-    for (i=0; i<ARRAY_SIZE(cirrus_vesa_modelist) && dest<last; i++) {
-        SET_FARVAR(seg, *dest, GET_GLOBAL(cirrus_vesa_modelist[i].vesamode));
-        dest++;
-    }
-    stdvga_list_modes(seg, dest, last);
-}
-
-static void
-cirrus_vesa_10h(struct bregs *regs)
-{
-    if (regs->bl == 0x00) {
-        regs->bx = 0x0f30;
-        regs->ax = 0x004f;
-        return;
-    }
-    if (regs->bl == 0x01) {
-        SET_BDA(vbe_flag, regs->bh);
-        regs->ax = 0x004f;
-        return;
-    }
-    if (regs->bl == 0x02) {
-        regs->bh = GET_BDA(vbe_flag);
-        regs->ax = 0x004f;
-        return;
-    }
-    regs->ax = 0x014f;
-}
-
-static void
-cirrus_vesa_not_handled(struct bregs *regs)
-{
-    debug_stub(regs);
-    regs->ax = 0x014f;
-}
-
-void
-cirrus_vesa(struct bregs *regs)
-{
-    switch (regs->al) {
-    case 0x10: cirrus_vesa_10h(regs); break;
-    default:   cirrus_vesa_not_handled(regs); break;
-    }
-}
-
-
-/****************************************************************
  * init
  ****************************************************************/
 
diff --git a/vgasrc/vbe.c b/vgasrc/vbe.c
index 9e1fe1c..c1b03f0 100644
--- a/vgasrc/vbe.c
+++ b/vgasrc/vbe.c
@@ -321,6 +321,26 @@ vbe_104f0a(struct bregs *regs)
 }
 
 static void
+vbe_104f10(struct bregs *regs)
+{
+    switch (regs->bl) {
+    case 0x00:
+        regs->bx = 0x0f30;
+        break;
+    case 0x01:
+        SET_BDA(vbe_flag, regs->bh);
+        break;
+    case 0x02:
+        regs->bh = GET_BDA(vbe_flag);
+        break;
+    default:
+        regs->ax = 0x014f;
+        return;
+    }
+    regs->ax = 0x004f;
+}
+
+static void
 vbe_104fXX(struct bregs *regs)
 {
     debug_stub(regs);
@@ -346,6 +366,7 @@ handle_104f(struct bregs *regs)
     case 0x07: vbe_104f07(regs); break;
     case 0x08: vbe_104f08(regs); break;
     case 0x0a: vbe_104f0a(regs); break;
+    case 0x10: vbe_104f10(regs); break;
     default:   vbe_104fXX(regs); break;
     }
 }
-- 
1.7.6.4




More information about the SeaBIOS mailing list