diff options
Diffstat (limited to 'drivers/char/consolemap.c')
-rw-r--r-- | drivers/char/consolemap.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/drivers/char/consolemap.c b/drivers/char/consolemap.c index 163f3fce3f84..6b104e45a322 100644 --- a/drivers/char/consolemap.c +++ b/drivers/char/consolemap.c | |||
@@ -669,19 +669,29 @@ void con_protect_unimap(struct vc_data *vc, int rdonly) | |||
669 | p->readonly = rdonly; | 669 | p->readonly = rdonly; |
670 | } | 670 | } |
671 | 671 | ||
672 | /* | ||
673 | * Always use USER_MAP. These functions are used by the keyboard, | ||
674 | * which shouldn't be affected by G0/G1 switching, etc. | ||
675 | * If the user map still contains default values, i.e. the | ||
676 | * direct-to-font mapping, then assume user is using Latin1. | ||
677 | */ | ||
672 | /* may be called during an interrupt */ | 678 | /* may be called during an interrupt */ |
673 | u32 conv_8bit_to_uni(unsigned char c) | 679 | u32 conv_8bit_to_uni(unsigned char c) |
674 | { | 680 | { |
675 | /* | ||
676 | * Always use USER_MAP. This function is used by the keyboard, | ||
677 | * which shouldn't be affected by G0/G1 switching, etc. | ||
678 | * If the user map still contains default values, i.e. the | ||
679 | * direct-to-font mapping, then assume user is using Latin1. | ||
680 | */ | ||
681 | unsigned short uni = translations[USER_MAP][c]; | 681 | unsigned short uni = translations[USER_MAP][c]; |
682 | return uni == (0xf000 | c) ? c : uni; | 682 | return uni == (0xf000 | c) ? c : uni; |
683 | } | 683 | } |
684 | 684 | ||
685 | int conv_uni_to_8bit(u32 uni) | ||
686 | { | ||
687 | int c; | ||
688 | for (c = 0; c < 0x100; c++) | ||
689 | if (translations[USER_MAP][c] == uni || | ||
690 | (translations[USER_MAP][c] == (c | 0xf000) && uni == c)) | ||
691 | return c; | ||
692 | return -1; | ||
693 | } | ||
694 | |||
685 | int | 695 | int |
686 | conv_uni_to_pc(struct vc_data *conp, long ucs) | 696 | conv_uni_to_pc(struct vc_data *conp, long ucs) |
687 | { | 697 | { |