Changeset ccd1a14 in mainline


Ignore:
Timestamp:
2009-04-25T11:54:17Z (15 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9701d49
Parents:
ebfabf6
Message:

Stop userspace kbd driver from polling when switching to kcon. Also, fix swapped reversed enabling/disabling of polling in kernel sgcn and ski drivers.

Files:
15 edited

Legend:

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

    rebfabf6 rccd1a14  
    216216void ski_kbd_grab(void)
    217217{
     218        kbd_disabled = false;
     219}
     220
     221void ski_kbd_release(void)
     222{
    218223        kbd_disabled = true;
    219224}
    220225
    221 void ski_kbd_release(void)
    222 {
    223         kbd_disabled = false;
    224 }
    225 
    226226/** @}
    227227 */
  • kernel/arch/sparc64/src/drivers/sgcn.c

    rebfabf6 rccd1a14  
    280280void sgcn_grab(void)
    281281{
    282         kbd_disabled = true;
     282        kbd_disabled = false;
    283283}
    284284
  • uspace/srv/console/console.c

    rebfabf6 rccd1a14  
    6565int prev_console = 0;
    6666
     67/** Phone to the keyboard driver. */
     68static int kbd_phone;
     69
    6770/** Information about framebuffer */
    6871struct {
     
    150153{
    151154        ipc_call_sync_0_0(fb_info.phone, FB_SCREEN_RECLAIM);
     155}
     156
     157static void kbd_yield(void)
     158{
     159        ipc_call_sync_0_0(kbd_phone, KBD_YIELD);
     160}
     161
     162static void kbd_reclaim(void)
     163{
     164        ipc_call_sync_0_0(kbd_phone, KBD_RECLAIM);
    152165}
    153166
     
    342355                gcons_in_kernel();
    343356                screen_yield();
     357                kbd_yield();
    344358                async_serialize_end();
    345359
     
    357371                if (active_console == KERNEL_CONSOLE) {
    358372                        screen_reclaim();
     373                        kbd_reclaim();
    359374                        gcons_redraw_console();
    360375                }
     
    666681       
    667682        ipcarg_t phonehash;
    668         int kbd_phone;
    669683        size_t ib_size;
    670684        int i;
  • uspace/srv/kbd/generic/kbd.c

    rebfabf6 rccd1a14  
    194194                        retval = 0;
    195195                        break;
     196                case KBD_YIELD:
     197                        kbd_port_yield();
     198                        retval = 0;
     199                        break;
     200                case KBD_RECLAIM:
     201                        kbd_port_reclaim();
     202                        retval = 0;
     203                        break;
    196204                default:
    197205                        retval = EINVAL;
  • uspace/srv/kbd/include/kbd.h

    rebfabf6 rccd1a14  
    3939
    4040#include <key_buffer.h>
     41#include <ipc/ipc.h>
    4142
    4243#define KBD_EVENT       1024
     
    4546#define KBD_MS_MIDDLE   1027
    4647#define KBD_MS_MOVE     1028
     48
     49typedef enum {
     50        KBD_YIELD       = IPC_FIRST_USER_METHOD,
     51        KBD_RECLAIM
     52} kbd_request_t;
    4753
    4854extern int cir_service;
  • uspace/srv/kbd/include/kbd_port.h

    rebfabf6 rccd1a14  
    3939
    4040extern int kbd_port_init(void);
     41extern void kbd_port_yield(void);
     42extern void kbd_port_reclaim(void);
    4143
    4244#endif
  • uspace/srv/kbd/port/dummy.c

    rebfabf6 rccd1a14  
    4343}
    4444
     45void kbd_port_yield(void)
     46{
     47}
     48
     49void kbd_port_reclaim(void)
     50{
     51}
     52
    4553/** @}
    4654*/
  • uspace/srv/kbd/port/gxemul.c

    rebfabf6 rccd1a14  
    7070}
    7171
     72void kbd_port_yield(void)
     73{
     74}
     75
     76void kbd_port_reclaim(void)
     77{
     78}
     79
    7280/** Process data sent when a key is pressed.
    7381 * 
  • uspace/srv/kbd/port/i8042.c

    rebfabf6 rccd1a14  
    152152}
    153153
     154void kbd_port_yield(void)
     155{
     156}
     157
     158void kbd_port_reclaim(void)
     159{
     160}
     161
    154162static void i8042_irq_handler(ipc_callid_t iid, ipc_call_t *call)
    155163{
  • uspace/srv/kbd/port/msim.c

    rebfabf6 rccd1a14  
    7070}
    7171
     72void kbd_port_yield(void)
     73{
     74}
     75
     76void kbd_port_reclaim(void)
     77{
     78}
     79
    7280static void msim_irq_handler(ipc_callid_t iid, ipc_call_t *call)
    7381{
    7482        int scan_code = IPC_GET_ARG2(*call);
    75 //      static int esc_count=0;
    76 
    77 //      if (scan_code == 0x1b) {
    78 //              esc_count++;
    79 //              if (esc_count == 3)
    80 //                      __SYSCALL0(SYS_DEBUG_ENABLE_CONSOLE);
    81 //      } else {
    82 //              esc_count=0;
    83 //      }
    84 
    85 //      if (fb_fb)
    86 //              return kbd_arch_process_fb(keybuffer, scan_code);
    87 
    8883        kbd_push_scancode(scan_code);
    8984}
  • uspace/srv/kbd/port/ns16550.c

    rebfabf6 rccd1a14  
    107107}
    108108
     109void ns16550_port_yield(void)
     110{
     111}
     112
     113void ns16550_port_reclaim(void)
     114{
     115}
     116
    109117static void ns16550_irq_handler(ipc_callid_t iid, ipc_call_t *call)
    110118{
  • uspace/srv/kbd/port/sgcn.c

    rebfabf6 rccd1a14  
    121121}
    122122
     123void kbd_port_yield(void)
     124{
     125}
     126
     127void kbd_port_reclaim(void)
     128{
     129}
     130
    123131/**
    124132 * Handler of the "key pressed" event. Reads codes of all the pressed keys from
  • uspace/srv/kbd/port/ski.c

    rebfabf6 rccd1a14  
    4343#include <sys/types.h>
    4444#include <thread.h>
     45#include <bool.h>
    4546
    4647#define SKI_GETCHAR             21
     
    5051static void *ski_thread_impl(void *arg);
    5152static int32_t ski_getchar(void);
     53
     54static volatile bool polling_disabled = false;
    5255
    5356/** Initialize Ski port driver. */
     
    6568}
    6669
     70void kbd_port_yield(void)
     71{
     72        polling_disabled = true;
     73}
     74
     75void kbd_port_reclaim(void)
     76{
     77        polling_disabled = false;
     78}
     79
    6780/** Thread to poll Ski for keypresses. */
    6881static void *ski_thread_impl(void *arg)
     
    7285
    7386        while (1) {
    74                 while (1) {
     87                while (polling_disabled == false) {
    7588                        c = ski_getchar();
    7689                        if (c == 0)
  • uspace/srv/kbd/port/sun.c

    rebfabf6 rccd1a14  
    6363}
    6464
     65void kbd_port_yield(void)
     66{
     67}
     68
     69void kbd_port_reclaim(void)
     70{
     71}
     72
    6573/** @}
    6674*/
  • uspace/srv/kbd/port/z8530.c

    rebfabf6 rccd1a14  
    9696}
    9797
     98void z8530_port_yield(void)
     99{
     100}
     101
     102void z8530_port_reclaim(void)
     103{
     104}
     105
    98106static void z8530_irq_handler(ipc_callid_t iid, ipc_call_t *call)
    99107{
Note: See TracChangeset for help on using the changeset viewer.