From: David Woodhouse <dwmw2@infradead.org>
To: Tim Bird <tim.bird@am.sony.com>
Cc: linux-tiny <Linux-tiny@selenic.com>,
linux-embedded <linux-embedded@vger.kernel.org>,
linux kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] console - Add configurable support for console charset translation
Date: Tue, 03 Jun 2008 14:45:50 +0100 [thread overview]
Message-ID: <1212500751.16924.322.camel@pmac.infradead.org> (raw)
In-Reply-To: <48447615.5050806@am.sony.com>
On Mon, 2008-06-02 at 15:37 -0700, Tim Bird wrote:
> With CONSOLE_TRANSLATIONS turned off, this saves about 6K
> on my kernel configured for an ARM development board (OMAP
> 5912 OSK). In embedded products I'm familiar with,
> console translations are not needed.
>
> This was taken from the Linux-tiny project and updated slightly
> for 2.6.25.
I prefer it like this... we can drop consolemap.o and
consolemap_deftbl.o from the build completely. It saves 7.2KiB on a
ppc32 build here.
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index 595a925..f740190 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -36,6 +36,13 @@ config VT
If unsure, say Y, or else you won't be able to do much with your new
shiny Linux system :-)
+config CONSOLE_TRANSLATIONS
+ default y
+ bool "Enable character translations in console" if EMBEDDED
+ ---help---
+ This enables support for font mapping and Unicode translation
+ on virtual consoles.
+
config VT_CONSOLE
bool "Support for console on virtual terminal" if EMBEDDED
depends on VT
diff --git a/drivers/char/Makefile b/drivers/char/Makefile
index 4c1c584..6ef173c 100644
--- a/drivers/char/Makefile
+++ b/drivers/char/Makefile
@@ -12,8 +12,8 @@ obj-y += mem.o random.o tty_io.o n_tty.o tty_ioctl.o
obj-$(CONFIG_LEGACY_PTYS) += pty.o
obj-$(CONFIG_UNIX98_PTYS) += pty.o
obj-y += misc.o
-obj-$(CONFIG_VT) += vt_ioctl.o vc_screen.o consolemap.o \
- consolemap_deftbl.o selection.o keyboard.o
+obj-$(CONFIG_VT) += vt_ioctl.o vc_screen.o selection.o keyboard.o
+obj-$(CONFIG_CONSOLE_TRANSLATIONS) += consolemap.o consolemap_deftbl.o
obj-$(CONFIG_HW_CONSOLE) += vt.o defkeymap.o
obj-$(CONFIG_AUDIT) += tty_audit.o
obj-$(CONFIG_MAGIC_SYSRQ) += sysrq.o
diff --git a/include/linux/consolemap.h b/include/linux/consolemap.h
index e2bf7e5..c4811da 100644
--- a/include/linux/consolemap.h
+++ b/include/linux/consolemap.h
@@ -3,6 +3,9 @@
*
* Interface between console.c, selection.c and consolemap.c
*/
+#ifndef __LINUX_CONSOLEMAP_H__
+#define __LINUX_CONSOLEMAP_H__
+
#define LAT1_MAP 0
#define GRAF_MAP 1
#define IBMPC_MAP 2
@@ -10,6 +13,7 @@
#include <linux/types.h>
+#ifdef CONFIG_CONSOLE_TRANSLATIONS
struct vc_data;
extern u16 inverse_translate(struct vc_data *conp, int glyph, int use_unicode);
@@ -18,3 +22,13 @@ extern int conv_uni_to_pc(struct vc_data *conp, long ucs);
extern u32 conv_8bit_to_uni(unsigned char c);
extern int conv_uni_to_8bit(u32 uni);
void console_map_init(void);
+#else
+#define inverse_translate(conp, glyph, uni) ((uint16_t)glyph)
+#define set_translate(m, vc) ((unsigned short *)NULL)
+#define conv_uni_to_pc(conp, ucs) ((int) (ucs > 0xff ? -1: ucs))
+#define conv_8bit_to_uni(c) ((uint32_t)(c))
+#define conv_uni_to_8bit(c) ((int) ((c) & 0xff))
+#define console_map_init(c) do { ; } while (0)
+#endif /* CONFIG_CONSOLE_TRANSLATIONS */
+
+#endif /* __LINUX_CONSOLEMAP_H__ */
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
index 9448ffb..81ed155 100644
--- a/include/linux/vt_kern.h
+++ b/include/linux/vt_kern.h
@@ -12,6 +12,7 @@
#include <linux/mutex.h>
#include <linux/console_struct.h>
#include <linux/mm.h>
+#include <linux/consolemap.h>
/*
* Presently, a lot of graphics programs do not restore the contents of
@@ -54,6 +55,7 @@ void redraw_screen(struct vc_data *vc, int is_switch);
struct tty_struct;
int tioclinux(struct tty_struct *tty, unsigned long arg);
+#ifdef CONFIG_CONSOLE_TRANSLATIONS
/* consolemap.c */
struct unimapinit;
@@ -70,6 +72,18 @@ int con_set_default_unimap(struct vc_data *vc);
void con_free_unimap(struct vc_data *vc);
void con_protect_unimap(struct vc_data *vc, int rdonly);
int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc);
+#else
+#define con_set_trans_old(arg) (0)
+#define con_get_trans_old(arg) (-EINVAL)
+#define con_set_trans_new(arg) (0)
+#define con_get_trans_new(arg) (-EINVAL)
+#define con_clear_unimap(vc, ui) (0)
+#define con_set_unimap(vc, ct, list) (0)
+#define con_set_default_unimap(vc) (0)
+#define con_copy_unimap(d, s) (0)
+#define con_get_unimap(vc, ct, uct, list) (-EINVAL)
+#define con_free_unimap(vc) do { ; } while (0)
+#endif
/* vt.c */
int vt_waitactive(int vt);
--
dwmw2
next prev parent reply other threads:[~2008-06-03 13:45 UTC|newest]
Thread overview: 85+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-02 22:37 [PATCH] console - Add configurable support for console charset translation Tim Bird
2008-06-03 1:34 ` H. Peter Anvin
2008-06-03 7:00 ` Jamie Lokier
2008-06-03 15:46 ` Matt Mackall
2008-06-03 21:31 ` Rob Landley
2008-06-03 22:37 ` H. Peter Anvin
2008-06-04 2:56 ` Paul Mundt
2008-06-04 17:36 ` Rob Landley
2008-06-04 17:42 ` Bill Gatliff
2008-06-04 18:55 ` Rob Landley
2008-06-04 19:05 ` Bill Gatliff
2008-06-05 0:46 ` Paul Mundt
2008-06-05 23:35 ` Rob Landley
2008-06-07 3:35 ` H. Peter Anvin
2008-06-09 11:38 ` Jamie Lokier
2008-06-09 11:51 ` Geert Uytterhoeven
2008-06-04 17:34 ` Rob Landley
2008-06-03 8:36 ` David Woodhouse
2008-06-03 13:45 ` David Woodhouse [this message]
2008-06-03 14:06 ` Holger Schurig
2008-06-03 14:10 ` David Woodhouse
2008-06-04 0:01 ` Tim Bird
2008-06-04 0:16 ` David Woodhouse
2008-06-04 1:03 ` Josh Boyer
2008-06-04 1:05 ` David Woodhouse
2008-06-04 3:13 ` Josh Boyer
2008-06-04 9:16 ` David Woodhouse
2008-06-04 10:07 ` Adrian Bunk
2008-06-04 10:10 ` David Woodhouse
2008-06-04 15:35 ` Tim Bird
2008-06-04 11:55 ` Alan Cox
2008-06-04 13:55 ` David Woodhouse
2008-06-04 14:07 ` Alan Cox
2008-06-04 14:27 ` David Woodhouse
2008-06-03 21:18 ` Rob Landley
2008-06-03 21:26 ` David Woodhouse
2008-06-03 21:30 ` Matt Mackall
2008-06-04 7:02 ` Holger Schurig
2008-06-04 7:04 ` Holger Schurig
2008-06-04 7:36 ` Dave Hylands
2008-06-04 15:24 ` Randy Dunlap
2008-06-04 17:19 ` Rob Landley
2008-06-04 17:26 ` linux-embedded archives [was Re: [PATCH] console - Add configurable support for console charset translation] T Ziomek
2008-06-04 18:08 ` Rob Landley
2008-06-04 10:33 ` [PATCH] console - Add configurable support for console charset translation Adrian Bunk
2008-06-04 17:51 ` Rob Landley
2008-06-04 18:34 ` Bernhard Fischer
2008-06-04 19:01 ` Adrian Bunk
2008-06-04 19:21 ` Bernhard Fischer
2008-06-04 19:20 ` Alan Cox
2008-06-04 18:51 ` Tim Bird
2008-06-04 19:15 ` Sam Ravnborg
2008-06-04 19:23 ` Tim Bird
2008-06-04 20:23 ` Adrian Bunk
2008-06-04 20:42 ` Tim Bird
2008-06-05 6:55 ` Jörn Engel
2008-06-05 7:18 ` Uwe Klein
2008-06-04 20:24 ` Jörn Engel
2008-06-04 19:40 ` Adrian Bunk
2008-06-06 23:47 ` Tim Bird
2008-06-07 4:29 ` Rob Landley
2008-06-10 1:37 ` mainlining min-configs Tim Bird
2008-06-10 3:14 ` Ben Nizette
2008-06-10 4:16 ` Paul Mundt
2008-06-10 8:36 ` Adrian Bunk
2008-06-10 18:18 ` Tim Bird
2008-06-10 18:30 ` Adrian Bunk
2008-06-10 18:51 ` Sam Ravnborg
2008-06-10 19:05 ` Adrian Bunk
2008-06-11 5:09 ` Rob Landley
2008-06-11 6:39 ` Sam Ravnborg
2008-06-11 19:09 ` Tim Bird
2008-06-11 19:22 ` Sam Ravnborg
2008-06-11 19:36 ` Adrian Bunk
2008-06-11 19:46 ` Tim Bird
2008-06-12 1:42 ` Rob Landley
2008-06-11 19:48 ` Sam Ravnborg
2008-06-12 0:01 ` Rob Landley
2008-06-11 5:17 ` Rob Landley
2008-06-11 5:51 ` Rob Landley
2008-06-11 3:48 ` Rob Landley
2008-06-11 3:32 ` Rob Landley
2008-06-11 8:59 ` Christian MICHON
2008-06-04 19:42 ` [PATCH] console - Add configurable support for console charset translation Bernhard Fischer
2008-06-11 7:08 ` Holger Schurig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1212500751.16924.322.camel@pmac.infradead.org \
--to=dwmw2@infradead.org \
--cc=Linux-tiny@selenic.com \
--cc=linux-embedded@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tim.bird@am.sony.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).