Hello!

Instead of polling the keyboard all the time, grub could better set delay
100 milliseconds for getch() calls.
When a key is pressed, the timeout counter is disabled, so blocking
getch() is used after that.

ChangeLog:
        * grub/asmstub.c: Use wtimeout() instead of nodelay() to
        reduce CPU usage

Pavel Roskin
Index: grub/asmstub.c
===================================================================
RCS file: /gd/gnu/anoncvsroot/grub/grub/asmstub.c,v
retrieving revision 1.17
diff -u -r1.17 asmstub.c
--- asmstub.c   1999/06/23 00:00:47     1.17
+++ asmstub.c   1999/07/13 14:18:31
@@ -220,7 +220,7 @@
       nonl ();
       scrollok (stdscr, TRUE);
       keypad (stdscr, TRUE);
-      nodelay (stdscr, TRUE);
+      wtimeout (stdscr, 100);
     }
 #endif
 
@@ -451,9 +451,9 @@
   if (use_curses)
     {
       int c;
-      nodelay (stdscr, FALSE);
+      wtimeout (stdscr, 100);
       c = getch ();
-      nodelay (stdscr, TRUE);
+      wtimeout (stdscr, -1);
       return c;
     }
 #endif

Reply via email to