Changeset 66b430e in mainline for kernel/arch/ia64/src/drivers/ski.c


Ignore:
Timestamp:
2009-05-07T19:52:24Z (15 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
046f342
Parents:
386e276
Message:

Kernel Ski driver should pull more keys at a time, similarly to the user-space driver.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia64/src/drivers/ski.c

    r386e276 r66b430e  
    4545#include <arch.h>
    4646
    47 #define POLL_INTERVAL  10000  /* 10 ms */
    48 
    49 #define SKI_INIT_CONSOLE  20
    50 #define SKI_GETCHAR       21
    51 #define SKI_PUTCHAR       31
     47enum {
     48        /** Interval between polling in microseconds */
     49        POLL_INTERVAL =  10000,  /* 0.01 s */
     50
     51        /** Max. number of characters to pull out at a time */
     52        POLL_LIMIT    =     30,
     53
     54        SKI_INIT_CONSOLE  = 20,
     55        SKI_GETCHAR       = 21,
     56        SKI_PUTCHAR       = 31
     57};
    5258
    5359static void ski_putchar(outdev_t *, const wchar_t, bool);
     
    155161}
    156162
    157 /** Ask keyboard if a key was pressed. */
     163/** Ask keyboard if a key was pressed.
     164 *
     165 * If so, it will repeat and pull up to POLL_LIMIT characters.
     166 */
    158167static void poll_keyboard(ski_instance_t *instance)
    159168{
     169        wchar_t ch;
     170        int count;
     171
    160172        if (kbd_disabled)
    161173                return;
    162        
    163         wchar_t ch = ski_getchar();
    164        
    165         if (ch != 0)
     174
     175        count = POLL_LIMIT;
     176
     177        while (count > 0) {
     178                ch = ski_getchar();
     179
     180                if (ch == '\0')
     181                        break;
     182
    166183                indev_push_character(instance->srlnin, ch);
     184                --count;
     185        }
    167186}
    168187
Note: See TracChangeset for help on using the changeset viewer.