]> xenbits.xensource.com Git - people/andrewcoop/seabios.git/commitdiff
Move keyboard calling code from util.c to boot.c.
authorKevin O'Connor <kevin@koconnor.net>
Sat, 14 Sep 2013 17:09:27 +0000 (13:09 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Thu, 19 Sep 2013 00:48:34 +0000 (20:48 -0400)
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
src/boot.c
src/util.c
src/util.h

index bbe9155ff88c04399380e4950227dd8e1baede28..354228389bd3394af488922728724dbfdfc8436a 100644 (file)
@@ -1,6 +1,6 @@
 // Code to load disk image and start system boot.
 //
-// Copyright (C) 2008-2010  Kevin O'Connor <kevin@koconnor.net>
+// Copyright (C) 2008-2013  Kevin O'Connor <kevin@koconnor.net>
 // Copyright (C) 2002  MandrakeSoft S.A.
 //
 // This file may be distributed under the terms of the GNU LGPLv3 license.
@@ -395,6 +395,48 @@ boot_add_cbfs(void *data, const char *desc, int prio)
 }
 
 
+/****************************************************************
+ * Keyboard calls
+ ****************************************************************/
+
+// See if a keystroke is pending in the keyboard buffer.
+static int
+check_for_keystroke(void)
+{
+    struct bregs br;
+    memset(&br, 0, sizeof(br));
+    br.flags = F_IF|F_ZF;
+    br.ah = 1;
+    call16_int(0x16, &br);
+    return !(br.flags & F_ZF);
+}
+
+// Return a keystroke - waiting forever if necessary.
+static int
+get_raw_keystroke(void)
+{
+    struct bregs br;
+    memset(&br, 0, sizeof(br));
+    br.flags = F_IF;
+    call16_int(0x16, &br);
+    return br.ah;
+}
+
+// Read a keystroke - waiting up to 'msec' milliseconds.
+static int
+get_keystroke(int msec)
+{
+    u32 end = irqtimer_calc(msec);
+    for (;;) {
+        if (check_for_keystroke())
+            return get_raw_keystroke();
+        if (irqtimer_check(end))
+            return -1;
+        yield_toirq();
+    }
+}
+
+
 /****************************************************************
  * Boot menu and BCV execution
  ****************************************************************/
index dd7afdf9ded86f7c7fa5f3975fa2af1e43922f04..ee59b135967cb632115092218c8bcbc92881261f 100644 (file)
@@ -233,44 +233,3 @@ nullTrailingSpace(char *buf)
     while (end >= buf && *end <= ' ')
         *(end--) = '\0';
 }
-
-/****************************************************************
- * Keyboard calls
- ****************************************************************/
-
-// See if a keystroke is pending in the keyboard buffer.
-static int
-check_for_keystroke(void)
-{
-    struct bregs br;
-    memset(&br, 0, sizeof(br));
-    br.flags = F_IF|F_ZF;
-    br.ah = 1;
-    call16_int(0x16, &br);
-    return !(br.flags & F_ZF);
-}
-
-// Return a keystroke - waiting forever if necessary.
-static int
-get_raw_keystroke(void)
-{
-    struct bregs br;
-    memset(&br, 0, sizeof(br));
-    br.flags = F_IF;
-    call16_int(0x16, &br);
-    return br.ah;
-}
-
-// Read a keystroke - waiting up to 'msec' milliseconds.
-int
-get_keystroke(int msec)
-{
-    u32 end = irqtimer_calc(msec);
-    for (;;) {
-        if (check_for_keystroke())
-            return get_raw_keystroke();
-        if (irqtimer_check(end))
-            return -1;
-        yield_toirq();
-    }
-}
index 70114a6f67204218dae501976707a5da76bfa651..4fa0939565e0aaf562071a0b219a9cc27e0d2a87 100644 (file)
@@ -30,7 +30,6 @@ void *memmove(void *d, const void *s, size_t len);
 char *strtcpy(char *dest, const char *src, size_t len);
 char *strchr(const char *s, int c);
 void nullTrailingSpace(char *buf);
-int get_keystroke(int msec);
 
 // stacks.c
 extern u8 ExtraStack[], *StackPos;