Ignore:
File:
1 edited

Legend:

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

    r63e27ef ra35b458  
    4949        /** Interval between polling in microseconds */
    5050        POLL_INTERVAL = 10000,  /* 0.01 s */
    51        
     51
    5252        /** Max. number of characters to pull out at a time */
    5353        POLL_LIMIT = 30,
    54        
     54
    5555        SKI_INIT_CONSOLE = 20,
    5656        SKI_GETCHAR      = 21,
     
    8282{
    8383        uint64_t ch;
    84        
     84
    8585        asm volatile (
    8686                "mov r15 = %1\n"
    8787                "break 0x80000;;\n"  /* modifies r8 */
    8888                "mov %0 = r8;;\n"
    89                
     89
    9090                : "=r" (ch)
    9191                : "i" (SKI_GETCHAR)
    9292                : "r15", "r8"
    9393        );
    94        
     94
    9595        return (wchar_t) ch;
    9696}
     
    103103{
    104104        int count = POLL_LIMIT;
    105        
     105
    106106        while (count > 0) {
    107107                wchar_t ch = ski_getchar();
    108                
     108
    109109                if (ch == '\0')
    110110                        break;
    111                
     111
    112112                indev_push_character(instance->srlnin, ch);
    113113                --count;
     
    119119{
    120120        ski_instance_t *instance = (ski_instance_t *) arg;
    121        
     121
    122122        while (true) {
    123123                // TODO FIXME:
     
    126126                if (console_override)
    127127                        poll_keyboard(instance);
    128                
     128
    129129                thread_usleep(POLL_INTERVAL);
    130130        }
     
    141141        if (instance)
    142142                return;
    143        
     143
    144144        asm volatile (
    145145                "mov r15 = %0\n"
     
    149149                : "r15", "r8"
    150150        );
    151        
     151
    152152        instance = malloc(sizeof(ski_instance_t), FRAME_ATOMIC);
    153        
     153
    154154        if (instance) {
    155155                instance->thread = thread_create(kskipoll, instance, TASK,
    156156                    THREAD_FLAG_UNCOUNTED, "kskipoll");
    157                
     157
    158158                if (!instance->thread) {
    159159                        free(instance);
     
    161161                        return;
    162162                }
    163                
     163
    164164                instance->srlnin = NULL;
    165165        }
     
    196196                        if (ch == '\n')
    197197                                ski_do_putchar('\r');
    198                        
     198
    199199                        ski_do_putchar(ch);
    200200                } else
     
    208208        if (!instance)
    209209                return NULL;
    210        
     210
    211211        outdev_t *skidev = malloc(sizeof(outdev_t), FRAME_ATOMIC);
    212212        if (!skidev)
    213213                return NULL;
    214        
     214
    215215        outdev_initialize("skidev", skidev, &skidev_ops);
    216216        skidev->data = instance;
    217        
     217
    218218        if (!fb_exported) {
    219219                /*
     
    224224                sysinfo_set_item_val("fb", NULL, true);
    225225                sysinfo_set_item_val("fb.kind", NULL, 6);
    226                
     226
    227227                fb_exported = true;
    228228        }
    229        
     229
    230230        return skidev;
    231231}
     
    241241        assert(instance);
    242242        assert(srlnin);
    243        
     243
    244244        instance->srlnin = srlnin;
    245245        thread_ready(instance->thread);
    246        
     246
    247247        sysinfo_set_item_val("kbd", NULL, true);
    248248        sysinfo_set_item_val("kbd.type", NULL, KBD_SKI);
Note: See TracChangeset for help on using the changeset viewer.