]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2002-07-03 Yoshinori K. Okuji <okuji@enbug.org>
authorokuji <okuji@localhost>
Tue, 2 Jul 2002 23:39:14 +0000 (23:39 +0000)
committerokuji <okuji@localhost>
Tue, 2 Jul 2002 23:39:14 +0000 (23:39 +0000)
* stage2/serial.c [!GRUB_UTIL] (inb): Added a delay into this
function itself.
[!GRUB_UTIL] (outb): Likewise.
[!GRUB_UTIL] (serial_hw_put): Increase the timeout value, and
don't call serial_hw_delay explicitly any longer.
(fill_input_buf): Increase the maximum number of retries, reset
the counter to zero after getting a valid character, and don't
call serial_hw_delay explicitly any longer.

ChangeLog
stage2/serial.c

index 32d5345f6014372cfe490b3d4bff52c62563c7e2..75a2170df333b225b19709104833b8e92d5a4d87 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2002-07-03  Yoshinori K. Okuji  <okuji@enbug.org>
+
+       * stage2/serial.c [!GRUB_UTIL] (inb): Added a delay into this
+       function itself.
+       [!GRUB_UTIL] (outb): Likewise.
+       [!GRUB_UTIL] (serial_hw_put): Increase the timeout value, and
+       don't call serial_hw_delay explicitly any longer.
+       (fill_input_buf): Increase the maximum number of retries, reset
+       the counter to zero after getting a valid character, and don't
+       call serial_hw_delay explicitly any longer.
+
 2002-07-03  Yoshinori K. Okuji  <okuji@enbug.org>
 
        * stage2/serial.c [!GRUB_UTIL] (serial_hw_fetch): Fixed a typo.
index 5b7d9a3aaa6733e65e8780ccd4fce3d8aabbcca3..4637231e6bbce997df459e327bb3ada2610bae35 100644 (file)
@@ -64,8 +64,10 @@ static inline unsigned char
 inb (unsigned short port)
 {
   unsigned char value;
-  
+
   asm volatile ("inb   %w1, %0" : "=a" (value) : "Nd" (port));
+  asm volatile ("outb  %%al, $0x80" : : );
+  
   return value;
 }
 
@@ -74,6 +76,7 @@ static inline void
 outb (unsigned short port, unsigned char value)
 {
   asm volatile ("outb  %b0, %w1" : : "a" (value), "Nd" (port));
+  asm volatile ("outb  %%al, $0x80" : : );
 }
 
 /* Fetch a key.  */
@@ -90,7 +93,7 @@ serial_hw_fetch (void)
 void
 serial_hw_put (int c)
 {
-  int timeout = 10000;
+  int timeout = 100000;
 
   /* Wait until the transmitter holding register is empty.  */
   while ((inb (serial_hw_port + UART_LSR) & UART_EMPTY_TRANSMITTER) == 0)
@@ -98,11 +101,8 @@ serial_hw_put (int c)
       if (--timeout == 0)
        /* There is something wrong. But what can I do?  */
        return;
-      
-      /* Insert a delay.  */
-      serial_hw_delay ();
     }
-  
+
   outb (serial_hw_port + UART_TX, c);
 }
 
@@ -263,17 +263,19 @@ static
 int fill_input_buf (void)
 {
   int i;
-  
-  for (i = 0; i < 1000 && npending < sizeof (input_buf); i++)
+
+  for (i = 0; i < 10000 && npending < sizeof (input_buf); i++)
     {
       int c;
 
       c = serial_hw_fetch ();
       if (c >= 0)
-       input_buf[npending++] = c;
+       {
+         input_buf[npending++] = c;
 
-      /* Insert a delay.  */
-      serial_hw_delay ();
+         /* Reset the counter to zero, to wait for the same interval.  */
+         i = 0;
+       }
     }
 
   /* Translate some key sequences.  */