consolemap.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * consolemap.h
  4. *
  5. * Interface between console.c, selection.c and consolemap.c
  6. */
  7. #ifndef __LINUX_CONSOLEMAP_H__
  8. #define __LINUX_CONSOLEMAP_H__
  9. enum translation_map {
  10. LAT1_MAP,
  11. GRAF_MAP,
  12. IBMPC_MAP,
  13. USER_MAP,
  14. FIRST_MAP = LAT1_MAP,
  15. LAST_MAP = USER_MAP,
  16. };
  17. #include <linux/types.h>
  18. struct vc_data;
  19. #ifdef CONFIG_CONSOLE_TRANSLATIONS
  20. u16 inverse_translate(const struct vc_data *conp, u16 glyph, bool use_unicode);
  21. unsigned short *set_translate(enum translation_map m, struct vc_data *vc);
  22. int conv_uni_to_pc(struct vc_data *conp, long ucs);
  23. u32 conv_8bit_to_uni(unsigned char c);
  24. int conv_uni_to_8bit(u32 uni);
  25. void console_map_init(void);
  26. #else
  27. static inline u16 inverse_translate(const struct vc_data *conp, u16 glyph,
  28. bool use_unicode)
  29. {
  30. return glyph;
  31. }
  32. static inline unsigned short *set_translate(enum translation_map m,
  33. struct vc_data *vc)
  34. {
  35. return NULL;
  36. }
  37. static inline int conv_uni_to_pc(struct vc_data *conp, long ucs)
  38. {
  39. return ucs > 0xff ? -1 : ucs;
  40. }
  41. static inline u32 conv_8bit_to_uni(unsigned char c)
  42. {
  43. return c;
  44. }
  45. static inline int conv_uni_to_8bit(u32 uni)
  46. {
  47. return uni & 0xff;
  48. }
  49. static inline void console_map_init(void) { }
  50. #endif /* CONFIG_CONSOLE_TRANSLATIONS */
  51. #endif /* __LINUX_CONSOLEMAP_H__ */