Changeset f0450658 in mainline


Ignore:
Timestamp:
2006-10-19T18:07:18Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8cee705
Parents:
3dea17f
Message:

ia64 work.
Move keyboard polling to a dedicated kernel thread.
Console initialization and console related sysinfo setup
can be now done in a single function.

Location:
kernel/arch/ia64
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia64/include/ski/ski.h

    r3dea17f rf0450658  
    4646
    4747extern void ski_init_console(void);
    48 extern void ski_set_console_sysinfo(void);
    49 extern void poll_keyboard(void);
    5048
    5149extern void ski_kbd_grab(void);
    5250extern void ski_kbd_release(void);
     51
     52extern void kkbdpoll(void *arg);
    5353
    5454#endif
  • kernel/arch/ia64/src/drivers/it.c

    r3dea17f rf0450658  
    3636 
    3737#include <arch/drivers/it.h>
    38 #include <arch/ski/ski.h>
    3938#include <arch/interrupt.h>
    4039#include <arch/register.h>
     
    117116       
    118117        clock();
    119        
    120         /*
    121          * This one is a good candidate for moving to a separate
    122          * kernel thread private to ski.c
    123          */
    124         poll_keyboard();
    125118}
    126119
  • kernel/arch/ia64/src/ia64.c

    r3dea17f rf0450658  
    8787        ski_init_console();
    8888        it_init();     
    89         ski_set_console_sysinfo();
    9089}
    9190
     
    10099void arch_post_smp_init(void)
    101100{
     101        thread_t *t;
     102
     103        if (config.cpu_active == 1) {
     104                /*
     105                 * Create thread that polls keyboard.
     106                 */
     107                t = thread_create(kkbdpoll, NULL, TASK, 0, "kkbdpoll");
     108                if (!t)
     109                        panic("cannot create kkbdpoll\n");
     110                thread_ready(t);
     111        }
    102112}
    103113
  • kernel/arch/ia64/src/ski/ski.c

    r3dea17f rf0450658  
    4343#include <ddi/irq.h>
    4444#include <ipc/irq.h>
     45#include <proc/thread.h>
    4546#include <synch/spinlock.h>
    4647#include <arch/asm.h>
     
    124125
    125126/** Ask keyboard if a key was pressed. */
    126 void poll_keyboard(void)
     127static void poll_keyboard(void)
    127128{
    128129        char ch;
     
    225226        irq_register(&ski_kbd_irq);
    226227
    227 }
    228 
    229 /** Setup console sysinfo (i.e. Keyboard IRQ)
    230  *
    231  * Because sysinfo neads memory allocation/dealocation
    232  * this functions should be called separetely from init.
    233  *
    234  */
    235 void ski_set_console_sysinfo(void)
    236 {
    237228        sysinfo_set_item_val("kbd", NULL, true);
    238229        sysinfo_set_item_val("kbd.inr", NULL, SKI_KBD_INR);
     
    259250}
    260251
     252
     253#define POLL_INTERVAL           50000           /* 50 ms */
     254
     255/** Kernel thread for polling keyboard. */
     256void kkbdpoll(void *arg)
     257{
     258        while (1) {
     259                poll_keyboard();
     260                thread_usleep(POLL_INTERVAL);
     261        }
     262}
     263
    261264/** @}
    262265 */
Note: See TracChangeset for help on using the changeset viewer.