vgabios: Add VBE power management (10h) stub function.
authorKevin O'Connor <kevin@koconnor.net>
Sat, 28 Jan 2012 01:52:29 +0000 (20:52 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Thu, 2 Feb 2012 01:39:09 +0000 (20:39 -0500)
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
vgasrc/clext.c
vgasrc/vbe.c

index 064075294b699cd640abe460c5d4d3e493592e0f..45fab80c8adc28687d488a3d12ec4c35cbd45364 100644 (file)
@@ -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)
 {
@@ -612,59 +623,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
  ****************************************************************/
index 9e1fe1c2f65e557e41cb3a0227c2162a6e4e2741..c1b03f0aff7d1b9cff37bd5d0b926fe8cba0da47 100644 (file)
@@ -320,6 +320,26 @@ vbe_104f0a(struct bregs *regs)
     regs->ax = 0x0100;
 }
 
+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)
 {
@@ -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;
     }
 }