aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/keyboard.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2006-10-05 09:55:46 -0400
committerDavid Howells <dhowells@warthog.cambridge.redhat.com>2006-10-05 10:10:12 -0400
commit7d12e780e003f93433d49ce78cfedf4b4c52adc5 (patch)
tree6748550400445c11a306b132009f3001e3525df8 /drivers/char/keyboard.c
parentda482792a6d1a3fbaaa25fae867b343fb4db3246 (diff)
IRQ: Maintain regs pointer globally rather than passing to IRQ handlers
Maintain a per-CPU global "struct pt_regs *" variable which can be used instead of passing regs around manually through all ~1800 interrupt handlers in the Linux kernel. The regs pointer is used in few places, but it potentially costs both stack space and code to pass it around. On the FRV arch, removing the regs parameter from all the genirq function results in a 20% speed up of the IRQ exit path (ie: from leaving timer_interrupt() to leaving do_IRQ()). Where appropriate, an arch may override the generic storage facility and do something different with the variable. On FRV, for instance, the address is maintained in GR28 at all times inside the kernel as part of general exception handling. Having looked over the code, it appears that the parameter may be handed down through up to twenty or so layers of functions. Consider a USB character device attached to a USB hub, attached to a USB controller that posts its interrupts through a cascaded auxiliary interrupt controller. A character device driver may want to pass regs to the sysrq handler through the input layer which adds another few layers of parameter passing. I've build this code with allyesconfig for x86_64 and i386. I've runtested the main part of the code on FRV and i386, though I can't test most of the drivers. I've also done partial conversion for powerpc and MIPS - these at least compile with minimal configurations. This will affect all archs. Mostly the changes should be relatively easy. Take do_IRQ(), store the regs pointer at the beginning, saving the old one: struct pt_regs *old_regs = set_irq_regs(regs); And put the old one back at the end: set_irq_regs(old_regs); Don't pass regs through to generic_handle_irq() or __do_IRQ(). In timer_interrupt(), this sort of change will be necessary: - update_process_times(user_mode(regs)); - profile_tick(CPU_PROFILING, regs); + update_process_times(user_mode(get_irq_regs())); + profile_tick(CPU_PROFILING); I'd like to move update_process_times()'s use of get_irq_regs() into itself, except that i386, alone of the archs, uses something other than user_mode(). Some notes on the interrupt handling in the drivers: (*) input_dev() is now gone entirely. The regs pointer is no longer stored in the input_dev struct. (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does something different depending on whether it's been supplied with a regs pointer or not. (*) Various IRQ handler function pointers have been moved to type irq_handler_t. Signed-Off-By: David Howells <dhowells@redhat.com> (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
Diffstat (limited to 'drivers/char/keyboard.c')
-rw-r--r--drivers/char/keyboard.c135
1 files changed, 68 insertions, 67 deletions
diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c
index e2011669c7bb..20b6c8b30248 100644
--- a/drivers/char/keyboard.c
+++ b/drivers/char/keyboard.c
@@ -32,6 +32,7 @@
32#include <linux/string.h> 32#include <linux/string.h>
33#include <linux/init.h> 33#include <linux/init.h>
34#include <linux/slab.h> 34#include <linux/slab.h>
35#include <linux/irq.h>
35 36
36#include <linux/kbd_kern.h> 37#include <linux/kbd_kern.h>
37#include <linux/kbd_diacr.h> 38#include <linux/kbd_diacr.h>
@@ -77,7 +78,7 @@ void compute_shiftstate(void);
77 k_slock, k_dead2, k_brl, k_ignore 78 k_slock, k_dead2, k_brl, k_ignore
78 79
79typedef void (k_handler_fn)(struct vc_data *vc, unsigned char value, 80typedef void (k_handler_fn)(struct vc_data *vc, unsigned char value,
80 char up_flag, struct pt_regs *regs); 81 char up_flag);
81static k_handler_fn K_HANDLERS; 82static k_handler_fn K_HANDLERS;
82static k_handler_fn *k_handler[16] = { K_HANDLERS }; 83static k_handler_fn *k_handler[16] = { K_HANDLERS };
83 84
@@ -88,7 +89,7 @@ static k_handler_fn *k_handler[16] = { K_HANDLERS };
88 fn_boot_it, fn_caps_on, fn_compose, fn_SAK,\ 89 fn_boot_it, fn_caps_on, fn_compose, fn_SAK,\
89 fn_dec_console, fn_inc_console, fn_spawn_con, fn_bare_num 90 fn_dec_console, fn_inc_console, fn_spawn_con, fn_bare_num
90 91
91typedef void (fn_handler_fn)(struct vc_data *vc, struct pt_regs *regs); 92typedef void (fn_handler_fn)(struct vc_data *vc);
92static fn_handler_fn FN_HANDLERS; 93static fn_handler_fn FN_HANDLERS;
93static fn_handler_fn *fn_handler[] = { FN_HANDLERS }; 94static fn_handler_fn *fn_handler[] = { FN_HANDLERS };
94 95
@@ -428,7 +429,7 @@ static unsigned int handle_diacr(struct vc_data *vc, unsigned int ch)
428/* 429/*
429 * Special function handlers 430 * Special function handlers
430 */ 431 */
431static void fn_enter(struct vc_data *vc, struct pt_regs *regs) 432static void fn_enter(struct vc_data *vc)
432{ 433{
433 if (diacr) { 434 if (diacr) {
434 if (kbd->kbdmode == VC_UNICODE) 435 if (kbd->kbdmode == VC_UNICODE)
@@ -442,27 +443,28 @@ static void fn_enter(struct vc_data *vc, struct pt_regs *regs)
442 put_queue(vc, 10); 443 put_queue(vc, 10);
443} 444}
444 445
445static void fn_caps_toggle(struct vc_data *vc, struct pt_regs *regs) 446static void fn_caps_toggle(struct vc_data *vc)
446{ 447{
447 if (rep) 448 if (rep)
448 return; 449 return;
449 chg_vc_kbd_led(kbd, VC_CAPSLOCK); 450 chg_vc_kbd_led(kbd, VC_CAPSLOCK);
450} 451}
451 452
452static void fn_caps_on(struct vc_data *vc, struct pt_regs *regs) 453static void fn_caps_on(struct vc_data *vc)
453{ 454{
454 if (rep) 455 if (rep)
455 return; 456 return;
456 set_vc_kbd_led(kbd, VC_CAPSLOCK); 457 set_vc_kbd_led(kbd, VC_CAPSLOCK);
457} 458}
458 459
459static void fn_show_ptregs(struct vc_data *vc, struct pt_regs *regs) 460static void fn_show_ptregs(struct vc_data *vc)
460{ 461{
462 struct pt_regs *regs = get_irq_regs();
461 if (regs) 463 if (regs)
462 show_regs(regs); 464 show_regs(regs);
463} 465}
464 466
465static void fn_hold(struct vc_data *vc, struct pt_regs *regs) 467static void fn_hold(struct vc_data *vc)
466{ 468{
467 struct tty_struct *tty = vc->vc_tty; 469 struct tty_struct *tty = vc->vc_tty;
468 470
@@ -480,12 +482,12 @@ static void fn_hold(struct vc_data *vc, struct pt_regs *regs)
480 stop_tty(tty); 482 stop_tty(tty);
481} 483}
482 484
483static void fn_num(struct vc_data *vc, struct pt_regs *regs) 485static void fn_num(struct vc_data *vc)
484{ 486{
485 if (vc_kbd_mode(kbd,VC_APPLIC)) 487 if (vc_kbd_mode(kbd,VC_APPLIC))
486 applkey(vc, 'P', 1); 488 applkey(vc, 'P', 1);
487 else 489 else
488 fn_bare_num(vc, regs); 490 fn_bare_num(vc);
489} 491}
490 492
491/* 493/*
@@ -494,19 +496,19 @@ static void fn_num(struct vc_data *vc, struct pt_regs *regs)
494 * Bind this to NumLock if you prefer that the NumLock key always 496 * Bind this to NumLock if you prefer that the NumLock key always
495 * changes the NumLock flag. 497 * changes the NumLock flag.
496 */ 498 */
497static void fn_bare_num(struct vc_data *vc, struct pt_regs *regs) 499static void fn_bare_num(struct vc_data *vc)
498{ 500{
499 if (!rep) 501 if (!rep)
500 chg_vc_kbd_led(kbd, VC_NUMLOCK); 502 chg_vc_kbd_led(kbd, VC_NUMLOCK);
501} 503}
502 504
503static void fn_lastcons(struct vc_data *vc, struct pt_regs *regs) 505static void fn_lastcons(struct vc_data *vc)
504{ 506{
505 /* switch to the last used console, ChN */ 507 /* switch to the last used console, ChN */
506 set_console(last_console); 508 set_console(last_console);
507} 509}
508 510
509static void fn_dec_console(struct vc_data *vc, struct pt_regs *regs) 511static void fn_dec_console(struct vc_data *vc)
510{ 512{
511 int i, cur = fg_console; 513 int i, cur = fg_console;
512 514
@@ -523,7 +525,7 @@ static void fn_dec_console(struct vc_data *vc, struct pt_regs *regs)
523 set_console(i); 525 set_console(i);
524} 526}
525 527
526static void fn_inc_console(struct vc_data *vc, struct pt_regs *regs) 528static void fn_inc_console(struct vc_data *vc)
527{ 529{
528 int i, cur = fg_console; 530 int i, cur = fg_console;
529 531
@@ -540,7 +542,7 @@ static void fn_inc_console(struct vc_data *vc, struct pt_regs *regs)
540 set_console(i); 542 set_console(i);
541} 543}
542 544
543static void fn_send_intr(struct vc_data *vc, struct pt_regs *regs) 545static void fn_send_intr(struct vc_data *vc)
544{ 546{
545 struct tty_struct *tty = vc->vc_tty; 547 struct tty_struct *tty = vc->vc_tty;
546 548
@@ -550,37 +552,37 @@ static void fn_send_intr(struct vc_data *vc, struct pt_regs *regs)
550 con_schedule_flip(tty); 552 con_schedule_flip(tty);
551} 553}
552 554
553static void fn_scroll_forw(struct vc_data *vc, struct pt_regs *regs) 555static void fn_scroll_forw(struct vc_data *vc)
554{ 556{
555 scrollfront(vc, 0); 557 scrollfront(vc, 0);
556} 558}
557 559
558static void fn_scroll_back(struct vc_data *vc, struct pt_regs *regs) 560static void fn_scroll_back(struct vc_data *vc)
559{ 561{
560 scrollback(vc, 0); 562 scrollback(vc, 0);
561} 563}
562 564
563static void fn_show_mem(struct vc_data *vc, struct pt_regs *regs) 565static void fn_show_mem(struct vc_data *vc)
564{ 566{
565 show_mem(); 567 show_mem();
566} 568}
567 569
568static void fn_show_state(struct vc_data *vc, struct pt_regs *regs) 570static void fn_show_state(struct vc_data *vc)
569{ 571{
570 show_state(); 572 show_state();
571} 573}
572 574
573static void fn_boot_it(struct vc_data *vc, struct pt_regs *regs) 575static void fn_boot_it(struct vc_data *vc)
574{ 576{
575 ctrl_alt_del(); 577 ctrl_alt_del();
576} 578}
577 579
578static void fn_compose(struct vc_data *vc, struct pt_regs *regs) 580static void fn_compose(struct vc_data *vc)
579{ 581{
580 dead_key_next = 1; 582 dead_key_next = 1;
581} 583}
582 584
583static void fn_spawn_con(struct vc_data *vc, struct pt_regs *regs) 585static void fn_spawn_con(struct vc_data *vc)
584{ 586{
585 spin_lock(&vt_spawn_con.lock); 587 spin_lock(&vt_spawn_con.lock);
586 if (vt_spawn_con.pid) 588 if (vt_spawn_con.pid)
@@ -591,7 +593,7 @@ static void fn_spawn_con(struct vc_data *vc, struct pt_regs *regs)
591 spin_unlock(&vt_spawn_con.lock); 593 spin_unlock(&vt_spawn_con.lock);
592} 594}
593 595
594static void fn_SAK(struct vc_data *vc, struct pt_regs *regs) 596static void fn_SAK(struct vc_data *vc)
595{ 597{
596 struct tty_struct *tty = vc->vc_tty; 598 struct tty_struct *tty = vc->vc_tty;
597 599
@@ -604,7 +606,7 @@ static void fn_SAK(struct vc_data *vc, struct pt_regs *regs)
604 reset_vc(vc); 606 reset_vc(vc);
605} 607}
606 608
607static void fn_null(struct vc_data *vc, struct pt_regs *regs) 609static void fn_null(struct vc_data *vc)
608{ 610{
609 compute_shiftstate(); 611 compute_shiftstate();
610} 612}
@@ -612,11 +614,11 @@ static void fn_null(struct vc_data *vc, struct pt_regs *regs)
612/* 614/*
613 * Special key handlers 615 * Special key handlers
614 */ 616 */
615static void k_ignore(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs) 617static void k_ignore(struct vc_data *vc, unsigned char value, char up_flag)
616{ 618{
617} 619}
618 620
619static void k_spec(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs) 621static void k_spec(struct vc_data *vc, unsigned char value, char up_flag)
620{ 622{
621 if (up_flag) 623 if (up_flag)
622 return; 624 return;
@@ -626,15 +628,15 @@ static void k_spec(struct vc_data *vc, unsigned char value, char up_flag, struct
626 kbd->kbdmode == VC_MEDIUMRAW) && 628 kbd->kbdmode == VC_MEDIUMRAW) &&
627 value != KVAL(K_SAK)) 629 value != KVAL(K_SAK))
628 return; /* SAK is allowed even in raw mode */ 630 return; /* SAK is allowed even in raw mode */
629 fn_handler[value](vc, regs); 631 fn_handler[value](vc);
630} 632}
631 633
632static void k_lowercase(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs) 634static void k_lowercase(struct vc_data *vc, unsigned char value, char up_flag)
633{ 635{
634 printk(KERN_ERR "keyboard.c: k_lowercase was called - impossible\n"); 636 printk(KERN_ERR "keyboard.c: k_lowercase was called - impossible\n");
635} 637}
636 638
637static void k_unicode(struct vc_data *vc, unsigned int value, char up_flag, struct pt_regs *regs) 639static void k_unicode(struct vc_data *vc, unsigned int value, char up_flag)
638{ 640{
639 if (up_flag) 641 if (up_flag)
640 return; /* no action, if this is a key release */ 642 return; /* no action, if this is a key release */
@@ -658,41 +660,41 @@ static void k_unicode(struct vc_data *vc, unsigned int value, char up_flag, stru
658 * dead keys modifying the same character. Very useful 660 * dead keys modifying the same character. Very useful
659 * for Vietnamese. 661 * for Vietnamese.
660 */ 662 */
661static void k_deadunicode(struct vc_data *vc, unsigned int value, char up_flag, struct pt_regs *regs) 663static void k_deadunicode(struct vc_data *vc, unsigned int value, char up_flag)
662{ 664{
663 if (up_flag) 665 if (up_flag)
664 return; 666 return;
665 diacr = (diacr ? handle_diacr(vc, value) : value); 667 diacr = (diacr ? handle_diacr(vc, value) : value);
666} 668}
667 669
668static void k_self(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs) 670static void k_self(struct vc_data *vc, unsigned char value, char up_flag)
669{ 671{
670 k_unicode(vc, value, up_flag, regs); 672 k_unicode(vc, value, up_flag);
671} 673}
672 674
673static void k_dead2(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs) 675static void k_dead2(struct vc_data *vc, unsigned char value, char up_flag)
674{ 676{
675 k_deadunicode(vc, value, up_flag, regs); 677 k_deadunicode(vc, value, up_flag);
676} 678}
677 679
678/* 680/*
679 * Obsolete - for backwards compatibility only 681 * Obsolete - for backwards compatibility only
680 */ 682 */
681static void k_dead(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs) 683static void k_dead(struct vc_data *vc, unsigned char value, char up_flag)
682{ 684{
683 static const unsigned char ret_diacr[NR_DEAD] = {'`', '\'', '^', '~', '"', ',' }; 685 static const unsigned char ret_diacr[NR_DEAD] = {'`', '\'', '^', '~', '"', ',' };
684 value = ret_diacr[value]; 686 value = ret_diacr[value];
685 k_deadunicode(vc, value, up_flag, regs); 687 k_deadunicode(vc, value, up_flag);
686} 688}
687 689
688static void k_cons(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs) 690static void k_cons(struct vc_data *vc, unsigned char value, char up_flag)
689{ 691{
690 if (up_flag) 692 if (up_flag)
691 return; 693 return;
692 set_console(value); 694 set_console(value);
693} 695}
694 696
695static void k_fn(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs) 697static void k_fn(struct vc_data *vc, unsigned char value, char up_flag)
696{ 698{
697 unsigned v; 699 unsigned v;
698 700
@@ -706,7 +708,7 @@ static void k_fn(struct vc_data *vc, unsigned char value, char up_flag, struct p
706 printk(KERN_ERR "k_fn called with value=%d\n", value); 708 printk(KERN_ERR "k_fn called with value=%d\n", value);
707} 709}
708 710
709static void k_cur(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs) 711static void k_cur(struct vc_data *vc, unsigned char value, char up_flag)
710{ 712{
711 static const char *cur_chars = "BDCA"; 713 static const char *cur_chars = "BDCA";
712 714
@@ -715,7 +717,7 @@ static void k_cur(struct vc_data *vc, unsigned char value, char up_flag, struct
715 applkey(vc, cur_chars[value], vc_kbd_mode(kbd, VC_CKMODE)); 717 applkey(vc, cur_chars[value], vc_kbd_mode(kbd, VC_CKMODE));
716} 718}
717 719
718static void k_pad(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs) 720static void k_pad(struct vc_data *vc, unsigned char value, char up_flag)
719{ 721{
720 static const char pad_chars[] = "0123456789+-*/\015,.?()#"; 722 static const char pad_chars[] = "0123456789+-*/\015,.?()#";
721 static const char app_map[] = "pqrstuvwxylSRQMnnmPQS"; 723 static const char app_map[] = "pqrstuvwxylSRQMnnmPQS";
@@ -733,34 +735,34 @@ static void k_pad(struct vc_data *vc, unsigned char value, char up_flag, struct
733 switch (value) { 735 switch (value) {
734 case KVAL(K_PCOMMA): 736 case KVAL(K_PCOMMA):
735 case KVAL(K_PDOT): 737 case KVAL(K_PDOT):
736 k_fn(vc, KVAL(K_REMOVE), 0, regs); 738 k_fn(vc, KVAL(K_REMOVE), 0);
737 return; 739 return;
738 case KVAL(K_P0): 740 case KVAL(K_P0):
739 k_fn(vc, KVAL(K_INSERT), 0, regs); 741 k_fn(vc, KVAL(K_INSERT), 0);
740 return; 742 return;
741 case KVAL(K_P1): 743 case KVAL(K_P1):
742 k_fn(vc, KVAL(K_SELECT), 0, regs); 744 k_fn(vc, KVAL(K_SELECT), 0);
743 return; 745 return;
744 case KVAL(K_P2): 746 case KVAL(K_P2):
745 k_cur(vc, KVAL(K_DOWN), 0, regs); 747 k_cur(vc, KVAL(K_DOWN), 0);
746 return; 748 return;
747 case KVAL(K_P3): 749 case KVAL(K_P3):
748 k_fn(vc, KVAL(K_PGDN), 0, regs); 750 k_fn(vc, KVAL(K_PGDN), 0);
749 return; 751 return;
750 case KVAL(K_P4): 752 case KVAL(K_P4):
751 k_cur(vc, KVAL(K_LEFT), 0, regs); 753 k_cur(vc, KVAL(K_LEFT), 0);
752 return; 754 return;
753 case KVAL(K_P6): 755 case KVAL(K_P6):
754 k_cur(vc, KVAL(K_RIGHT), 0, regs); 756 k_cur(vc, KVAL(K_RIGHT), 0);
755 return; 757 return;
756 case KVAL(K_P7): 758 case KVAL(K_P7):
757 k_fn(vc, KVAL(K_FIND), 0, regs); 759 k_fn(vc, KVAL(K_FIND), 0);
758 return; 760 return;
759 case KVAL(K_P8): 761 case KVAL(K_P8):
760 k_cur(vc, KVAL(K_UP), 0, regs); 762 k_cur(vc, KVAL(K_UP), 0);
761 return; 763 return;
762 case KVAL(K_P9): 764 case KVAL(K_P9):
763 k_fn(vc, KVAL(K_PGUP), 0, regs); 765 k_fn(vc, KVAL(K_PGUP), 0);
764 return; 766 return;
765 case KVAL(K_P5): 767 case KVAL(K_P5):
766 applkey(vc, 'G', vc_kbd_mode(kbd, VC_APPLIC)); 768 applkey(vc, 'G', vc_kbd_mode(kbd, VC_APPLIC));
@@ -772,7 +774,7 @@ static void k_pad(struct vc_data *vc, unsigned char value, char up_flag, struct
772 put_queue(vc, 10); 774 put_queue(vc, 10);
773} 775}
774 776
775static void k_shift(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs) 777static void k_shift(struct vc_data *vc, unsigned char value, char up_flag)
776{ 778{
777 int old_state = shift_state; 779 int old_state = shift_state;
778 780
@@ -813,7 +815,7 @@ static void k_shift(struct vc_data *vc, unsigned char value, char up_flag, struc
813 } 815 }
814} 816}
815 817
816static void k_meta(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs) 818static void k_meta(struct vc_data *vc, unsigned char value, char up_flag)
817{ 819{
818 if (up_flag) 820 if (up_flag)
819 return; 821 return;
@@ -825,7 +827,7 @@ static void k_meta(struct vc_data *vc, unsigned char value, char up_flag, struct
825 put_queue(vc, value | 0x80); 827 put_queue(vc, value | 0x80);
826} 828}
827 829
828static void k_ascii(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs) 830static void k_ascii(struct vc_data *vc, unsigned char value, char up_flag)
829{ 831{
830 int base; 832 int base;
831 833
@@ -847,16 +849,16 @@ static void k_ascii(struct vc_data *vc, unsigned char value, char up_flag, struc
847 npadch = npadch * base + value; 849 npadch = npadch * base + value;
848} 850}
849 851
850static void k_lock(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs) 852static void k_lock(struct vc_data *vc, unsigned char value, char up_flag)
851{ 853{
852 if (up_flag || rep) 854 if (up_flag || rep)
853 return; 855 return;
854 chg_vc_kbd_lock(kbd, value); 856 chg_vc_kbd_lock(kbd, value);
855} 857}
856 858
857static void k_slock(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs) 859static void k_slock(struct vc_data *vc, unsigned char value, char up_flag)
858{ 860{
859 k_shift(vc, value, up_flag, regs); 861 k_shift(vc, value, up_flag);
860 if (up_flag || rep) 862 if (up_flag || rep)
861 return; 863 return;
862 chg_vc_kbd_slock(kbd, value); 864 chg_vc_kbd_slock(kbd, value);
@@ -876,25 +878,25 @@ static unsigned brl_nbchords = 1;
876MODULE_PARM_DESC(brl_nbchords, "Number of chords that produce a braille pattern (0 for dead chords)"); 878MODULE_PARM_DESC(brl_nbchords, "Number of chords that produce a braille pattern (0 for dead chords)");
877module_param(brl_nbchords, uint, 0644); 879module_param(brl_nbchords, uint, 0644);
878 880
879static void k_brlcommit(struct vc_data *vc, unsigned int pattern, char up_flag, struct pt_regs *regs) 881static void k_brlcommit(struct vc_data *vc, unsigned int pattern, char up_flag)
880{ 882{
881 static unsigned long chords; 883 static unsigned long chords;
882 static unsigned committed; 884 static unsigned committed;
883 885
884 if (!brl_nbchords) 886 if (!brl_nbchords)
885 k_deadunicode(vc, BRL_UC_ROW | pattern, up_flag, regs); 887 k_deadunicode(vc, BRL_UC_ROW | pattern, up_flag);
886 else { 888 else {
887 committed |= pattern; 889 committed |= pattern;
888 chords++; 890 chords++;
889 if (chords == brl_nbchords) { 891 if (chords == brl_nbchords) {
890 k_unicode(vc, BRL_UC_ROW | committed, up_flag, regs); 892 k_unicode(vc, BRL_UC_ROW | committed, up_flag);
891 chords = 0; 893 chords = 0;
892 committed = 0; 894 committed = 0;
893 } 895 }
894 } 896 }
895} 897}
896 898
897static void k_brl(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs) 899static void k_brl(struct vc_data *vc, unsigned char value, char up_flag)
898{ 900{
899 static unsigned pressed,committing; 901 static unsigned pressed,committing;
900 static unsigned long releasestart; 902 static unsigned long releasestart;
@@ -906,7 +908,7 @@ static void k_brl(struct vc_data *vc, unsigned char value, char up_flag, struct
906 } 908 }
907 909
908 if (!value) { 910 if (!value) {
909 k_unicode(vc, BRL_UC_ROW, up_flag, regs); 911 k_unicode(vc, BRL_UC_ROW, up_flag);
910 return; 912 return;
911 } 913 }
912 914
@@ -923,13 +925,13 @@ static void k_brl(struct vc_data *vc, unsigned char value, char up_flag, struct
923 pressed &= ~(1 << (value - 1)); 925 pressed &= ~(1 << (value - 1));
924 if (!pressed) { 926 if (!pressed) {
925 if (committing) { 927 if (committing) {
926 k_brlcommit(vc, committing, 0, regs); 928 k_brlcommit(vc, committing, 0);
927 committing = 0; 929 committing = 0;
928 } 930 }
929 } 931 }
930 } else { 932 } else {
931 if (committing) { 933 if (committing) {
932 k_brlcommit(vc, committing, 0, regs); 934 k_brlcommit(vc, committing, 0);
933 committing = 0; 935 committing = 0;
934 } 936 }
935 pressed &= ~(1 << (value - 1)); 937 pressed &= ~(1 << (value - 1));
@@ -1133,8 +1135,7 @@ static void kbd_rawcode(unsigned char data)
1133 put_queue(vc, data); 1135 put_queue(vc, data);
1134} 1136}
1135 1137
1136static void kbd_keycode(unsigned int keycode, int down, 1138static void kbd_keycode(unsigned int keycode, int down, int hw_raw)
1137 int hw_raw, struct pt_regs *regs)
1138{ 1139{
1139 struct vc_data *vc = vc_cons[fg_console].d; 1140 struct vc_data *vc = vc_cons[fg_console].d;
1140 unsigned short keysym, *key_map; 1141 unsigned short keysym, *key_map;
@@ -1181,7 +1182,7 @@ static void kbd_keycode(unsigned int keycode, int down,
1181 if (sysrq_down && !down && keycode == sysrq_alt_use) 1182 if (sysrq_down && !down && keycode == sysrq_alt_use)
1182 sysrq_down = 0; 1183 sysrq_down = 0;
1183 if (sysrq_down && down && !rep) { 1184 if (sysrq_down && down && !rep) {
1184 handle_sysrq(kbd_sysrq_xlate[keycode], regs, tty); 1185 handle_sysrq(kbd_sysrq_xlate[keycode], tty);
1185 return; 1186 return;
1186 } 1187 }
1187#endif 1188#endif
@@ -1267,7 +1268,7 @@ static void kbd_keycode(unsigned int keycode, int down,
1267 } 1268 }
1268 } 1269 }
1269 1270
1270 (*k_handler[type])(vc, keysym & 0xff, !down, regs); 1271 (*k_handler[type])(vc, keysym & 0xff, !down);
1271 1272
1272 if (type != KT_SLOCK) 1273 if (type != KT_SLOCK)
1273 kbd->slockstate = 0; 1274 kbd->slockstate = 0;
@@ -1279,7 +1280,7 @@ static void kbd_event(struct input_handle *handle, unsigned int event_type,
1279 if (event_type == EV_MSC && event_code == MSC_RAW && HW_RAW(handle->dev)) 1280 if (event_type == EV_MSC && event_code == MSC_RAW && HW_RAW(handle->dev))
1280 kbd_rawcode(value); 1281 kbd_rawcode(value);
1281 if (event_type == EV_KEY) 1282 if (event_type == EV_KEY)
1282 kbd_keycode(event_code, value, HW_RAW(handle->dev), handle->dev->regs); 1283 kbd_keycode(event_code, value, HW_RAW(handle->dev));
1283 tasklet_schedule(&keyboard_tasklet); 1284 tasklet_schedule(&keyboard_tasklet);
1284 do_poke_blanked_console = 1; 1285 do_poke_blanked_console = 1;
1285 schedule_console_callback(); 1286 schedule_console_callback();