View | Details | Raw Unified | Return to bug 52104
Collapse All | Expand All

(-)linux-2.6.8-orig/drivers/acorn/char/defkeymap-l7200.c (-1 / +1 lines)
Lines 346-352 Link Here
346
	0,
346
	0,
347
};
347
};
348
348
349
struct kbdiacr accent_table[MAX_DIACR] = {
349
struct kbdiacruc accent_table[MAX_DIACR] = {
350
	{'`', 'A', '\300'},	{'`', 'a', '\340'},
350
	{'`', 'A', '\300'},	{'`', 'a', '\340'},
351
	{'\'', 'A', '\301'},	{'\'', 'a', '\341'},
351
	{'\'', 'A', '\301'},	{'\'', 'a', '\341'},
352
	{'^', 'A', '\302'},	{'^', 'a', '\342'},
352
	{'^', 'A', '\302'},	{'^', 'a', '\342'},
(-)linux-2.6.8-orig/drivers/char/defkeymap.c_shipped (-1 / +1 lines)
Lines 222-228 Link Here
222
	NULL,
222
	NULL,
223
};
223
};
224
224
225
struct kbdiacr accent_table[MAX_DIACR] = {
225
struct kbdiacruc accent_table[MAX_DIACR] = {
226
	{'`', 'A', '\300'},	{'`', 'a', '\340'},
226
	{'`', 'A', '\300'},	{'`', 'a', '\340'},
227
	{'\'', 'A', '\301'},	{'\'', 'a', '\341'},
227
	{'\'', 'A', '\301'},	{'\'', 'a', '\341'},
228
	{'^', 'A', '\302'},	{'^', 'a', '\342'},
228
	{'^', 'A', '\302'},	{'^', 'a', '\342'},
(-)linux-2.6.8-orig/drivers/char/keyboard.c (-10 / +24 lines)
Lines 333-339 Link Here
333
 * in utf-8 already. UTF-8 is defined for words of up to 31 bits,
333
 * in utf-8 already. UTF-8 is defined for words of up to 31 bits,
334
 * but we need only 16 bits here
334
 * but we need only 16 bits here
335
 */
335
 */
336
void to_utf8(struct vc_data *vc, ushort c) 
336
void to_utf8(struct vc_data *vc, unsigned int c) 
337
{
337
{
338
	if (c < 0x80)
338
	if (c < 0x80)
339
		/*  0******* */
339
		/*  0******* */
Lines 389-401 Link Here
389
}
389
}
390
390
391
/*
391
/*
392
 * We have a combining character DIACR here, followed by the character CH.
392
 * We have a combining character DIACR here, followed by the character CH.  If
393
 * If the combination occurs in the table, return the corresponding value.
393
 * the combination occurs in the table, return the corresponding UCS2 value.
394
 * Otherwise, if CH is a space or equals DIACR, return DIACR.
394
 * Otherwise, if CH is a space or equals DIACR, return DIACR.  Otherwise,
395
 * Otherwise, conclude that DIACR was not combining after all,
395
 * conclude that DIACR was not combining after all, queue it and return CH.
396
 * queue it and return CH.
397
 */
396
 */
398
unsigned char handle_diacr(struct vc_data *vc, unsigned char ch)
397
unsigned int handle_diacr(struct vc_data *vc, unsigned char ch)
399
{
398
{
400
	int d = diacr;
399
	int d = diacr;
401
	int i;
400
	int i;
Lines 618-628 Link Here
618
617
619
static void k_self(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs)
618
static void k_self(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs)
620
{
619
{
620
	unsigned int v;
621
622
621
	if (up_flag)
623
	if (up_flag)
622
		return;		/* no action, if this is a key release */
624
		return;		/* no action, if this is a key release */
623
625
624
	if (diacr)
626
	if (diacr) {
625
		value = handle_diacr(vc, value);
627
		v = handle_diacr(vc, value);
628
629
		if (kbd->kbdmode == VC_UNICODE) {
630
			to_utf8(vc, v & 0xFFFF);
631
			return;
632
		}
633
634
		/* 
635
		 * this makes at least latin-1 compose chars work 
636
		 * even when using unicode keymap in non-unicode mode
637
		 */
638
		value = v & 0xFF; 
639
	}
626
640
627
	if (dead_key_next) {
641
	if (dead_key_next) {
628
		dead_key_next = 0;
642
		dead_key_next = 0;
Lines 641-647 Link Here
641
{
655
{
642
	if (up_flag)
656
	if (up_flag)
643
		return;
657
		return;
644
	diacr = (diacr ? handle_diacr(vc, value) : value);
658
	diacr = (diacr ? handle_diacr(vc, value) & 0xff : value);
645
}
659
}
646
660
647
/*
661
/*
(-)linux-2.6.8-orig/drivers/char/qtronixmap.c_shipped (-1 / +1 lines)
Lines 225-231 Link Here
225
	0,
225
	0,
226
};
226
};
227
227
228
struct kbdiacr accent_table[MAX_DIACR] = {
228
struct kbdiacruc accent_table[MAX_DIACR] = {
229
	{'`', 'A', 'À'},	{'`', 'a', 'à'},
229
	{'`', 'A', 'À'},	{'`', 'a', 'à'},
230
	{'\'', 'A', 'Á'},	{'\'', 'a', 'á'},
230
	{'\'', 'A', 'Á'},	{'\'', 'a', 'á'},
231
	{'^', 'A', 'Â'},	{'^', 'a', 'â'},
231
	{'^', 'A', 'Â'},	{'^', 'a', 'â'},
(-)linux-2.6.8-orig/drivers/char/vt_ioctl.c (-2 / +44 lines)
Lines 584-600 Link Here
584
	case KDGKBDIACR:
584
	case KDGKBDIACR:
585
	{
585
	{
586
		struct kbdiacrs __user *a = up;
586
		struct kbdiacrs __user *a = up;
587
		struct kbdiacr diacr;
588
		int i;
587
589
588
		if (put_user(accent_table_size, &a->kb_cnt))
590
		if (put_user(accent_table_size, &a->kb_cnt))
589
			return -EFAULT;
591
			return -EFAULT;
590
		if (copy_to_user(a->kbdiacr, accent_table, accent_table_size*sizeof(struct kbdiacr)))
592
		for (i = 0; i < accent_table_size; i++) {
593
			diacr.diacr = accent_table[i].diacr;
594
			diacr.base = accent_table[i].base;
595
			diacr.result = accent_table[i].result> 0xff ? 0 : accent_table[i].base;
596
			if (copy_to_user(a->kbdiacr + i, &diacr, sizeof(struct kbdiacr)))
597
				return -EFAULT;
598
		}
599
		return 0;
600
	}
601
 
602
	case KDGKBDIACRUC:
603
	{
604
		struct kbdiacrsuc __user *a = up;
605
 
606
		if (put_user(accent_table_size, &a->kb_cnt))
591
			return -EFAULT;
607
			return -EFAULT;
608
		if (copy_to_user(a->kbdiacruc, accent_table, accent_table_size*sizeof(struct kbdiacruc)))
609
 			return -EFAULT;
592
		return 0;
610
		return 0;
593
	}
611
	}
594
612
595
	case KDSKBDIACR:
613
	case KDSKBDIACR:
596
	{
614
	{
597
		struct kbdiacrs __user *a = up;
615
		struct kbdiacrs __user *a = up;
616
		struct kbdiacr diacr;
617
		unsigned int ct;
618
		int i;
619
 
620
		if (!perm)
621
			return -EPERM;
622
		if (get_user(ct,&a->kb_cnt))
623
			return -EFAULT;
624
		if (ct >= MAX_DIACR)
625
			return -EINVAL;
626
		accent_table_size = ct;
627
		for (i = 0; i < ct; i++) {
628
			if (copy_from_user(&diacr, a->kbdiacr + i, sizeof(struct kbdiacr)))
629
				return -EFAULT;
630
			accent_table[i].diacr = diacr.diacr;
631
			accent_table[i].base = diacr.base;
632
			accent_table[i].result = diacr.result;
633
		}
634
		return 0;
635
	}
636
 
637
	case KDSKBDIACRUC:
638
	{
639
		struct kbdiacrsuc __user *a = up;
598
		unsigned int ct;
640
		unsigned int ct;
599
641
600
		if (!perm)
642
		if (!perm)
Lines 604-610 Link Here
604
		if (ct >= MAX_DIACR)
646
		if (ct >= MAX_DIACR)
605
			return -EINVAL;
647
			return -EINVAL;
606
		accent_table_size = ct;
648
		accent_table_size = ct;
607
		if (copy_from_user(accent_table, a->kbdiacr, ct*sizeof(struct kbdiacr)))
649
		if (copy_from_user(accent_table, a->kbdiacruc, ct*sizeof(struct kbdiacruc)))
608
			return -EFAULT;
650
			return -EFAULT;
609
		return 0;
651
		return 0;
610
	}
652
	}
(-)linux-2.6.8-orig/drivers/s390/char/defkeymap.c (-1 / +1 lines)
Lines 148-154 Link Here
148
	0,
148
	0,
149
};
149
};
150
150
151
struct kbdiacr accent_table[MAX_DIACR] = {
151
struct kbdiacruc accent_table[MAX_DIACR] = {
152
	{'^', 'c', '\003'},	{'^', 'd', '\004'},
152
	{'^', 'c', '\003'},	{'^', 'd', '\004'},
153
	{'^', 'z', '\032'},	{'^', '\012', '\000'},
153
	{'^', 'z', '\032'},	{'^', '\012', '\000'},
154
};
154
};
(-)linux-2.6.8-orig/drivers/s390/char/keyboard.c (-15 / +56 lines)
Lines 87-97 Link Here
87
		goto out_func;
87
		goto out_func;
88
	memset(kbd->fn_handler, 0, sizeof(fn_handler_fn *) * NR_FN_HANDLER);
88
	memset(kbd->fn_handler, 0, sizeof(fn_handler_fn *) * NR_FN_HANDLER);
89
	kbd->accent_table =
89
	kbd->accent_table =
90
		kmalloc(sizeof(struct kbdiacr)*MAX_DIACR, GFP_KERNEL);
90
		kmalloc(sizeof(struct kbdiacruc)*MAX_DIACR, GFP_KERNEL);
91
	if (!kbd->accent_table)
91
	if (!kbd->accent_table)
92
		goto out_fn_handler;
92
		goto out_fn_handler;
93
	memcpy(kbd->accent_table, accent_table,
93
	memcpy(kbd->accent_table, accent_table,
94
	       sizeof(struct kbdiacr)*MAX_DIACR);
94
	       sizeof(struct kbdiacruc)*MAX_DIACR);
95
	kbd->accent_table_size = accent_table_size;
95
	kbd->accent_table_size = accent_table_size;
96
	return kbd;
96
	return kbd;
97
97
Lines 464-470 Link Here
464
kbd_ioctl(struct kbd_data *kbd, struct file *file,
464
kbd_ioctl(struct kbd_data *kbd, struct file *file,
465
	  unsigned int cmd, unsigned long arg)
465
	  unsigned int cmd, unsigned long arg)
466
{
466
{
467
	struct kbdiacrs __user *a;
468
	void __user *argp;
467
	void __user *argp;
469
	int ct, perm;
468
	int ct, perm;
470
469
Lines 485-512 Link Here
485
	case KDSKBSENT:
484
	case KDSKBSENT:
486
		return do_kdgkb_ioctl(kbd, argp, cmd, perm);
485
		return do_kdgkb_ioctl(kbd, argp, cmd, perm);
487
	case KDGKBDIACR:
486
	case KDGKBDIACR:
488
		a = argp;
487
	{
489
488
		struct kbdiacrs __user *a = argp;
490
		if (put_user(kbd->accent_table_size, &a->kb_cnt))
489
		struct kbdiacr diacr;
491
			return -EFAULT;
490
		int i;
492
		ct = kbd->accent_table_size;
491
		
493
		if (copy_to_user(a->kbdiacr, kbd->accent_table,
492
		if (put_user(accent_table_size, &a->kb_cnt))
494
				 ct * sizeof(struct kbdiacr)))
495
			return -EFAULT;
493
			return -EFAULT;
494
		for (i = 0; i < accent_table_size; i++) {
495
			diacr.diacr = accent_table[i].diacr;
496
			diacr.base = accent_table[i].base;
497
			diacr.result = accent_table[i].base > 0xff ? 0 : accent_table[i].base;
498
			if (copy_to_user(a->kbdiacr + i, &diacr, sizeof(struct kbdiacr)))
499
				return -EFAULT;
500
		}
496
		return 0;
501
		return 0;
502
	}
503
	case KDGKBDIACRUC:
504
	{
505
		struct kbdiacrsuc __user *a = argp;
506
 
507
		if (put_user(accent_table_size, &a->kb_cnt))
508
			return -EFAULT;
509
		if (copy_to_user(a->kbdiacruc, accent_table, accent_table_size*sizeof(struct kbdiacruc)))
510
			return -EFAULT;
511
 		return 0;
512
	}
497
	case KDSKBDIACR:
513
	case KDSKBDIACR:
498
		a = argp;
514
	{
515
		struct kbdiacrs __user *a = argp;
516
		struct kbdiacr diacr;
517
		int i;
518
		
499
		if (!perm)
519
		if (!perm)
500
			return -EPERM;
520
			return -EPERM;
501
		if (get_user(ct, &a->kb_cnt))
521
		if (get_user(ct, &a->kb_cnt))
502
			return -EFAULT;
522
			return -EFAULT;
503
		if (ct >= MAX_DIACR)
523
		if (ct >= MAX_DIACR)
504
			return -EINVAL;
524
			return -EINVAL;
505
		kbd->accent_table_size = ct;
525
		accent_table_size = ct;
506
		if (copy_from_user(kbd->accent_table, a->kbdiacr,
526
		for (i = 0; i < ct; i++) {
507
				   ct * sizeof(struct kbdiacr)))
527
			if (copy_from_user(&diacr, a->kbdiacr, sizeof(struct kbdiacr)))
508
			return -EFAULT;
528
				return -EFAULT;
529
			accent_table[i].diacr = diacr.diacr;
530
			accent_table[i].base = diacr.base;
531
			accent_table[i].result = diacr.result;
532
		}
509
		return 0;
533
		return 0;
534
	}
535
	case KDSKBDIACRUC:
536
	{
537
		struct kbdiacrsuc __user *a = argp;
538
		unsigned int ct;
539
 
540
		if (!perm)
541
			return -EPERM;
542
		if (get_user(ct,&a->kb_cnt))
543
			return -EFAULT;
544
		if (ct >= MAX_DIACR)
545
			return -EINVAL;
546
		accent_table_size = ct;
547
		if (copy_from_user(accent_table, a->kbdiacruc, ct*sizeof(struct kbdiacruc)))
548
 			return -EFAULT;
549
 		return 0;
550
	}
510
	default:
551
	default:
511
		return -ENOIOCTLCMD;
552
		return -ENOIOCTLCMD;
512
	}
553
	}
(-)linux-2.6.8-orig/drivers/s390/char/keyboard.h (-1 / +1 lines)
Lines 25-31 Link Here
25
	unsigned short **key_maps;
25
	unsigned short **key_maps;
26
	char **func_table;
26
	char **func_table;
27
	fn_handler_fn **fn_handler;
27
	fn_handler_fn **fn_handler;
28
	struct kbdiacr *accent_table;
28
	struct kbdiacruc *accent_table;
29
	unsigned int accent_table_size;
29
	unsigned int accent_table_size;
30
	unsigned char diacr;
30
	unsigned char diacr;
31
	unsigned short sysrq;
31
	unsigned short sysrq;
(-)linux-2.6.8-orig/drivers/tc/lk201-map.c_shipped (-1 / +1 lines)
Lines 225-231 Link Here
225
	0,
225
	0,
226
};
226
};
227
227
228
struct kbdiacr accent_table[MAX_DIACR] = {
228
struct kbdiacruc accent_table[MAX_DIACR] = {
229
	{'`', 'A', 'À'},	{'`', 'a', 'à'},
229
	{'`', 'A', 'À'},	{'`', 'a', 'à'},
230
	{'\'', 'A', 'Á'},	{'\'', 'a', 'á'},
230
	{'\'', 'A', 'Á'},	{'\'', 'a', 'á'},
231
	{'^', 'A', 'Â'},	{'^', 'a', 'â'},
231
	{'^', 'A', 'Â'},	{'^', 'a', 'â'},
(-)linux-2.6.8-orig/include/linux/kbd_diacr.h (-1 / +1 lines)
Lines 2-8 Link Here
2
#define _DIACR_H
2
#define _DIACR_H
3
#include <linux/kd.h>
3
#include <linux/kd.h>
4
4
5
extern struct kbdiacr accent_table[];
5
extern struct kbdiacruc accent_table[];
6
extern unsigned int accent_table_size;
6
extern unsigned int accent_table_size;
7
7
8
#endif /* _DIACR_H */
8
#endif /* _DIACR_H */
(-)linux-2.6.8-orig/include/linux/kd.h (+14 lines)
Lines 122-133 Link Here
122
        unsigned int kb_cnt;    /* number of entries in following array */
122
        unsigned int kb_cnt;    /* number of entries in following array */
123
	struct kbdiacr kbdiacr[256];    /* MAX_DIACR from keyboard.h */
123
	struct kbdiacr kbdiacr[256];    /* MAX_DIACR from keyboard.h */
124
};
124
};
125
125
#define KDGKBDIACR      0x4B4A  /* read kernel accent table */
126
#define KDGKBDIACR      0x4B4A  /* read kernel accent table */
126
#define KDSKBDIACR      0x4B4B  /* write kernel accent table */
127
#define KDSKBDIACR      0x4B4B  /* write kernel accent table */
127
128
129
struct kbdiacruc {
130
        unsigned char diacr, base;
131
	unsigned int result;	/* UCS */
132
};
133
struct kbdiacrsuc {
134
        unsigned int kb_cnt;    /* number of entries in following array */
135
	struct kbdiacruc kbdiacruc[256];    /* MAX_DIACR from keyboard.h */
136
};
137
138
#define KDGKBDIACRUC    0x4BFA  /* read kernel accent table - UCS */
139
#define KDSKBDIACRUC    0x4BFB  /* write kernel accent table  - UCS */
140
128
struct kbkeycode {
141
struct kbkeycode {
129
	unsigned int scancode, keycode;
142
	unsigned int scancode, keycode;
130
};
143
};
144
131
#define KDGETKEYCODE	0x4B4C	/* read kernel keycode table entry */
145
#define KDGETKEYCODE	0x4B4C	/* read kernel keycode table entry */
132
#define KDSETKEYCODE	0x4B4D	/* write kernel keycode table entry */
146
#define KDSETKEYCODE	0x4B4D	/* write kernel keycode table entry */
133
147

Return to bug 52104