You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
(235) |
Apr
(30) |
May
(32) |
Jun
(86) |
Jul
(81) |
Aug
(108) |
Sep
(27) |
Oct
(22) |
Nov
(34) |
Dec
(10) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(78) |
Feb
(10) |
Mar
(81) |
Apr
(27) |
May
(13) |
Jun
(105) |
Jul
(78) |
Aug
(52) |
Sep
(59) |
Oct
(90) |
Nov
(127) |
Dec
(49) |
2002 |
Jan
(102) |
Feb
(72) |
Mar
(54) |
Apr
(98) |
May
(25) |
Jun
(23) |
Jul
(123) |
Aug
(14) |
Sep
(52) |
Oct
(65) |
Nov
(48) |
Dec
(48) |
2003 |
Jan
(22) |
Feb
(25) |
Mar
(29) |
Apr
(12) |
May
(16) |
Jun
(11) |
Jul
(20) |
Aug
(20) |
Sep
(43) |
Oct
(84) |
Nov
(98) |
Dec
(56) |
2004 |
Jan
(28) |
Feb
(39) |
Mar
(41) |
Apr
(28) |
May
(88) |
Jun
(17) |
Jul
(43) |
Aug
(57) |
Sep
(54) |
Oct
(42) |
Nov
(32) |
Dec
(58) |
2005 |
Jan
(80) |
Feb
(31) |
Mar
(65) |
Apr
(41) |
May
(20) |
Jun
(34) |
Jul
(62) |
Aug
(73) |
Sep
(81) |
Oct
(48) |
Nov
(57) |
Dec
(57) |
2006 |
Jan
(63) |
Feb
(24) |
Mar
(18) |
Apr
(9) |
May
(22) |
Jun
(29) |
Jul
(47) |
Aug
(11) |
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: Dave H. <hav...@us...> - 2002-10-12 19:23:24
|
Martin J. Bligh wrote: >>This patch fixes some of the missed handle_sysrq functions not updated. >>please apply. > > Are you going to have early console support (ie printk from before > what is now console_init) done before the freeze, or should I just > submit our version? That reminds me. Has anyone noticed that sysrq on the serial console is broken? -- Dave Hansen hav...@us... |
From: Martin J. B. <mb...@ar...> - 2002-10-12 03:05:18
|
>> Are you going to have early console support (ie printk from before >> what is now console_init) done before the freeze, or should I just >> submit our version? > > On ppc64 Im currently setting a console up very early in arch init code > and using the CONFIG_EARLY_PRINTK hook to disable it at console_init > time. Works OK for me, do you guys need something on top of that? Attatched is what I use when it all goes to hell in a handbasket. Works for me ... I'd love to see it more generally available, so we didn't get bug reports saying "it says 'booting linux', then nothing". I'm not desperately attatched to any one implementation, as long as it works from really, really early on. The fact that everyone and his dog (including me once, badly) has reimplemented this suggests it's very useful, and should go into mainline. Patch by Bill Irwin and Keith Mannthey. Inlined so you can read it, attached as well, cause my mail-reader on this PC seems to be eating things at the moment for some reason. This version supports standard PC VGA consoles, and serial consoles (essential for remote work), but should be easy to hook in other interfaces. Probably needs some cleanup. If people would take a cleaned up version, I'll clean it up, or get someone to do it ;-) M. diff -urN linux-2.5.25/arch/i386/Config.help linux-2.5.25-early/arch/i386/Config.help --- linux-2.5.25/arch/i386/Config.help 2002-07-05 16:42:04.000000000 -0700 +++ linux-2.5.25-early/arch/i386/Config.help 2002-07-16 13:11:21.000000000 -0700 @@ -941,6 +941,25 @@ Say Y here if you want to reduce the chances of the tree compiling, and are prepared to dig into driver internals to fix compile errors. + +NO_CONFIG_EARLY_CONSOLE + If you are not doing early kernel devolopment NONE is what you want. + The other will add a early console for you (in i386) + This will allow you see printk output before console_init is called. + This is handy if you need to debug the kernel before this point. + + VGA will give you a VGA console, your screen. + SERIAL will give you out put on your serial line. + Location of serial port + CONFIG_EARLY_CONSOLE_SERIAL_PORT + 0x3F8 == COMM 1 + 0x3E8 == COMM 2 + +CONFIG_EARLY_CONSOLE_SERIAL_BAUD + Set the the Baud of your serial console. + + + Software Suspend CONFIG_SOFTWARE_SUSPEND Enable the possibilty of suspendig machine. It doesn't need APM. diff -urN linux-2.5.25/arch/i386/config.in linux-2.5.25-early/arch/i386/config.in --- linux-2.5.25/arch/i386/config.in 2002-07-25 10:23:53.000000000 -0700 +++ linux-2.5.25-early/arch/i386/config.in 2002-07-16 13:11:21.000000000 -0700 @@ -424,6 +424,16 @@ bool ' Spinlock debugging' CONFIG_DEBUG_SPINLOCK if [ "$CONFIG_HIGHMEM" = "y" ]; then bool ' Highmem debugging' CONFIG_DEBUG_HIGHMEM + choice 'Early printk support' \ + "NONE NO_CONFIG_EARLY_CONSOLE \ + VGA CONFIG_EARLY_CONSOLE_VGA \ + Serial_PORT CONFIG_EARLY_CONSOLE_SERIAL\ + Bochs_0xE9_hack CONFIG_EARLY_CONSOLE_BOCHS_E9_HACK " NONE + if [ "$CONFIG_EARLY_CONSOLE_SERIAL" = "y" ]; then + hex "Location of serial port " CONFIG_EARLY_CONSOLE_SERIAL_PORT 0x3F8 + int "Baud rate " CONFIG_EARLY_CONSOLE_SERIAL_BAUD 38400 + fi + fi fi diff -urN linux-2.5.25/arch/i386/kernel/Makefile linux-2.5.25-early/arch/i386/kernel/Makefile --- linux-2.5.25/arch/i386/kernel/Makefile 2002-07-05 16:42:14.000000000 -0700 +++ linux-2.5.25-early/arch/i386/kernel/Makefile 2002-07-16 13:11:21.000000000 -0700 @@ -11,7 +11,7 @@ obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o vm86.o \ ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_i386.o \ pci-dma.o i386_ksyms.o i387.o bluesmoke.o dmi_scan.o \ - bootflag.o + bootflag.o early_consoles.o obj-y += cpu/ obj-$(CONFIG_MCA) += mca.o diff -urN linux-2.5.25/arch/i386/kernel/early_consoles.c linux-2.5.25-early/arch/i386/kernel/early_consoles.c --- linux-2.5.25/arch/i386/kernel/early_consoles.c 1969-12-31 16:00:00.000000000 -0800 +++ linux-2.5.25-early/arch/i386/kernel/early_consoles.c 2002-07-16 13:19:34.000000000 -0700 @@ -0,0 +1,418 @@ +/* + * Early console drivers. + * (C) Nov 2001, William Irwin, IBM + * + * These are low-level pseudodrivers to enable early console output + * to aid in debugging during early boot. + * + * They are crude, but hopefully effective. They rely on the fact + * that consoles are largely unused prior to the true console_init(), + * and that printk() uses the ->write callback and that callback + * only during its operation. + * + * Serial port routines are derived from Linux serial.c, and + * vga_putc() is derived from vsta, (C) Andrew Valencia. + */ + +#include <linux/kernel.h> +#include <linux/console.h> +#include <linux/serial_reg.h> +#include <asm/io.h> + +/* + * I/O ports are not linearly mapped on all architectures. + * On IA64 in particular, port I/O is just reading/writing from + * an uncached address, but ioremap there requires ia64_io_base + * to be initialized, which does not happen until the middle of + * setup_arch(). So a port remapping macro is provided here. + * + * The IA64 case is not handled here, although the port remapping + * is demonstrated for the purposes of understanding its necessity. + * The IO_BASE is taken from Lion systems; in general, this varies. + * True handling for IA64 will be merged in given testing. + */ + +#ifdef CONFIG_IA64 + +#define IO_BASE 0xC0000FFFFC000000UL +#define MK_PORT(port) ((char *)(IO_BASE|(((port)>>2)<<12)|((port) & 0xFFF))) + +#else + +/* + * This works for i386, but not everywhere. + * Other architectures with port I/O mapping needs will need to + * add to the preprocessor case analysis above. + */ + +#define MK_PORT(port) (port) + +#endif + +#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) + + +/* + * This serial output driver derived from the one appearing + * in serial.c + * + * It is a simple "bitbanging" style output routine, with + * initialization performed at every call. + */ + +#ifdef CONFIG_EARLY_CONSOLE_SERIAL +#define MAX_BAUD 115200 +#define BAUD_MSB (MAX_BAUD/CONFIG_EARLY_CONSOLE_SERIAL_BAUD)/0xFF +#define BAUD_LSB (MAX_BAUD/CONFIG_EARLY_CONSOLE_SERIAL_BAUD)%0xFF + + +static inline void wait_for_readiness(unsigned port) +{ + unsigned retries; + unsigned char status; + + /* + * Wait for transmitter holding and shift registers to empty, + * which is required for output to succeed. If the retries are + * exceeded, this deliberately fails to ensure termination. + */ + for(retries = 0; retries < 65536; ++retries) { + status = inb(MK_PORT(port + 5)); + if((status & BOTH_EMPTY) == BOTH_EMPTY) + break; + } +} + +static int serial_init = 0; + +static void init_serial_io_port(unsigned port) +{ + serial_init = 1; + + wait_for_readiness(port); + + /* + * Disable interrupts. + */ + outb(0x0, MK_PORT(port + 1)); + + /* + * Set the baud rate divisor's LSB. + */ + outb(BAUD_MSB, MK_PORT(port + 3)); + + /* + * Set the baud rate divisor's MSB. + */ + outb(BAUD_LSB, MK_PORT(port)); + + /* + * Set no parity, 8 bits, 1 stop bit, and select + * interrupt enable register. + */ + outb(0x3, MK_PORT(port + 3)); +} + + +static void write_serial_io_port(unsigned port, + const char *s, + unsigned n) +{ + unsigned k; + + if (serial_init==0) + { + init_serial_io_port(port); + } + + /* + * Set data terminal ready and request to send. + */ + + for(k = 0; k < n; ++k) { + wait_for_readiness(port); + outb(s[k], MK_PORT(port)); + if(s[k] == '\n') { + wait_for_readiness(port); + outb('\r', MK_PORT(port)); + } + } +} + + + +/* + * On Intel-derived architectures it is customary for onboard serial + * ports to have I/O ports at these two port addresses. + */ + +static void write_serial(struct console *c, const char *s, unsigned n) +{ + write_serial_io_port(CONFIG_EARLY_CONSOLE_SERIAL_PORT, s, n); +} + +static struct console early_console_serial = +{ + write: write_serial +}; +#endif + + +#ifdef CONFIG_EARLY_CONSOLE_VGA + +/* + * This should work for a variety of Intel-derived architectures, + * as it is customary for VGA memory to reside in this address range. + * vga_putc() is derived from vsta sources, (C) Andrew Valencia. + * + * Several forms of functionality are intentionally omitted in the + * interest of robustness, in particular, cursor movement and cursor + * position determination. + */ + +#define VGA_MAXCOL 80 +#define VGA_MAXROW 25 +#define VGA_SCRNSZ (VGA_MAXCOL * VGA_MAXROW) +#define VGA_REG_PORT 0x3D4 +#define VGA_VAL_PORT 0x3D5 +#define VGA_TEXT_BUFFER 0xB8000 + +#define VGA_CHAR(_row_, _col_) vga_mem[(_row_)*VGA_MAXCOL + (_col_)].c + +struct vga_char_desc +{ + unsigned char c; + unsigned char color; +}; + +static struct vga_char_desc * vga_mem = + (struct vga_char_desc *)(VGA_TEXT_BUFFER + PAGE_OFFSET); + +/* + ** The screen position can actually be determined by port I/O, + ** but in the interest of robustness, these are always initialized + ** to the (0, 0) position. These position indices must always be + ** strictly less than the bounds VGA_MAXROW and VGA_MAXCOL. + **/ +static unsigned short row; +static unsigned short col; + + +/*from martin bligh's early_printk */ +static inline void update_cursor(void) +{ + int pos = (col + VGA_MAXCOL*row) *2; + + outb_p(14, VGA_REG_PORT); + outb_p(0xff & (pos >> 9), VGA_VAL_PORT); + outb_p(15, VGA_REG_PORT); + outb_p(0xff & (pos >> 1), VGA_VAL_PORT); +} + + +void clear_vga_mem(void) +{ + int x, y; + + for (x = 0; x < 80; x++) { + for (y = 0; y < 25; y++) { + VGA_CHAR(y,x) = ' '; + } + } + row =0; + col =0; + update_cursor(); +} + + + + +/* + * The characters displayed at a screen position can be discerned by + * reading from the corresponding memory location. This can be used + * to simulate scrolling movement. Line blanking is simulated by + * overwriting the displayed characters with the space character. + * + * In the interest of robustness, cursor movement is also omitted. + */ +static inline void vga_scroll_up(void) +{ + unsigned k; + + for(k = 0; k < (VGA_SCRNSZ - VGA_MAXCOL); ++k) + vga_mem[k].c = vga_mem[k + VGA_MAXCOL].c; + + for(k = VGA_SCRNSZ - VGA_MAXCOL; k < VGA_SCRNSZ; ++k) + vga_mem[k].c = ' '; +} + + +/* + * Line advancement must preserve the invariant that the row and + * column indices are in-bounds. The semantics of this mean that + * when line advancement "beyond" the last line results in scrolling. + */ +static inline void vga_line_advance(void) +{ + ++row; + + if(row >= VGA_MAXROW) { + row = VGA_MAXROW - 1; + vga_scroll_up(); + } +} + + +/* + * Character advancement must once again preserve the in-bounds + * invariants, and in so doing line wrapping and advancement may occur. + */ +static inline void vga_char_advance(void) +{ + ++col; + + if(col >= VGA_MAXCOL) { + col = 0; + vga_line_advance(); + } +} + + +/* + * Derived from vsta sources (C) Andrew Valencia. + * Here the interpretation of several common special characters occurs, + * namely linefeeds, newlines, tabs, and backspaces. The position + * indices are updated using the vga_char_advance() and vga_line_advance() + * routines, and a vga_char_advance() is triggered on the printing of + * each ordinary character. The special characters have specialized + * position update semantics in order to be faithful to their customary + * cursor movement effects, although the cursor position is not updated. + */ +static void vga_putc(char c) +{ + unsigned k; + switch(c) { + case '\t': + for(k = 0; k < 8; ++k) { + VGA_CHAR(row, col) = ' '; + vga_char_advance(); + } + break; + + case '\r': + col = 0; + break; + + case '\n': + col = 0; + vga_line_advance(); + break; + + case '\b': + if(col > 0) { + --col; + VGA_CHAR(row, col) = ' '; + } + break; + + default: + VGA_CHAR(row, col) = c; + vga_char_advance(); + break; + } +} + + +/* + * write_vga(), given a NUL-terminated character array, writes + * characters to VGA space in bulk, and is the callback used for the + * driver structure. + */ +static void write_vga(struct console *c, const char *s, unsigned n) +{ + unsigned k; + + for(k = 0; k < n; ++k) + { + vga_putc(s[k]); + update_cursor(); + } +} + +static struct console early_console_vga = +{ + write: write_vga +}; + +#endif /*END CONFIG_EARLY_CONSOLE_VGA*/ + + + +/* + * The bochs x86 simulator has an optional feature for enabling + * debugging output through a normally unused ISA I/O port. The + * protocol for communicating with the simulated device is simply + * using port I/O writes to write a stream of characters to the + * device, and these are then relayed by the simulator to the + * controlling terminal of the simulator process. + */ +#ifdef CONFIG_EARLY_CONSOLE_BOCHS_E9_HACK +static void write_bochs(struct console *c, const char *s, unsigned n) +{ + unsigned k; + + for(k = 0; k < n; ++k) + outb(s[k], MK_PORT(0xE9)); +} + +static struct console early_console_bochs = +{ + write: write_bochs +}; +#endif /* CONFIG_EARLY_CONSOLE_BOCHS_E9_HACK */ + + +/* + * In order to minimize the number of #ifdefs whch must + * appear in-line, this direct-mapped, NULL-terminated table + * of console entries is used to provide a configuration-independent + * structure which may be traversed to discover all of the available + * early console devices for registration and unregistration. + * + * This is the ugliest part of the code, thanks to #ifdef + */ +static struct console * early_console_table[] = + { +#ifdef CONFIG_EARLY_CONSOLE_SERIAL + &early_console_serial, +#endif +#ifdef CONFIG_EARLY_CONSOLE_VGA + &early_console_vga, +#endif +#ifdef CONFIG_EARLY_CONSOLE_BOCHS_E9_HACK + &early_console_bochs, +#endif + NULL + }; + + +/* + * The above implementations are quite far from complete console + * devices, but printk() only requires the ->write callback, so this is + * somewhat deceptive, but still cleaner than editing printk.c itself. + */ +void add_early_consoles(void) +{ + + struct console **c = early_console_table; + while(*c) + { + register_early_console(*c++); + printk ("consoled added!\n\n"); + } +#ifdef CONFIG_EARLY_CONSOLE_VGA + clear_vga_mem(); +#endif + +} + diff -urN linux-2.5.25/arch/i386/kernel/setup.c linux-2.5.25-early/arch/i386/kernel/setup.c --- linux-2.5.25/arch/i386/kernel/setup.c 2002-07-05 16:42:23.000000000 -0700 +++ linux-2.5.25-early/arch/i386/kernel/setup.c 2002-07-16 13:11:21.000000000 -0700 @@ -598,7 +598,9 @@ int i; early_cpu_init(); - + + add_early_consoles(); + #ifdef CONFIG_VISWS visws_get_board_type_and_rev(); #endif diff -urN linux-2.5.25/include/linux/console.h linux-2.5.25-early/include/linux/console.h --- linux-2.5.25/include/linux/console.h 2002-07-05 16:42:22.000000000 -0700 +++ linux-2.5.25-early/include/linux/console.h 2002-07-16 13:11:21.000000000 -0700 @@ -90,7 +90,7 @@ #define CON_PRINTBUFFER (1) #define CON_CONSDEV (2) /* Last on the command line */ #define CON_ENABLED (4) - +#define EARLY_CONSOLE (8) /* Early flag. Remove in con_init */ struct console { char name[8]; @@ -105,6 +105,7 @@ struct console *next; }; + extern void register_console(struct console *); extern int unregister_console(struct console *); extern struct console *console_drivers; @@ -112,6 +113,9 @@ extern void release_console_sem(void); extern void console_conditional_schedule(void); extern void console_unblank(void); +extern int clear_early_consoles(void); +extern void register_early_console(struct console *); + /* VESA Blanking Levels */ #define VESA_NO_BLANKING 0 diff -urN linux-2.5.25/kernel/printk.c linux-2.5.25-early/kernel/printk.c --- linux-2.5.25/kernel/printk.c 2002-07-05 16:42:23.000000000 -0700 +++ linux-2.5.25-early/kernel/printk.c 2002-07-16 13:11:21.000000000 -0700 @@ -579,6 +579,10 @@ int i; unsigned long flags; +#ifndef NO_CONFIG_EARLY_CONSOLE + clear_early_consoles(); +#endif + /* * See if we want to use this console driver. If we * didn't select a console we take the first one @@ -676,6 +680,50 @@ } EXPORT_SYMBOL(unregister_console); +/* This will clear any and all console_drivers that + use only in con_init to remove any consoles that setup_arch + may have added for early console support + */ +int clear_early_consoles(void) +{ + struct console *a, *b; + int removed = 0; + + if(console_drivers) + { + acquire_console_sem(); + + + for (a=console_drivers->next, b=console_drivers; a; b=a,a=b->next) + { + if (a->flags & EARLY_CONSOLE) + { + b->next = a->next; + removed++; + } + } + + if (console_drivers->flags & EARLY_CONSOLE) + { + console_drivers=console_drivers->next; + removed++; + + } + + if (console_drivers == NULL) + preferred_console = -1; + + release_console_sem(); + } + return removed; +} + +void register_early_console(struct console *early_con) +{ + early_con->flags |= EARLY_CONSOLE; + register_console(early_con); +} + /** * tty_write_message - write a message to a certain tty, not just the console. * |
From: Anton B. <an...@sa...> - 2002-10-12 01:47:05
|
> Are you going to have early console support (ie printk from before > what is now console_init) done before the freeze, or should I just > submit our version? On ppc64 Im currently setting a console up very early in arch init code and using the CONFIG_EARLY_PRINTK hook to disable it at console_init time. Works OK for me, do you guys need something on top of that? Anton |
From: James S. <jsi...@in...> - 2002-10-12 01:46:41
|
> > This patch fixes some of the missed handle_sysrq functions not updated. > > please apply. > > Are you going to have early console support (ie printk from before > what is now console_init) done before the freeze, or should I just > submit our version? Depends on how fast Linus takes my patches. In the end vty_init will initialize display drivers that need a other resource that are avaliable latter (i.e pci handling, irqs) and the other drivers will be called by vt_console_init. vt_console_init can be called much earlier than now. In fact I will soon remove the need to call bootmem. I plan to removal all the console related stuff from the arch directories!!! It can be done with some work. I done it for the ix86 platform. The need for a dummy console will also go away. |
From: James S. <jsi...@in...> - 2002-10-12 01:34:08
|
Seperation of some framebuffer code from the console code. Moving away come of the code from the global variable currcon to using a struct vc_data that reperents each VC. You can import this changeset into BK by piping this whole message to: '| bk receive [path to repository]' or apply the patch as usual. =================================================================== ChangeSet@1.714.6.3, 2002-10-09 11:55:52-07:00, jsi...@ma... Started to nuke the gloabl currcon variable. I changed over the unimap and font handling functions to use struct vc_data instead. I also seperated out the framebuffer code from the VT code since very soon the framebuffer will be able to function without a VT. arch/mips64/kernel/ioctl32.c | 3 arch/ppc64/kernel/ioctl32.c | 67 +++++++++++-------- arch/sparc64/kernel/ioctl32.c | 34 +++++++--- arch/x86_64/ia32/ia32_ioctl.c | 35 +++++++--- drivers/char/consolemap.c | 142 ++++++++++++++++++++---------------------- drivers/char/keyboard.c | 1 drivers/char/selection.c | 4 - drivers/char/vc_screen.c | 1 drivers/char/vt.c | 65 +++++++++---------- drivers/char/vt_ioctl.c | 44 ++++++------- drivers/video/dummycon.c | 1 drivers/video/mdacon.c | 3 drivers/video/newport_con.c | 1 drivers/video/promcon.c | 13 +-- drivers/video/sticon.c | 1 drivers/video/vgacon.c | 9 +- include/linux/consolemap.h | 6 - include/linux/vt_kern.h | 25 +++---- include/video/fbcon.h | 2 19 files changed, 246 insertions(+), 211 deletions(-) diff -Nru a/arch/mips64/kernel/ioctl32.c b/arch/mips64/kernel/ioctl32.c --- a/arch/mips64/kernel/ioctl32.c Fri Oct 11 18:17:53 2002 +++ b/arch/mips64/kernel/ioctl32.c Fri Oct 11 18:17:53 2002 @@ -619,6 +619,8 @@ IOCTL32_DEFAULT(FIONBIO), IOCTL32_DEFAULT(FIONREAD), +#ifdef CONFIG_VT + IOCTL32_DEFAULT(PIO_FONT), IOCTL32_DEFAULT(GIO_FONT), IOCTL32_DEFAULT(KDSIGACCEPT), @@ -662,6 +664,7 @@ IOCTL32_DEFAULT(VT_RESIZEX), IOCTL32_DEFAULT(VT_LOCKSWITCH), IOCTL32_DEFAULT(VT_UNLOCKSWITCH), +#endif #ifdef CONFIG_NET /* Socket level stuff */ diff -Nru a/arch/ppc64/kernel/ioctl32.c b/arch/ppc64/kernel/ioctl32.c --- a/arch/ppc64/kernel/ioctl32.c Fri Oct 11 18:17:54 2002 +++ b/arch/ppc64/kernel/ioctl32.c Fri Oct 11 18:17:54 2002 @@ -1794,6 +1794,8 @@ static int do_fontx_ioctl(unsigned int fd, int cmd, struct consolefontdesc32 *user_cfd, struct file *file) { + struct tty_struct *tty = (struct tty_struct *) file->private_data; + struct vc_data *vc = (struct vc_data *) tty->driver_data; struct consolefontdesc cfdarg; struct console_font_op op; int i, perm; @@ -1816,7 +1818,7 @@ op.height = cfdarg.charheight; op.charcount = cfdarg.charcount; op.data = cfdarg.chardata; - return con_font_op(fg_console, &op); + return con_font_op(vc, &op); case GIO_FONTX: if (!cfdarg.chardata) return 0; @@ -1826,7 +1828,7 @@ op.height = cfdarg.charheight; op.charcount = cfdarg.charcount; op.data = cfdarg.chardata; - i = con_font_op(fg_console, &op); + i = con_font_op(vc, &op); if (i) return i; cfdarg.charheight = op.height; @@ -1849,9 +1851,10 @@ static int do_kdfontop_ioctl(unsigned int fd, unsigned int cmd, struct console_font_op32 *fontop, struct file *file) { - struct console_font_op op; + struct tty_struct *tty = (struct tty_struct *) file->private_data; + struct vc_data *vc = (struct vc_data *) tty->driver_data; int perm = vt_check(file), i; - struct vt_struct *vt; + struct console_font_op op; if (perm < 0) return perm; @@ -1861,8 +1864,7 @@ return -EPERM; op.data = (unsigned char *)A(((struct console_font_op32 *)&op)->data); op.flags |= KD_FONT_FLAG_OLD; - vt = (struct vt_struct *)((struct tty_struct *)file->private_data)->driver_data; - i = con_font_op(vt->vc_num, &op); + i = con_font_op(vc, &op); if (i) return i; ((struct console_font_op32 *)&op)->data = (unsigned long)op.data; if (copy_to_user((void *) fontop, &op, sizeof(struct console_font_op32))) @@ -1870,6 +1872,33 @@ return 0; } +struct unimapdesc32 { + unsigned short entry_ct; + u32 entries; +}; + +static int do_unimap_ioctl(unsigned int fd, unsigned int cmd, struct unimapdesc32 *user_ud, struct file *file) +{ + struct tty_struct *tty = (struct tty_struct *) file->private_data; + struct vc_data *vc = (struct vc_data *) tty->driver_data; + int perm = vt_check(file); + struct unimapdesc32 tmp; + + if (perm < 0) return perm; + if (copy_from_user(&tmp, user_ud, sizeof tmp)) + return -EFAULT; + switch (cmd) { + case PIO_UNIMAP: + if (!perm) return -EPERM; + return con_set_unimap(vc, tmp.entry_ct, (struct unipair *)A(tmp.entries)); + case GIO_UNIMAP: + return con_get_unimap(vc, tmp.entry_ct, &(user_ud->entry_ct), (struct unipair *)A(tmp.entries)); + } + return 0; +} +#endif /* CONFIG_VT */ + +#ifdef CONFIG_FB struct fb_fix_screeninfo32 { char id[16]; /* identification string eg "TT Builtin" */ unsigned int smem_start; /* Start of frame buffer mem */ @@ -1993,30 +2022,8 @@ } return err; } +#endif /* CONFIG_FB */ -struct unimapdesc32 { - unsigned short entry_ct; - u32 entries; -}; - -static int do_unimap_ioctl(unsigned int fd, unsigned int cmd, struct unimapdesc32 *user_ud, struct file *file) -{ - struct unimapdesc32 tmp; - int perm = vt_check(file); - - if (perm < 0) return perm; - if (copy_from_user(&tmp, user_ud, sizeof tmp)) - return -EFAULT; - switch (cmd) { - case PIO_UNIMAP: - if (!perm) return -EPERM; - return con_set_unimap(fg_console, tmp.entry_ct, (struct unipair *)A(tmp.entries)); - case GIO_UNIMAP: - return con_get_unimap(fg_console, tmp.entry_ct, &(user_ud->entry_ct), (struct unipair *)A(tmp.entries)); - } - return 0; -} -#endif /* CONFIG_VT */ static int do_smb_getmountuid(unsigned int fd, unsigned int cmd, unsigned long arg) { mm_segment_t old_fs = get_fs(); @@ -4465,6 +4472,8 @@ HANDLE_IOCTL(PIO_UNIMAP, do_unimap_ioctl), HANDLE_IOCTL(GIO_UNIMAP, do_unimap_ioctl), HANDLE_IOCTL(KDFONTOP, do_kdfontop_ioctl), +#endif +#ifdef CONFIG_FB HANDLE_IOCTL(FBIOGET_FSCREENINFO, do_fbioget_fscreeninfo_ioctl), HANDLE_IOCTL(FBIOGETCMAP, do_fbiogetcmap_ioctl), HANDLE_IOCTL(FBIOPUTCMAP, do_fbioputcmap_ioctl), diff -Nru a/arch/sparc64/kernel/ioctl32.c b/arch/sparc64/kernel/ioctl32.c --- a/arch/sparc64/kernel/ioctl32.c Fri Oct 11 18:17:54 2002 +++ b/arch/sparc64/kernel/ioctl32.c Fri Oct 11 18:17:54 2002 @@ -873,6 +873,7 @@ return err ? -EFAULT : 0; } +#ifdef CONFIG_FB struct fbcmap32 { int index; /* first element (0 origin) */ int count; @@ -1112,6 +1113,7 @@ if (cmap.transp) kfree(cmap.transp); return err; } +#endif /* CONFIG_FB */ static int hdio_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg) { @@ -2077,6 +2079,7 @@ extern int tty_ioctl(struct inode * inode, struct file * file, unsigned int cmd, unsigned long arg); +#ifdef CONFIG_VT static int vt_check(struct file *file) { struct tty_struct *tty; @@ -2109,6 +2112,8 @@ static int do_fontx_ioctl(unsigned int fd, int cmd, struct consolefontdesc32 *user_cfd, struct file *file) { + struct tty_struct *tty = (struct tty_struct *)file->private_data; + struct vc_data *vc = (struct vc_data *) tty->driver_data; struct consolefontdesc cfdarg; struct console_font_op op; int i, perm; @@ -2131,7 +2136,7 @@ op.height = cfdarg.charheight; op.charcount = cfdarg.charcount; op.data = cfdarg.chardata; - return con_font_op(fg_console, &op); + return con_font_op(vc, &op); case GIO_FONTX: if (!cfdarg.chardata) return 0; @@ -2141,7 +2146,7 @@ op.height = cfdarg.charheight; op.charcount = cfdarg.charcount; op.data = cfdarg.chardata; - i = con_font_op(fg_console, &op); + i = con_font_op(vc, &op); if (i) return i; cfdarg.charheight = op.height; @@ -2164,9 +2169,10 @@ static int do_kdfontop_ioctl(unsigned int fd, unsigned int cmd, struct console_font_op32 *fontop, struct file *file) { - struct console_font_op op; + struct tty_struct *tty = (struct tty_struct *)file->private_data; + struct vc_data *vc = (struct vc_data *) tty->driver_data; int perm = vt_check(file), i; - struct vt_struct *vt; + struct console_font_op op; if (perm < 0) return perm; @@ -2176,8 +2182,7 @@ return -EPERM; op.data = (unsigned char *)A(((struct console_font_op32 *)&op)->data); op.flags |= KD_FONT_FLAG_OLD; - vt = (struct vt_struct *)((struct tty_struct *)file->private_data)->driver_data; - i = con_font_op(vt->vc_num, &op); + i = con_font_op(vc, &op); if (i) return i; ((struct console_font_op32 *)&op)->data = (unsigned long)op.data; if (copy_to_user((void *) fontop, &op, sizeof(struct console_font_op32))) @@ -2192,8 +2197,10 @@ static int do_unimap_ioctl(unsigned int fd, unsigned int cmd, struct unimapdesc32 *user_ud, struct file *file) { - struct unimapdesc32 tmp; + struct tty_struct *tty = (struct tty_struct *)file->private_data; + struct vc_data *vc = (struct vc_data *) tty->driver_data; int perm = vt_check(file); + struct unimapdesc32 tmp; if (perm < 0) return perm; if (copy_from_user(&tmp, user_ud, sizeof tmp)) @@ -2201,12 +2208,13 @@ switch (cmd) { case PIO_UNIMAP: if (!perm) return -EPERM; - return con_set_unimap(fg_console, tmp.entry_ct, (struct unipair *)A(tmp.entries)); + return con_set_unimap(vc, tmp.entry_ct, (struct unipair *)A(tmp.entries)); case GIO_UNIMAP: - return con_get_unimap(fg_console, tmp.entry_ct, &(user_ud->entry_ct), (struct unipair *)A(tmp.entries)); + return con_get_unimap(vc, tmp.entry_ct, &(user_ud->entry_ct), (struct unipair *)A(tmp.entries)); } return 0; } +#endif /* CONFIG_VT */ static int do_smb_getmountuid(unsigned int fd, unsigned int cmd, unsigned long arg) { @@ -4273,6 +4281,7 @@ COMPATIBLE_IOCTL(TIOCSSERIAL) COMPATIBLE_IOCTL(TIOCSERGETLSR) COMPATIBLE_IOCTL(TIOCSLTC) +#ifdef CONFIG_FB /* Big F */ COMPATIBLE_IOCTL(FBIOGTYPE) COMPATIBLE_IOCTL(FBIOSATTR) @@ -4293,6 +4302,7 @@ COMPATIBLE_IOCTL(FBIOPUT_CURSORSTATE) COMPATIBLE_IOCTL(FBIOGET_CON2FBMAP) COMPATIBLE_IOCTL(FBIOPUT_CON2FBMAP) +#endif /* Little f */ COMPATIBLE_IOCTL(FIOCLEX) COMPATIBLE_IOCTL(FIONCLEX) @@ -4423,6 +4433,7 @@ COMPATIBLE_IOCTL(TUNSETIFF) COMPATIBLE_IOCTL(TUNSETPERSIST) COMPATIBLE_IOCTL(TUNSETOWNER) +#ifdef CONFIG_VT /* Big V */ COMPATIBLE_IOCTL(VT_SETMODE) COMPATIBLE_IOCTL(VT_GETMODE) @@ -4436,6 +4447,7 @@ COMPATIBLE_IOCTL(VT_RESIZEX) COMPATIBLE_IOCTL(VT_LOCKSWITCH) COMPATIBLE_IOCTL(VT_UNLOCKSWITCH) +#endif /* Little v */ COMPATIBLE_IOCTL(VUIDSFORMAT) COMPATIBLE_IOCTL(VUIDGFORMAT) @@ -5007,12 +5019,14 @@ HANDLE_IOCTL(0x1260, broken_blkgetsize) HANDLE_IOCTL(BLKSECTGET, w_long) HANDLE_IOCTL(BLKPG, blkpg_ioctl_trans) +#ifdef CONFIG_FB HANDLE_IOCTL(FBIOPUTCMAP32, fbiogetputcmap) HANDLE_IOCTL(FBIOGETCMAP32, fbiogetputcmap) HANDLE_IOCTL(FBIOSCURSOR32, fbiogscursor) HANDLE_IOCTL(FBIOGET_FSCREENINFO, fb_ioctl_trans) HANDLE_IOCTL(FBIOGETCMAP, fb_ioctl_trans) HANDLE_IOCTL(FBIOPUTCMAP, fb_ioctl_trans) +#endif HANDLE_IOCTL(HDIO_GET_UNMASKINTR, hdio_ioctl_trans) HANDLE_IOCTL(HDIO_GET_DMA, hdio_ioctl_trans) HANDLE_IOCTL(HDIO_GET_32BIT, hdio_ioctl_trans) @@ -5048,11 +5062,13 @@ HANDLE_IOCTL(LOOP_GET_STATUS, loop_status) #define AUTOFS_IOC_SETTIMEOUT32 _IOWR(0x93,0x64,unsigned int) HANDLE_IOCTL(AUTOFS_IOC_SETTIMEOUT32, ioc_settimeout) +#ifdef CONFIG_VT HANDLE_IOCTL(PIO_FONTX, do_fontx_ioctl) HANDLE_IOCTL(GIO_FONTX, do_fontx_ioctl) HANDLE_IOCTL(PIO_UNIMAP, do_unimap_ioctl) HANDLE_IOCTL(GIO_UNIMAP, do_unimap_ioctl) HANDLE_IOCTL(KDFONTOP, do_kdfontop_ioctl) +#endif HANDLE_IOCTL(EXT2_IOC32_GETFLAGS, do_ext2_ioctl) HANDLE_IOCTL(EXT2_IOC32_SETFLAGS, do_ext2_ioctl) HANDLE_IOCTL(EXT2_IOC32_GETVERSION, do_ext2_ioctl) diff -Nru a/arch/x86_64/ia32/ia32_ioctl.c b/arch/x86_64/ia32/ia32_ioctl.c --- a/arch/x86_64/ia32/ia32_ioctl.c Fri Oct 11 18:17:53 2002 +++ b/arch/x86_64/ia32/ia32_ioctl.c Fri Oct 11 18:17:53 2002 @@ -790,6 +790,7 @@ return err ? -EFAULT : 0; } +#ifdef CONFIG_FB struct fbcmap32 { int index; /* first element (0 origin) */ int count; @@ -930,6 +931,7 @@ if (cmap.transp) kfree(cmap.transp); return err; } +#endif /* CONFIG_FB */ static int hdio_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg) { @@ -1633,6 +1635,8 @@ extern int tty_ioctl(struct inode * inode, struct file * file, unsigned int cmd, unsigned long arg); +#ifdef CONFIG_VT + static int vt_check(struct file *file) { struct tty_struct *tty; @@ -1665,6 +1669,8 @@ static int do_fontx_ioctl(unsigned int fd, int cmd, struct consolefontdesc32 *user_cfd, struct file *file) { + struct tty_struct *tty = (struct tty_struct *)file->private_data; + struct vc_data *vc = (struct vc_data *) tty->driver_data; struct consolefontdesc cfdarg; struct console_font_op op; int i, perm; @@ -1687,7 +1693,7 @@ op.height = cfdarg.charheight; op.charcount = cfdarg.charcount; op.data = cfdarg.chardata; - return con_font_op(fg_console, &op); + return con_font_op(vc, &op); case GIO_FONTX: if (!cfdarg.chardata) return 0; @@ -1697,7 +1703,7 @@ op.height = cfdarg.charheight; op.charcount = cfdarg.charcount; op.data = cfdarg.chardata; - i = con_font_op(fg_console, &op); + i = con_font_op(vc, &op); if (i) return i; cfdarg.charheight = op.height; @@ -1720,9 +1726,10 @@ static int do_kdfontop_ioctl(unsigned int fd, unsigned int cmd, struct console_font_op32 *fontop, struct file *file) { - struct console_font_op op; + struct tty_struct *tty = (struct tty_struct *)file->private_data; + struct vc_data *vc = (struct vc_data *) tty->driver_data; int perm = vt_check(file), i; - struct vt_struct *vt; + struct console_font_op op; if (perm < 0) return perm; @@ -1732,8 +1739,7 @@ return -EPERM; op.data = (unsigned char *)A(((struct console_font_op32 *)&op)->data); op.flags |= KD_FONT_FLAG_OLD; - vt = (struct vt_struct *)((struct tty_struct *)file->private_data)->driver_data; - i = con_font_op(vt->vc_num, &op); + i = con_font_op(vc, &op); if (i) return i; ((struct console_font_op32 *)&op)->data = (unsigned long)op.data; if (copy_to_user((void *) fontop, &op, sizeof(struct console_font_op32))) @@ -1748,8 +1754,10 @@ static int do_unimap_ioctl(unsigned int fd, unsigned int cmd, struct unimapdesc32 *user_ud, struct file *file) { - struct unimapdesc32 tmp; + struct tty_struct *tty = (struct tty_struct *)file->private_data; + struct vc_data *vc = (struct vc_data *) tty->driver_data; int perm = vt_check(file); + struct unimapdesc32 tmp; if (perm < 0) return perm; if (copy_from_user(&tmp, user_ud, sizeof tmp)) @@ -1757,12 +1765,13 @@ switch (cmd) { case PIO_UNIMAP: if (!perm) return -EPERM; - return con_set_unimap(fg_console, tmp.entry_ct, (struct unipair *)A(tmp.entries)); + return con_set_unimap(vc, tmp.entry_ct, (struct unipair *)A(tmp.entries)); case GIO_UNIMAP: - return con_get_unimap(fg_console, tmp.entry_ct, &(user_ud->entry_ct), (struct unipair *)A(tmp.entries)); + return con_get_unimap(vc, tmp.entry_ct, &(user_ud->entry_ct), (struct unipair *)A(tmp.entries)); } return 0; } +#endif /* CONFIG_VT */ static int do_smb_getmountuid(unsigned int fd, unsigned int cmd, unsigned long arg) { @@ -3172,6 +3181,7 @@ COMPATIBLE_IOCTL(TIOCGPTN) COMPATIBLE_IOCTL(TIOCSPTLCK) COMPATIBLE_IOCTL(TIOCSERGETLSR) +#ifdef CONFIG_FB COMPATIBLE_IOCTL(FBIOGET_VSCREENINFO) COMPATIBLE_IOCTL(FBIOPUT_VSCREENINFO) COMPATIBLE_IOCTL(FBIOPAN_DISPLAY) @@ -3182,6 +3192,7 @@ COMPATIBLE_IOCTL(FBIOPUT_CURSORSTATE) COMPATIBLE_IOCTL(FBIOGET_CON2FBMAP) COMPATIBLE_IOCTL(FBIOPUT_CON2FBMAP) +#endif /* Little f */ COMPATIBLE_IOCTL(FIOCLEX) COMPATIBLE_IOCTL(FIONCLEX) @@ -3291,6 +3302,7 @@ COMPATIBLE_IOCTL(SCSI_IOCTL_TAGGED_DISABLE) COMPATIBLE_IOCTL(SCSI_IOCTL_GET_BUS_NUMBER) COMPATIBLE_IOCTL(SCSI_IOCTL_SEND_COMMAND) +#ifdef CONFIG_VT /* Big V */ COMPATIBLE_IOCTL(VT_SETMODE) COMPATIBLE_IOCTL(VT_GETMODE) @@ -3304,6 +3316,7 @@ COMPATIBLE_IOCTL(VT_RESIZEX) COMPATIBLE_IOCTL(VT_LOCKSWITCH) COMPATIBLE_IOCTL(VT_UNLOCKSWITCH) +#endif /* Little v, the video4linux ioctls */ COMPATIBLE_IOCTL(VIDIOCGCAP) COMPATIBLE_IOCTL(VIDIOCGCHAN) @@ -3747,8 +3760,10 @@ HANDLE_IOCTL(0x1260, broken_blkgetsize) HANDLE_IOCTL(BLKSECTGET, w_long) HANDLE_IOCTL(BLKPG, blkpg_ioctl_trans) +#ifdef CONFIG_FB HANDLE_IOCTL(FBIOGETCMAP, fb_ioctl_trans) HANDLE_IOCTL(FBIOPUTCMAP, fb_ioctl_trans) +#endif HANDLE_IOCTL(HDIO_GET_UNMASKINTR, hdio_ioctl_trans) HANDLE_IOCTL(HDIO_GET_DMA, hdio_ioctl_trans) HANDLE_IOCTL(HDIO_GET_32BIT, hdio_ioctl_trans) @@ -3779,11 +3794,13 @@ HANDLE_IOCTL(CDROM_SEND_PACKET, cdrom_ioctl_trans) HANDLE_IOCTL(LOOP_SET_STATUS, loop_status) HANDLE_IOCTL(LOOP_GET_STATUS, loop_status) +#ifdef CONFIG_VT HANDLE_IOCTL(PIO_FONTX, do_fontx_ioctl) HANDLE_IOCTL(GIO_FONTX, do_fontx_ioctl) HANDLE_IOCTL(PIO_UNIMAP, do_unimap_ioctl) HANDLE_IOCTL(GIO_UNIMAP, do_unimap_ioctl) HANDLE_IOCTL(KDFONTOP, do_kdfontop_ioctl) +#endif HANDLE_IOCTL(EXT2_IOC32_GETFLAGS, do_ext2_ioctl) HANDLE_IOCTL(EXT2_IOC32_SETFLAGS, do_ext2_ioctl) HANDLE_IOCTL(EXT2_IOC32_GETVERSION, do_ext2_ioctl) diff -Nru a/drivers/char/consolemap.c b/drivers/char/consolemap.c --- a/drivers/char/consolemap.c Fri Oct 11 18:17:53 2002 +++ b/drivers/char/consolemap.c Fri Oct 11 18:17:53 2002 @@ -19,7 +19,6 @@ #include <linux/tty.h> #include <asm/uaccess.h> #include <linux/consolemap.h> -#include <linux/console_struct.h> #include <linux/vt_kern.h> static unsigned short translations[][256] = { @@ -182,7 +181,7 @@ static struct uni_pagedir *dflt; -static void set_inverse_transl(struct vc_data *conp, struct uni_pagedir *p, int i) +static void set_inverse_transl(struct vc_data *vc, struct uni_pagedir *p, int i) { int j, glyph; unsigned short *t = translations[i]; @@ -199,7 +198,7 @@ memset(q, 0, MAX_GLYPH); for (j = 0; j < E_TABSZ; j++) { - glyph = conv_uni_to_pc(conp, t[j]); + glyph = conv_uni_to_pc(vc, t[j]); if (glyph >= 0 && glyph < MAX_GLYPH && q[glyph] < 32) { /* prefer '-' above SHY etc. */ q[glyph] = j; @@ -207,10 +206,10 @@ } } -unsigned short *set_translate(int m,int currcons) +void set_translate(struct vc_data *vc, int m) { - inv_translate[currcons] = m; - return translations[m]; + inv_translate[vc->vc_num] = m; + vc->vc_translate = translations[m]; } /* @@ -220,29 +219,32 @@ * was active, or using Unicode. * Still, it is now possible to a certain extent to cut and paste non-ASCII. */ -unsigned char inverse_translate(struct vc_data *conp, int glyph) +unsigned char inverse_translate(struct vc_data *vc, int glyph) { struct uni_pagedir *p; if (glyph < 0 || glyph >= MAX_GLYPH) return 0; - else if (!(p = (struct uni_pagedir *)*conp->vc_uni_pagedir_loc) || - !p->inverse_translations[inv_translate[conp->vc_num]]) + else if (!(p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc) || + !p->inverse_translations[inv_translate[vc->vc_num]]) return glyph; else - return p->inverse_translations[inv_translate[conp->vc_num]][glyph]; + return p->inverse_translations[inv_translate[vc->vc_num]][glyph]; } static void update_user_maps(void) { - int i; struct uni_pagedir *p, *q = NULL; + struct vc_data *vc; + int i; for (i = 0; i < MAX_NR_CONSOLES; i++) { - if (!vc_cons_allocated(i)) + vc = vc_cons[i].d; + + if (!vc) continue; - p = (struct uni_pagedir *)*vc_cons[i].d->vc_uni_pagedir_loc; + p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; if (p && p != q) { - set_inverse_transl(vc_cons[i].d, p, USER_MAP); + set_inverse_transl(vc, p, USER_MAP); q = p; } } @@ -256,7 +258,7 @@ * 0xf000-0xf0ff "transparent" Unicodes) whereas the "new" variants set * Unicodes explicitly. */ -int con_set_trans_old(unsigned char * arg) +int con_set_trans_old(struct vc_data *vc, unsigned char * arg) { int i; unsigned short *p = translations[USER_MAP]; @@ -275,7 +277,7 @@ return 0; } -int con_get_trans_old(unsigned char * arg) +int con_get_trans_old(struct vc_data *vc, unsigned char * arg) { int i, ch; unsigned short *p = translations[USER_MAP]; @@ -286,13 +288,13 @@ for (i=0; i<E_TABSZ ; i++) { - ch = conv_uni_to_pc(vc_cons[fg_console].d, p[i]); + ch = conv_uni_to_pc(vc, p[i]); __put_user((ch & ~0xff) ? 0 : ch, arg+i); } return 0; } -int con_set_trans_new(ushort * arg) +int con_set_trans_new(struct vc_data *vc, ushort * arg) { int i; unsigned short *p = translations[USER_MAP]; @@ -312,7 +314,7 @@ return 0; } -int con_get_trans_new(ushort * arg) +int con_get_trans_new(struct vc_data *vc, ushort * arg) { int i; unsigned short *p = translations[USER_MAP]; @@ -363,28 +365,29 @@ } } -void con_free_unimap(int con) +void con_free_unimap(struct vc_data *vc) { struct uni_pagedir *p; - struct vc_data *conp = vc_cons[con].d; - p = (struct uni_pagedir *)*conp->vc_uni_pagedir_loc; + p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; if (!p) return; - *conp->vc_uni_pagedir_loc = 0; + *vc->vc_uni_pagedir_loc = 0; if (--p->refcount) return; con_release_unimap(p); kfree(p); } -static int con_unify_unimap(struct vc_data *conp, struct uni_pagedir *p) +static int con_unify_unimap(struct vc_data *vc, struct uni_pagedir *p) { int i, j, k; struct uni_pagedir *q; for (i = 0; i < MAX_NR_CONSOLES; i++) { - if (!vc_cons_allocated(i)) + struct vc_data *tmp = vc_cons[i].d; + + if (!tmp) continue; - q = (struct uni_pagedir *)*vc_cons[i].d->vc_uni_pagedir_loc; + q = (struct uni_pagedir *)*tmp->vc_uni_pagedir_loc; if (!q || q == p || q->sum != p->sum) continue; for (j = 0; j < 32; j++) { @@ -407,7 +410,7 @@ } if (j == 32) { q->refcount++; - *conp->vc_uni_pagedir_loc = (unsigned long)q; + *vc->vc_uni_pagedir_loc = (unsigned long)q; con_release_unimap(p); kfree(p); return 1; @@ -443,12 +446,11 @@ } /* ui is a leftover from using a hashtable, but might be used again */ -int con_clear_unimap(int con, struct unimapinit *ui) +int con_clear_unimap(struct vc_data *vc, struct unimapinit *ui) { struct uni_pagedir *p, *q; - struct vc_data *conp = vc_cons[con].d; - p = (struct uni_pagedir *)*conp->vc_uni_pagedir_loc; + p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; if (p && p->readonly) return -EIO; if (!p || --p->refcount) { q = (struct uni_pagedir *)kmalloc(sizeof(*p), GFP_KERNEL); @@ -458,7 +460,7 @@ } memset(q, 0, sizeof(*q)); q->refcount=1; - *conp->vc_uni_pagedir_loc = (unsigned long)q; + *vc->vc_uni_pagedir_loc = (unsigned long)q; } else { if (p == dflt) dflt = NULL; p->refcount++; @@ -469,13 +471,12 @@ } int -con_set_unimap(int con, ushort ct, struct unipair *list) +con_set_unimap(struct vc_data *vc, ushort ct, struct unipair *list) { - int err = 0, err1, i; struct uni_pagedir *p, *q; - struct vc_data *conp = vc_cons[con].d; - - p = (struct uni_pagedir *)*conp->vc_uni_pagedir_loc; + int err = 0, err1, i; + + p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; if (p->readonly) return -EIO; if (!ct) return 0; @@ -484,10 +485,10 @@ int j, k; u16 **p1, *p2, l; - err1 = con_clear_unimap(con, NULL); + err1 = con_clear_unimap(vc, NULL); if (err1) return err1; - q = (struct uni_pagedir *)*conp->vc_uni_pagedir_loc; + q = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; for (i = 0, l = 0; i < 32; i++) if ((p1 = p->uni_pgdir[i])) for (j = 0; j < 32; j++) @@ -497,7 +498,7 @@ err1 = con_insert_unipair(q, l, p2[k]); if (err1) { p->refcount++; - *conp->vc_uni_pagedir_loc = (unsigned long)p; + *vc->vc_uni_pagedir_loc = (unsigned long)p; con_release_unimap(q); kfree(q); return err1; @@ -516,12 +517,11 @@ list++; } - if (con_unify_unimap(conp, p)) + if (con_unify_unimap(vc, p)) return err; for (i = 0; i <= 3; i++) - set_inverse_transl(conp, p, i); /* Update all inverse translations */ - + set_inverse_transl(vc, p, i); /* Update all inverse translations */ return err; } @@ -531,19 +531,18 @@ PIO_FONTRESET ioctl is called. */ int -con_set_default_unimap(int con) +con_set_default_unimap(struct vc_data *vc) { int i, j, err = 0, err1; u16 *q; struct uni_pagedir *p; - struct vc_data *conp = vc_cons[con].d; if (dflt) { - p = (struct uni_pagedir *)*conp->vc_uni_pagedir_loc; + p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; if (p == dflt) return 0; dflt->refcount++; - *conp->vc_uni_pagedir_loc = (unsigned long)dflt; + *vc->vc_uni_pagedir_loc = (unsigned long)dflt; if (p && --p->refcount) { con_release_unimap(p); kfree(p); @@ -552,11 +551,10 @@ } /* The default font is always 256 characters */ - - err = con_clear_unimap(con,NULL); + err = con_clear_unimap(vc, NULL); if (err) return err; - p = (struct uni_pagedir *)*conp->vc_uni_pagedir_loc; + p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; q = dfont_unitable; for (i = 0; i < 256; i++) @@ -566,46 +564,43 @@ err = err1; } - if (con_unify_unimap(conp, p)) { - dflt = (struct uni_pagedir *)*conp->vc_uni_pagedir_loc; + if (con_unify_unimap(vc, p)) { + dflt = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; return err; } for (i = 0; i <= 3; i++) - set_inverse_transl(conp, p, i); /* Update all inverse translations */ + set_inverse_transl(vc, p, i); /* Update all inverse translations */ dflt = p; return err; } int -con_copy_unimap(int dstcon, int srccon) +con_copy_unimap(struct vc_data *dst, struct vc_data *src) { - struct vc_data *sconp = vc_cons[srccon].d; - struct vc_data *dconp = vc_cons[dstcon].d; struct uni_pagedir *q; - if (!vc_cons_allocated(srccon) || !*sconp->vc_uni_pagedir_loc) + if (!src || !*src->vc_uni_pagedir_loc) return -EINVAL; - if (*dconp->vc_uni_pagedir_loc == *sconp->vc_uni_pagedir_loc) + if (*dst->vc_uni_pagedir_loc == *src->vc_uni_pagedir_loc) return 0; - con_free_unimap(dstcon); - q = (struct uni_pagedir *)*sconp->vc_uni_pagedir_loc; + con_free_unimap(dst); + q = (struct uni_pagedir *)*src->vc_uni_pagedir_loc; q->refcount++; - *dconp->vc_uni_pagedir_loc = (long)q; + *dst->vc_uni_pagedir_loc = (long)q; return 0; } int -con_get_unimap(int con, ushort ct, ushort *uct, struct unipair *list) +con_get_unimap(struct vc_data *vc, ushort ct, ushort *uct, struct unipair *list) { int i, j, k, ect; u16 **p1, *p2; struct uni_pagedir *p; - struct vc_data *conp = vc_cons[con].d; ect = 0; - if (*conp->vc_uni_pagedir_loc) { - p = (struct uni_pagedir *)*conp->vc_uni_pagedir_loc; + if (*vc->vc_uni_pagedir_loc) { + p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; for (i = 0; i < 32; i++) if ((p1 = p->uni_pgdir[i])) for (j = 0; j < 32; j++) @@ -625,16 +620,16 @@ return ((ect <= ct) ? 0 : -ENOMEM); } -void con_protect_unimap(int con, int rdonly) +void con_protect_unimap(struct vc_data *vc, int rdonly) { struct uni_pagedir *p = (struct uni_pagedir *) - *vc_cons[con].d->vc_uni_pagedir_loc; + *vc->vc_uni_pagedir_loc; if (p) p->readonly = rdonly; } int -conv_uni_to_pc(struct vc_data *conp, long ucs) +conv_uni_to_pc(struct vc_data *vc, long ucs) { int h; u16 **p1, *p2; @@ -655,10 +650,10 @@ else if ((ucs & ~UNI_DIRECT_MASK) == UNI_DIRECT_BASE) return ucs & UNI_DIRECT_MASK; - if (!*conp->vc_uni_pagedir_loc) + if (!*vc->vc_uni_pagedir_loc) return -3; - p = (struct uni_pagedir *)*conp->vc_uni_pagedir_loc; + p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; if ((p1 = p->uni_pgdir[ucs >> 11]) && (p2 = p1[(ucs >> 6) & 0x1f]) && (h = p2[ucs & 0x3f]) < MAX_GLYPH) @@ -677,7 +672,10 @@ { int i; - for (i = 0; i < MAX_NR_CONSOLES; i++) - if (vc_cons_allocated(i) && !*vc_cons[i].d->vc_uni_pagedir_loc) - con_set_default_unimap(i); + for (i = 0; i < MAX_NR_CONSOLES; i++) { + struct vc_data *vc = vc_cons[i].d; + + if (vc && !*vc->vc_uni_pagedir_loc) + con_set_default_unimap(vc); + } } diff -Nru a/drivers/char/keyboard.c b/drivers/char/keyboard.c --- a/drivers/char/keyboard.c Fri Oct 11 18:17:53 2002 +++ b/drivers/char/keyboard.c Fri Oct 11 18:17:53 2002 @@ -35,7 +35,6 @@ #include <linux/init.h> #include <linux/slab.h> -#include <linux/console_struct.h> #include <linux/kbd_kern.h> #include <linux/kbd_diacr.h> #include <linux/vt_kern.h> diff -Nru a/drivers/char/selection.c b/drivers/char/selection.c --- a/drivers/char/selection.c Fri Oct 11 18:17:53 2002 +++ b/drivers/char/selection.c Fri Oct 11 18:17:53 2002 @@ -22,7 +22,6 @@ #include <linux/vt_kern.h> #include <linux/consolemap.h> -#include <linux/console_struct.h> #include <linux/selection.h> #ifndef MIN @@ -288,7 +287,8 @@ */ int paste_selection(struct tty_struct *tty) { - struct vt_struct *vt = (struct vt_struct *) tty->driver_data; + struct vc_data *vc = (struct vc_data *) tty->driver_data; + struct vt_struct *vt = vt_cons[vc->vc_num]; int pasted = 0, count; DECLARE_WAITQUEUE(wait, current); diff -Nru a/drivers/char/vc_screen.c b/drivers/char/vc_screen.c --- a/drivers/char/vc_screen.c Fri Oct 11 18:17:53 2002 +++ b/drivers/char/vc_screen.c Fri Oct 11 18:17:53 2002 @@ -32,7 +32,6 @@ #include <linux/mm.h> #include <linux/init.h> #include <linux/vt_kern.h> -#include <linux/console_struct.h> #include <linux/selection.h> #include <linux/kbd_kern.h> #include <linux/console.h> diff -Nru a/drivers/char/vt.c b/drivers/char/vt.c --- a/drivers/char/vt.c Fri Oct 11 18:17:53 2002 +++ b/drivers/char/vt.c Fri Oct 11 18:17:53 2002 @@ -90,7 +90,6 @@ #include <linux/devfs_fs_kernel.h> #include <linux/vt_kern.h> #include <linux/selection.h> -#include <linux/console_struct.h> #include <linux/kbd_kern.h> #include <linux/consolemap.h> #include <linux/timer.h> @@ -669,7 +668,7 @@ vt_cons[currcons] = (struct vt_struct *)(p+sizeof(struct vc_data)); visual_init(currcons, 1); if (!*vc_cons[currcons].d->vc_uni_pagedir_loc) - con_set_default_unimap(currcons); + con_set_default_unimap(vc_cons[currcons].d); q = (long)kmalloc(screenbuf_size, GFP_KERNEL); if (!q) { kfree((char *) p); @@ -1073,9 +1072,8 @@ * control chars if defined, don't set * bit 8 on output. */ - translate = set_translate(charset == 0 - ? G0_charset - : G1_charset,currcons); + set_translate(vc_cons[currcons].d, charset == 0 ? + G0_charset : G1_charset); disp_ctrl = 0; toggle_meta = 0; break; @@ -1083,7 +1081,7 @@ * Select first alternate font, lets * chars < 32 be displayed as ROM chars. */ - translate = set_translate(IBMPC_MAP,currcons); + set_translate(vc_cons[currcons].d, IBMPC_MAP); disp_ctrl = 1; toggle_meta = 0; break; @@ -1091,7 +1089,7 @@ * Select second alternate font, toggle * high bit before displaying as ROM char. */ - translate = set_translate(IBMPC_MAP,currcons); + set_translate(vc_cons[currcons].d, IBMPC_MAP); disp_ctrl = 1; toggle_meta = 1; break; @@ -1373,7 +1371,7 @@ color = s_color; G0_charset = saved_G0; G1_charset = saved_G1; - translate = set_translate(charset ? G1_charset : G0_charset,currcons); + set_translate(vc_cons[currcons].d, charset ? G1_charset : G0_charset); update_attr(currcons); need_wrap = 0; } @@ -1389,7 +1387,7 @@ bottom = video_num_lines; vc_state = ESnormal; ques = 0; - translate = set_translate(LAT1_MAP,currcons); + set_translate(vc_cons[currcons].d, LAT1_MAP); G0_charset = LAT1_MAP; G1_charset = GRAF_MAP; charset = 0; @@ -1474,12 +1472,12 @@ return; case 14: charset = 1; - translate = set_translate(G1_charset,currcons); + set_translate(vc_cons[currcons].d, G1_charset); disp_ctrl = 1; return; case 15: charset = 0; - translate = set_translate(G0_charset,currcons); + set_translate(vc_cons[currcons].d, G0_charset); disp_ctrl = 0; return; case 24: case 26: @@ -1786,7 +1784,7 @@ else if (c == 'K') G0_charset = USER_MAP; if (charset == 0) - translate = set_translate(G0_charset,currcons); + set_translate(vc_cons[currcons].d, G0_charset); vc_state = ESnormal; return; case ESsetG1: @@ -1799,7 +1797,7 @@ else if (c == 'K') G1_charset = USER_MAP; if (charset == 1) - translate = set_translate(G1_charset,currcons); + set_translate(vc_cons[currcons].d, G1_charset); vc_state = ESnormal; return; default: @@ -1834,9 +1832,9 @@ #endif int c, tc, ok, n = 0, draw_x = -1; - unsigned int currcons; + unsigned int currcons = minor(tty->device) - tty->driver.minor_start; unsigned long draw_from = 0, draw_to = 0; - struct vt_struct *vt = (struct vt_struct *)tty->driver_data; + struct vc_data *vc = (struct vc_data *)tty->driver_data; u16 himask, charmask; const unsigned char *orig_buf = NULL; int orig_count; @@ -1844,13 +1842,12 @@ if (in_interrupt()) return count; - currcons = vt->vc_num; - if (!vc_cons_allocated(currcons)) { + if (!vc) { /* could this happen? */ static int error = 0; if (!error) { error = 1; - printk("con_write: tty %d not allocated\n", currcons+1); + printk("con_write: tty %d not allocated\n", currcons + 1); } return 0; } @@ -2308,7 +2305,8 @@ static void con_unthrottle(struct tty_struct *tty) { - struct vt_struct *vt = (struct vt_struct *) tty->driver_data; + struct vc_data *vc = (struct vc_data *) tty->driver_data; + struct vt_struct *vt = vt_cons[vc->vc_num]; wake_up_interruptible(&vt->paste_wait); } @@ -2345,7 +2343,7 @@ static void con_flush_chars(struct tty_struct *tty) { - struct vt_struct *vt; + struct vc_data *vc; if (in_interrupt()) /* from flush_to_ldisc */ return; @@ -2354,9 +2352,9 @@ /* if we race with con_close(), vt may be null */ acquire_console_sem(); - vt = (struct vt_struct *)tty->driver_data; - if (vt) - set_cursor(vt->vc_num); + vc = (struct vc_data *)tty->driver_data; + if (vc) + set_cursor(vc->vc_num); release_console_sem(); } @@ -2375,7 +2373,7 @@ return i; vt_cons[currcons]->vc_num = currcons; - tty->driver_data = vt_cons[currcons]; + tty->driver_data = vc_cons[currcons].d; vc_cons[currcons].d->vc_tty = tty; if (!tty->winsize.ws_row && !tty->winsize.ws_col) { @@ -2389,15 +2387,15 @@ static void con_close(struct tty_struct *tty, struct file * filp) { - struct vt_struct *vt; + struct vc_data *vc; if (!tty) return; if (tty->count != 1) return; vcs_make_devfs (minor(tty->device) - tty->driver.minor_start, 1); - vt = (struct vt_struct*)tty->driver_data; - if (vt) - vc_cons[vt->vc_num].d->vc_tty = NULL; + vc = (struct vc_data *)tty->driver_data; + if (vc) + vc_cons[vc->vc_num].d->vc_tty = NULL; tty->driver_data = 0; } @@ -2845,12 +2843,13 @@ #define max_font_size 65536 -int con_font_op(int currcons, struct console_font_op *op) +int con_font_op(struct vc_data *vc, struct console_font_op *op) { - int rc = -EINVAL; + struct console_font_op old_op; int size = max_font_size, set; + int currcons = vc->vc_num; + int rc = -EINVAL; u8 *temp = NULL; - struct console_font_op old_op; if (vt_cons[currcons]->vc_mode != KD_TEXT) goto quit; @@ -2891,7 +2890,7 @@ } else if (op->op == KD_FONT_OP_GET) set = 0; else - return sw->con_font_op(vc_cons[currcons].d, op); + return sw->con_font_op(vc, op); if (op->data) { temp = kmalloc(size, GFP_KERNEL); if (!temp) @@ -2904,7 +2903,7 @@ } acquire_console_sem(); - rc = sw->con_font_op(vc_cons[currcons].d, op); + rc = sw->con_font_op(vc, op); release_console_sem(); op->data = old_op.data; diff -Nru a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c --- a/drivers/char/vt_ioctl.c Fri Oct 11 18:17:53 2002 +++ b/drivers/char/vt_ioctl.c Fri Oct 11 18:17:53 2002 @@ -279,7 +279,7 @@ } static inline int -do_fontx_ioctl(int cmd, struct consolefontdesc *user_cfd, int perm) +do_fontx_ioctl(struct vc_data *vc, int cmd, struct consolefontdesc *user_cfd, int perm) { struct consolefontdesc cfdarg; struct console_font_op op; @@ -298,7 +298,7 @@ op.height = cfdarg.charheight; op.charcount = cfdarg.charcount; op.data = cfdarg.chardata; - return con_font_op(fg_console, &op); + return con_font_op(vc, &op); case GIO_FONTX: { op.op = KD_FONT_OP_GET; op.flags = KD_FONT_FLAG_OLD; @@ -306,7 +306,7 @@ op.height = cfdarg.charheight; op.charcount = cfdarg.charcount; op.data = cfdarg.chardata; - i = con_font_op(fg_console, &op); + i = con_font_op(vc, &op); if (i) return i; cfdarg.charheight = op.height; @@ -320,7 +320,7 @@ } static inline int -do_unimap_ioctl(int cmd, struct unimapdesc *user_ud,int perm) +do_unimap_ioctl(struct vc_data *vc, int cmd, struct unimapdesc *user_ud,int perm) { struct unimapdesc tmp; int i = 0; @@ -336,9 +336,9 @@ case PIO_UNIMAP: if (!perm) return -EPERM; - return con_set_unimap(fg_console, tmp.entry_ct, tmp.entries); + return con_set_unimap(vc, tmp.entry_ct, tmp.entries); case GIO_UNIMAP: - return con_get_unimap(fg_console, tmp.entry_ct, &(user_ud->entry_ct), tmp.entries); + return con_get_unimap(vc, tmp.entry_ct, &(user_ud->entry_ct), tmp.entries); } return 0; } @@ -350,13 +350,13 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, unsigned int cmd, unsigned long arg) { - int i, perm; + struct vc_data *vc = (struct vc_data *)tty->driver_data; + struct kbd_struct * kbd; unsigned int console; unsigned char ucval; - struct kbd_struct * kbd; - struct vt_struct *vt = (struct vt_struct *)tty->driver_data; + int i, perm; - console = vt->vc_num; + console = vc->vc_num; if (!vc_cons_allocated(console)) /* impossible? */ return -ENOIOCTLCMD; @@ -869,7 +869,7 @@ op.height = 0; op.charcount = 256; op.data = (char *) arg; - return con_font_op(fg_console, &op); + return con_font_op(vc, &op); } case GIO_FONT: { @@ -880,7 +880,7 @@ op.height = 32; op.charcount = 256; op.data = (char *) arg; - return con_font_op(fg_console, &op); + return con_font_op(vc, &op); } case PIO_CMAP: @@ -893,7 +893,7 @@ case PIO_FONTX: case GIO_FONTX: - return do_fontx_ioctl(cmd, (struct consolefontdesc *)arg, perm); + return do_fontx_ioctl(vc, cmd, (struct consolefontdesc *)arg, perm); case PIO_FONTRESET: { @@ -909,9 +909,9 @@ struct console_font_op op; op.op = KD_FONT_OP_SET_DEFAULT; op.data = NULL; - i = con_font_op(fg_console, &op); + i = con_font_op(vc, &op); if (i) return i; - con_set_default_unimap(fg_console); + con_set_default_unimap(vc); return 0; } #endif @@ -923,7 +923,7 @@ return -EFAULT; if (!perm && op.op != KD_FONT_OP_GET) return -EPERM; - i = con_font_op(console, &op); + i = con_font_op(vc, &op); if (i) return i; if (copy_to_user((void *) arg, &op, sizeof(op))) return -EFAULT; @@ -933,18 +933,18 @@ case PIO_SCRNMAP: if (!perm) return -EPERM; - return con_set_trans_old((unsigned char *)arg); + return con_set_trans_old(vc, (unsigned char *)arg); case GIO_SCRNMAP: - return con_get_trans_old((unsigned char *)arg); + return con_get_trans_old(vc, (unsigned char *)arg); case PIO_UNISCRNMAP: if (!perm) return -EPERM; - return con_set_trans_new((unsigned short *)arg); + return con_set_trans_new(vc, (unsigned short *)arg); case GIO_UNISCRNMAP: - return con_get_trans_new((unsigned short *)arg); + return con_get_trans_new(vc, (unsigned short *)arg); case PIO_UNIMAPCLR: { struct unimapinit ui; @@ -952,13 +952,13 @@ return -EPERM; i = copy_from_user(&ui, (void *)arg, sizeof(struct unimapinit)); if (i) return -EFAULT; - con_clear_unimap(fg_console, &ui); + con_clear_unimap(vc, &ui); return 0; } case PIO_UNIMAP: case GIO_UNIMAP: - return do_unimap_ioctl(cmd, (struct unimapdesc *)arg, perm); + return do_unimap_ioctl(vc, cmd, (struct unimapdesc *)arg, perm); case VT_LOCKSWITCH: if (!capable(CAP_SYS_TTY_CONFIG)) diff -Nru a/drivers/video/dummycon.c b/drivers/video/dummycon.c --- a/drivers/video/dummycon.c Fri Oct 11 18:17:53 2002 +++ b/drivers/video/dummycon.c Fri Oct 11 18:17:53 2002 @@ -9,7 +9,6 @@ #include <linux/kdev_t.h> #include <linux/tty.h> #include <linux/console.h> -#include <linux/console_struct.h> #include <linux/vt_kern.h> #include <linux/init.h> diff -Nru a/drivers/video/mdacon.c b/drivers/video/mdacon.c --- a/drivers/video/mdacon.c Fri Oct 11 18:17:53 2002 +++ b/drivers/video/mdacon.c Fri Oct 11 18:17:53 2002 @@ -33,7 +33,6 @@ #include <linux/module.h> #include <linux/tty.h> #include <linux/console.h> -#include <linux/console_struct.h> #include <linux/string.h> #include <linux/kd.h> #include <linux/slab.h> @@ -377,7 +376,7 @@ static void mdacon_deinit(struct vc_data *c) { - /* con_set_default_unimap(c->vc_num); */ + /* con_set_default_unimap(c); */ if (mda_display_fg == c) mda_display_fg = NULL; diff -Nru a/drivers/video/newport_con.c b/drivers/video/newport_con.c --- a/drivers/video/newport_con.c Fri Oct 11 18:17:53 2002 +++ b/drivers/video/newport_con.c Fri Oct 11 18:17:53 2002 @@ -16,7 +16,6 @@ #include <linux/kd.h> #include <linux/selection.h> #include <linux/console.h> -#include <linux/console_struct.h> #include <linux/vt_kern.h> #include <linux/mm.h> #include <linux/module.h> diff -Nru a/drivers/video/promcon.c b/drivers/video/promcon.c --- a/drivers/video/promcon.c Fri Oct 11 18:17:53 2002 +++ b/drivers/video/promcon.c Fri Oct 11 18:17:53 2002 @@ -15,7 +15,6 @@ #include <linux/slab.h> #include <linux/delay.h> #include <linux/console.h> -#include <linux/console_struct.h> #include <linux/vt_kern.h> #include <linux/selection.h> #include <linux/fb.h> @@ -156,9 +155,9 @@ k++; } set_fs(KERNEL_DS); - con_clear_unimap(conp->vc_num, NULL); - con_set_unimap(conp->vc_num, k, p); - con_protect_unimap(conp->vc_num, 1); + con_clear_unimap(conp, NULL); + con_set_unimap(conp, k, p); + con_protect_unimap(conp, 1); set_fs(old_fs); kfree(p); } @@ -176,7 +175,7 @@ p = *conp->vc_uni_pagedir_loc; if (conp->vc_uni_pagedir_loc == &conp->vc_uni_pagedir || !--conp->vc_uni_pagedir_loc[1]) - con_free_unimap(conp->vc_num); + con_free_unimap(conp); conp->vc_uni_pagedir_loc = promcon_uni_pagedir; promcon_uni_pagedir[1]++; if (!promcon_uni_pagedir[0] && p) { @@ -193,9 +192,9 @@ { /* When closing the last console, reset video origin */ if (!--promcon_uni_pagedir[1]) - con_free_unimap(conp->vc_num); + con_free_unimap(conp); conp->vc_uni_pagedir_loc = &conp->vc_uni_pagedir; - con_set_default_unimap(conp->vc_num); + con_set_default_unimap(conp); } static int diff -Nru a/drivers/video/sticon.c b/drivers/video/sticon.c --- a/drivers/video/sticon.c Fri Oct 11 18:17:53 2002 +++ b/drivers/video/sticon.c Fri Oct 11 18:17:53 2002 @@ -49,7 +49,6 @@ #include <linux/kernel.h> #include <linux/tty.h> #include <linux/console.h> -#include <linux/console_struct.h> #include <linux/errno.h> #include <linux/vt_kern.h> #include <linux/selection.h> diff -Nru a/drivers/video/vgacon.c b/drivers/video/vgacon.c --- a/drivers/video/vgacon.c Fri Oct 11 18:17:53 2002 +++ b/drivers/video/vgacon.c Fri Oct 11 18:17:53 2002 @@ -41,7 +41,6 @@ #include <linux/kernel.h> #include <linux/tty.h> #include <linux/console.h> -#include <linux/console_struct.h> #include <linux/string.h> #include <linux/kd.h> #include <linux/slab.h> @@ -334,11 +333,11 @@ p = *c->vc_uni_pagedir_loc; if (c->vc_uni_pagedir_loc == &c->vc_uni_pagedir || !--c->vc_uni_pagedir_loc[1]) - con_free_unimap(c->vc_num); + con_free_unimap(c); c->vc_uni_pagedir_loc = vgacon_uni_pagedir; vgacon_uni_pagedir[1]++; if (!vgacon_uni_pagedir[0] && p) - con_set_default_unimap(c->vc_num); + con_set_default_unimap(c); } static inline void vga_set_mem_top(struct vc_data *c) @@ -352,10 +351,10 @@ if (!--vgacon_uni_pagedir[1]) { c->vc_visible_origin = vga_vram_base; vga_set_mem_top(c); - con_free_unimap(c->vc_num); + con_free_unimap(c); } c->vc_uni_pagedir_loc = &c->vc_uni_pagedir; - con_set_default_unimap(c->vc_num); + con_set_default_unimap(c); } static u8 vgacon_build_attr(struct vc_data *c, u8 color, u8 intensity, u8 blink, u8 underline, u8 reverse) diff -Nru a/include/linux/consolemap.h b/include/linux/consolemap.h --- a/include/linux/consolemap.h Fri Oct 11 18:17:54 2002 +++ b/include/linux/consolemap.h Fri Oct 11 18:17:54 2002 @@ -10,6 +10,6 @@ struct vc_data; -extern unsigned char inverse_translate(struct vc_data *conp, int glyph); -extern unsigned short *set_translate(int m,int currcons); -extern int conv_uni_to_pc(struct vc_data *conp, long ucs); +extern unsigned char inverse_translate(struct vc_data *vc, int glyph); +extern void set_translate(struct vc_data *vc, int m); +extern int conv_uni_to_pc(struct vc_data *vc, long ucs); diff -Nru a/include/linux/vt_kern.h b/include/linux/vt_kern.h --- a/include/linux/vt_kern.h Fri Oct 11 18:17:53 2002 +++ b/include/linux/vt_kern.h Fri Oct 11 18:17:53 2002 @@ -7,6 +7,7 @@ */ #include <linux/config.h> +#include <linux/console_struct.h> #include <linux/vt.h> #include <linux/kd.h> #include <linux/tty.h> @@ -51,7 +52,7 @@ void do_blank_screen(int gfx_mode); void unblank_screen(void); void poke_blanked_console(void); -int con_font_op(int currcons, struct console_font_op *op); +int con_font_op(struct vc_data *vc, struct console_font_op *op); int con_set_cmap(unsigned char *cmap); int con_get_cmap(unsigned char *cmap); void scrollback(int); @@ -69,17 +70,17 @@ struct unimapinit; struct unipair; -int con_set_trans_old(unsigned char * table); -int con_get_trans_old(unsigned char * table); -int con_set_trans_new(unsigned short * table); -int con_get_trans_new(unsigned short * table); -int con_clear_unimap(int currcons, struct unimapinit *ui); -int con_set_unimap(int currcons, ushort ct, struct unipair *list); -int con_get_unimap(int currcons, ushort ct, ushort *uct, struct unipair *list); -int con_set_default_unimap(int currcons); -void con_free_unimap(int currcons); -void con_protect_unimap(int currcons, int rdonly); -int con_copy_unimap(int dstcons, int srccons); +int con_set_trans_old(struct vc_data *vc, unsigned char * table); +int con_get_trans_old(struct vc_data *vc, unsigned char * table); +int con_set_trans_new(struct vc_data *vc, unsigned short * table); +int con_get_trans_new(struct vc_data *vc, unsigned short * table); +int con_clear_unimap(struct vc_data *vc, struct unimapinit *ui); +int con_set_unimap(struct vc_data *vc, ushort ct, struct unipair *list); +int con_get_unimap(struct vc_data *vc, ushort ct, ushort *uct, struct unipair *list); +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, struct vc_data *src); /* vt.c */ diff -Nru a/include/video/fbcon.h b/include/video/fbcon.h --- a/include/video/fbcon.h Fri Oct 11 18:17:53 2002 +++ b/include/video/fbcon.h Fri Oct 11 18:17:53 2002 @@ -13,8 +13,8 @@ #include <linux/config.h> #include <linux/types.h> -#include <linux/console_struct.h> #include <linux/vt_buffer.h> +#include <linux/vt_kern.h> #include <asm/io.h> =================================================================== This BitKeeper patch contains the following changesets: 1.714.6.3 ## Wrapped with gzip_uu ## begin 664 bkpatch2473 M'XL(`$)XIST``^T];7/;-M*?I5^!7N<R=FK)Q`M!TFYR2>,TIWG2)),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GA:?=S\<NO<Z M=WO(J5__6JNH&7>[Z*E9OGW(WD3?5HA;O1R_G0SOHLYD6+V\#(:YY7&-(`/S M7H;O3(;Q^PMJ93CC;A<9UFFL"XY%/`A*C'M)NK9Z?Z'RGU@6G,M,[:/#VA\$ M==B4@E6_]_VPDMWVG?1?"#U3[T]F>+"T?U?<:?[6H/N;XG?Y_3/J6P,*RE;- MX4[!'==1G2J8#SXE0;0@M[N+<YZA:77#:-,K+7AO7+57IH^;+XUHJXSMOLFB M?Q/^`3'L]9,8Q&CH_:<>F<U,JCRGO888P*IR<DWU#K@VH/=)LKO3//Q^D5K- MVS"XRQN+\$TEB(]\OZ/*Z<G>\/JQ*F;'6G9RZ_O"X.+4R9XZA].@^[4K_25L M@*_[7:LBA@;7I0IG3C5$=$;1\8[-[C1N<:ME=S)?JM1[E[S#5S'.&U\<.^]: MS9U;\B[7!79-_LZ7+S0W^!V^#N+0%J<&M4T9M:B`;9,$P\)N:_SO=^EW>LQ' M2THX2YG;*=["M)558O\W#N7Q]BLN]2MKX]7\$77-P'$O>?__`6CTNS%-<P`` ` end |
From: Martin J. B. <mb...@ar...> - 2002-10-12 01:31:28
|
> This patch fixes some of the missed handle_sysrq functions not updated. > please apply. Are you going to have early console support (ie printk from before what is now console_init) done before the freeze, or should I just submit our version? Thanks, Martin. |
From: James S. <jsi...@in...> - 2002-10-12 01:29:45
|
console keyboard clean up. I'm preparing for when the global array of struct kbd_struct will go away. You can import this changeset into BK by piping this whole message to: '| bk receive [path to repository]' or apply the patch as usual. =================================================================== ChangeSet@1.573.100.14, 2002-10-08 13:01:35-07:00, jsi...@ma... Moved keyboard defines around and made code easier to read.Name change for console_init to con_init. Makes it clear it is for VTs. drivers/char/keyboard.c | 57 ++++++++++++++--------------------------------- drivers/char/tty_io.c | 2 - drivers/char/vt.c | 30 +++++------------------- drivers/char/vt_ioctl.c | 6 ++-- include/linux/kbd_kern.h | 28 ++++++++++++++--------- include/linux/tty.h | 6 ++++ 6 files changed, 52 insertions(+), 77 deletions(-) diff -Nru a/drivers/char/keyboard.c b/drivers/char/keyboard.c --- a/drivers/char/keyboard.c Fri Oct 11 18:15:37 2002 +++ b/drivers/char/keyboard.c Fri Oct 11 18:15:37 2002 @@ -44,30 +44,9 @@ static void kbd_disconnect(struct input_handle *handle); extern void ctrl_alt_del(void); - -/* - * Exported functions/variables - */ - -#ifndef KBD_DEFMODE -#define KBD_DEFMODE ((1 << VC_REPEAT) | (1 << VC_META)) -#endif - -#ifndef KBD_DEFLEDS -/* - * Some laptops take the 789uiojklm,. keys as number pad when NumLock is on. - * This seems a good reason to start with NumLock off. - */ -#define KBD_DEFLEDS 0 -#endif - -#ifndef KBD_DEFLOCK -#define KBD_DEFLOCK 0 -#endif - +void compute_shiftstate(void); struct pt_regs *kbd_pt_regs; EXPORT_SYMBOL(kbd_pt_regs); -void compute_shiftstate(void); /* * Handler Tables. @@ -418,7 +397,7 @@ diacr = 0; } put_queue(vc, 13); - if (vc_kbd_mode(kbd, VC_CRLF)) + if (get_kbd_mode(kbd, VC_CRLF)) put_queue(vc, 10); } @@ -426,14 +405,14 @@ { if (rep) return; - chg_vc_kbd_led(kbd, VC_CAPSLOCK); + chg_kbd_led(kbd, VC_CAPSLOCK); } static void fn_caps_on(struct vc_data *vc) { if (rep) return; - set_vc_kbd_led(kbd, VC_CAPSLOCK); + set_kbd_led(kbd, VC_CAPSLOCK); } static void fn_show_ptregs(struct vc_data *vc) @@ -462,7 +441,7 @@ static void fn_num(struct vc_data *vc) { - if (vc_kbd_mode(kbd,VC_APPLIC)) + if (get_kbd_mode(kbd,VC_APPLIC)) applkey(vc, 'P', 1); else fn_bare_num(vc); @@ -477,7 +456,7 @@ static void fn_bare_num(struct vc_data *vc) { if (!rep) - chg_vc_kbd_led(kbd, VC_NUMLOCK); + chg_kbd_led(kbd, VC_NUMLOCK); } static void fn_lastcons(struct vc_data *vc) @@ -664,7 +643,7 @@ if (up_flag) return; - applkey(vc, cur_chars[value], vc_kbd_mode(kbd, VC_CKMODE)); + applkey(vc, cur_chars[value], get_kbd_mode(kbd, VC_CKMODE)); } static void k_pad(struct vc_data *vc, unsigned char value, char up_flag) @@ -676,12 +655,12 @@ return; /* no action, if this is a key release */ /* kludge... shift forces cursor/number keys */ - if (vc_kbd_mode(kbd, VC_APPLIC) && !shift_down[KG_SHIFT]) { + if (get_kbd_mode(kbd, VC_APPLIC) && !shift_down[KG_SHIFT]) { applkey(vc, app_map[value], 1); return; } - if (!vc_kbd_led(kbd, VC_NUMLOCK)) + if (!get_kbd_led(kbd, VC_NUMLOCK)) switch (value) { case KVAL(K_PCOMMA): case KVAL(K_PDOT): @@ -715,12 +694,12 @@ k_fn(vc, KVAL(K_PGUP), 0); return; case KVAL(K_P5): - applkey(vc, 'G', vc_kbd_mode(kbd, VC_APPLIC)); + applkey(vc, 'G', get_kbd_mode(kbd, VC_APPLIC)); return; } put_queue(vc, pad_chars[value]); - if (value == KVAL(K_PENTER) && vc_kbd_mode(kbd, VC_CRLF)) + if (value == KVAL(K_PENTER) && get_kbd_mode(kbd, VC_CRLF)) put_queue(vc, 10); } @@ -737,7 +716,7 @@ if (value == KVAL(K_CAPSSHIFT)) { value = KVAL(K_SHIFT); if (!up_flag) - clr_vc_kbd_led(kbd, VC_CAPSLOCK); + clr_kbd_led(kbd, VC_CAPSLOCK); } if (up_flag) { @@ -770,7 +749,7 @@ if (up_flag) return; - if (vc_kbd_mode(kbd, VC_META)) { + if (get_kbd_mode(kbd, VC_META)) { put_queue(vc, '\033'); put_queue(vc, value); } else @@ -803,7 +782,7 @@ { if (up_flag || rep) return; - chg_vc_kbd_lock(kbd, value); + chg_kbd_lock(kbd, value); } static void k_slock(struct vc_data *vc, unsigned char value, char up_flag) @@ -811,11 +790,11 @@ k_shift(vc, value, up_flag); if (up_flag || rep) return; - chg_vc_kbd_slock(kbd, value); + chg_kbd_slock(kbd, value); /* try to make Alt, oops, AltGr and such work */ if (!key_maps[kbd->lockstate ^ kbd->slockstate]) { kbd->slockstate = 0; - chg_vc_kbd_slock(kbd, value); + chg_kbd_slock(kbd, value); } } @@ -1060,7 +1039,7 @@ else clear_bit(keycode, key_down); - if (rep && (!vc_kbd_mode(kbd, VC_REPEAT) || (tty && + if (rep && (!get_kbd_mode(kbd, VC_REPEAT) || (tty && (!L_ECHO(tty) && tty->driver.chars_in_buffer(tty))))) { /* * Don't repeat a key if the input buffers are not empty and the @@ -1094,7 +1073,7 @@ if (type == KT_LETTER) { type = KT_LATIN; - if (vc_kbd_led(kbd, VC_CAPSLOCK)) { + if (get_kbd_led(kbd, VC_CAPSLOCK)) { key_map = key_maps[shift_final ^ (1 << KG_SHIFT)]; if (key_map) keysym = key_map[keycode]; diff -Nru a/drivers/char/tty_io.c b/drivers/char/tty_io.c --- a/drivers/char/tty_io.c Fri Oct 11 18:15:37 2002 +++ b/drivers/char/tty_io.c Fri Oct 11 18:15:37 2002 @@ -2190,7 +2190,7 @@ disable_early_printk(); #endif #ifdef CONFIG_VT - con_init(); + vt_console_init(); #endif #ifdef CONFIG_AU1000_SERIAL_CONSOLE au1000_serial_console_init(); diff -Nru a/drivers/char/vt.c b/drivers/char/vt.c --- a/drivers/char/vt.c Fri Oct 11 18:15:37 2002 +++ b/drivers/char/vt.c Fri Oct 11 18:15:37 2002 @@ -150,7 +150,6 @@ static void hide_cursor(int currcons); static void unblank_screen_t(unsigned long dummy); static void console_callback(void *ignored); -static void __init con_init_devfs (void); static int printable; /* Is console ready for printing? */ @@ -812,9 +811,9 @@ * VT102 emulator */ -#define set_kbd(x) set_vc_kbd_mode(kbd_table+currcons,x) -#define clr_kbd(x) clr_vc_kbd_mode(kbd_table+currcons,x) -#define is_kbd(x) vc_kbd_mode(kbd_table+currcons,x) +#define set_kbd(x) set_kbd_mode(kbd_table+currcons,x) +#define clr_kbd(x) clr_kbd_mode(kbd_table+currcons,x) +#define is_kbd(x) get_kbd_mode(kbd_table+currcons,x) #define decarm VC_REPEAT #define decckm VC_CKMODE @@ -2325,7 +2324,7 @@ console_num = minor(tty->device) - (tty->driver.minor_start); if (!vc_cons_allocated(console_num)) return; - set_vc_kbd_led(kbd_table + console_num, VC_SCROLLOCK); + set_kbd_led(kbd_table + console_num, VC_SCROLLOCK); set_leds(); } @@ -2340,7 +2339,7 @@ console_num = minor(tty->device) - (tty->driver.minor_start); if (!vc_cons_allocated(console_num)) return; - clr_vc_kbd_led(kbd_table + console_num, VC_SCROLLOCK); + clr_kbd_led(kbd_table + console_num, VC_SCROLLOCK); set_leds(); } @@ -2435,7 +2434,7 @@ struct tty_driver console_driver; static int console_refcount; -void __init con_init(void) +void __init vt_console_init(void) { const char *display_desc = NULL; unsigned int currcons = 0; @@ -2499,9 +2498,8 @@ console_driver.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_RESET_TERMIOS; /* Tell tty_register_driver() to skip consoles because they are * registered before kmalloc() is ready. We'll patch them in later. - * See comments at console_init(); see also con_init_devfs(). + * See comments at console_init(); */ - console_driver.flags |= TTY_DRIVER_NO_DEVFS; console_driver.refcount = &console_refcount; console_driver.table = console_table; console_driver.termios = console_termios; @@ -2525,7 +2523,6 @@ kbd_init(); console_map_init(); - con_init_devfs(); vcs_init(); return 0; } @@ -2618,19 +2615,6 @@ unsigned int mode; get_user(mode, argp); vesa_blank_mode = (mode < 4) ? mode : 0; -} - -/* We can't register the console with devfs during con_init(), because it - * is called before kmalloc() works. This function is called later to - * do the registration. - */ -static void __init con_init_devfs (void) -{ - int i; - - for (i = 0; i < console_driver.num; i++) - tty_register_devfs (&console_driver, DEVFS_FL_AOPEN_NOTIFY, - console_driver.minor_start + i); } /* diff -Nru a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c --- a/drivers/char/vt_ioctl.c Fri Oct 11 18:15:37 2002 +++ b/drivers/char/vt_ioctl.c Fri Oct 11 18:15:37 2002 @@ -527,10 +527,10 @@ case KDSKBMETA: switch(arg) { case K_METABIT: - clr_vc_kbd_mode(kbd, VC_META); + clr_kbd_mode(kbd, VC_META); break; case K_ESCPREFIX: - set_vc_kbd_mode(kbd, VC_META); + set_kbd_mode(kbd, VC_META); break; default: return -EINVAL; @@ -538,7 +538,7 @@ return 0; case KDGKBMETA: - ucval = (vc_kbd_mode(kbd, VC_META) ? K_ESCPREFIX : K_METABIT); + ucval = (get_kbd_mode(kbd, VC_META) ? K_ESCPREFIX : K_METABIT); setint: return put_user(ucval, (int *)arg); diff -Nru a/include/linux/kbd_kern.h b/include/linux/kbd_kern.h --- a/include/linux/kbd_kern.h Fri Oct 11 18:15:37 2002 +++ b/include/linux/kbd_kern.h Fri Oct 11 18:15:37 2002 @@ -14,6 +14,14 @@ extern char *funcbufptr; extern int funcbufsize, funcbufleft; +#define KBD_DEFMODE ((1 << VC_REPEAT) | (1 << VC_META)) +/* + * Some laptops take the 789uiojklm,. keys as number pad when NumLock is on. + * This seems a good reason to start with NumLock off. + */ +#define KBD_DEFLEDS 0 +#define KBD_DEFLOCK 0 + /* * kbd->xxx contains the VC-local things (flag settings etc..) * @@ -82,52 +90,52 @@ tasklet_schedule(&keyboard_tasklet); } -static inline int vc_kbd_mode(struct kbd_struct * kbd, int flag) +static inline int get_kbd_mode(struct kbd_struct * kbd, int flag) { return ((kbd->modeflags >> flag) & 1); } -static inline int vc_kbd_led(struct kbd_struct * kbd, int flag) +static inline int get_kbd_led(struct kbd_struct * kbd, int flag) { return ((kbd->ledflagstate >> flag) & 1); } -static inline void set_vc_kbd_mode(struct kbd_struct * kbd, int flag) +static inline void set_kbd_mode(struct kbd_struct * kbd, int flag) { kbd->modeflags |= 1 << flag; } -static inline void set_vc_kbd_led(struct kbd_struct * kbd, int flag) +static inline void set_kbd_led(struct kbd_struct * kbd, int flag) { kbd->ledflagstate |= 1 << flag; } -static inline void clr_vc_kbd_mode(struct kbd_struct * kbd, int flag) +static inline void clr_kbd_mode(struct kbd_struct * kbd, int flag) { kbd->modeflags &= ~(1 << flag); } -static inline void clr_vc_kbd_led(struct kbd_struct * kbd, int flag) +static inline void clr_kbd_led(struct kbd_struct * kbd, int flag) { kbd->ledflagstate &= ~(1 << flag); } -static inline void chg_vc_kbd_lock(struct kbd_struct * kbd, int flag) +static inline void chg_kbd_lock(struct kbd_struct * kbd, int flag) { kbd->lockstate ^= 1 << flag; } -static inline void chg_vc_kbd_slock(struct kbd_struct * kbd, int flag) +static inline void chg_kbd_slock(struct kbd_struct * kbd, int flag) { kbd->slockstate ^= 1 << flag; } -static inline void chg_vc_kbd_mode(struct kbd_struct * kbd, int flag) +static inline void chg_kbd_mode(struct kbd_struct * kbd, int flag) { kbd->modeflags ^= 1 << flag; } -static inline void chg_vc_kbd_led(struct kbd_struct * kbd, int flag) +static inline void chg_kbd_led(struct kbd_struct * kbd, int flag) { kbd->ledflagstate ^= 1 << flag; } diff -Nru a/include/linux/tty.h b/include/linux/tty.h --- a/include/linux/tty.h Fri Oct 11 18:15:37 2002 +++ b/include/linux/tty.h Fri Oct 11 18:15:37 2002 @@ -348,7 +348,6 @@ extern int kmsg_redirect; -extern void con_init(void); extern void console_init(void); extern int lp_init(void); @@ -368,6 +367,7 @@ extern int espserial_init(void); extern int macserial_init(void); extern int a2232board_init(void); +extern void vt_console_init(void); extern int tty_paranoia_check(struct tty_struct *tty, kdev_t device, const char *routine); @@ -418,6 +418,10 @@ extern void console_print(const char *); /* vt.c */ + +extern int vty_init(void); + +/* vt_ioctl.c */ extern int vt_ioctl(struct tty_struct *tty, struct file * file, unsigned int cmd, unsigned long arg); =================================================================== This BitKeeper patch contains the following changesets: 1.573.100.14 ## Wrapped with gzip_uu ## begin 664 bkpatch2413 M'XL(`+EWIST``\U9:V_;N!+];/T*+@KLVFTLDQ+U<C?W-HV=KI&D-9RT6&!W M8<@2%6NC1R#)27JO?OP.2<OQ^]4N4"?QR-9P=#B<.3-D7J'/.<O:M;_S,([3 M)%=>H=_2O&C78O?YB461RMRL&$=A<J\FK("[@S2%NZU)GK7RS&MY,":-6#,O MW%'$%%#HNX4W1H\LR]LUHNJS;XJO#ZQ=&W0_?+XZ&RC*Z2DZ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1M0G^6-/Z&7$"VK>.?==>B!=R.QBTV*Q<XI+[*) M5R#1:<C+UT@D%M<,(O<.NBE'I+EXWVR-]PM[&1/0G%5H8F.0'XH-4D:V,*OH M%@SN"P]*J;2W`>`"Q^UED$B`9`/`^=9T/WL2(-D$<+X7W<N@)@%JFP`N-*+[ M6900M1T0]_>A+#12;)OS?CY<+0?B)/702K#_L>[6&K!PBEO1OZ;K)OE&^C=^ M_,Y5'E9O+03"/<=T)[HA>@A='"BPYP**B8R6M<=>;_GI`484V'.JR^/ED??- F<SI_0F5`<\TM\//L_YC>F'GW^20^9:[N^`ZSE'\`J'JPTT0=```` ` end |
From: James S. <jsi...@in...> - 2002-10-12 01:13:15
|
This patch fixes some of the missed handle_sysrq functions not updated. please apply. You can import this changeset into BK by piping this whole message to: '| bk receive [path to repository]' or apply the patch as usual. =================================================================== ChangeSet@1.691, 2002-10-08 13:40:24-07:00, jsi...@ma... Already fixed. arch/um/kernel/um_arch.c | 2 +- drivers/tc/zs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff -Nru a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c --- a/arch/um/kernel/um_arch.c Wed Oct 9 08:36:23 2002 +++ b/arch/um/kernel/um_arch.c Wed Oct 9 08:36:23 2002 @@ -337,7 +337,7 @@ void *unused2) { #ifdef CONFIG_SYSRQ - handle_sysrq('p', ¤t->thread.regs, NULL, NULL); + handle_sysrq('p', ¤t->thread.regs, NULL); #endif machine_halt(); return(0); diff -Nru a/drivers/tc/zs.c b/drivers/tc/zs.c --- a/drivers/tc/zs.c Wed Oct 9 08:36:23 2002 +++ b/drivers/tc/zs.c Wed Oct 9 08:36:23 2002 @@ -443,7 +443,7 @@ if (break_pressed && info->line == sercons.index) { if (ch != 0 && time_before(jiffies, break_pressed + HZ*5)) { - handle_sysrq(ch, regs, NULL, NULL); + handle_sysrq(ch, regs, NULL); break_pressed = 0; goto ignore_char; } =================================================================== This BitKeeper patch contains the following changesets: + ## W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as S. <an...@sc...> - 2002-10-11 10:25:34
|
i am observing a memory corruption in the tty_struct. (at least) the flip structure is overwritten. I know that this can not only be due to the backport to 2.4 (i use the ruby backport) and to Aivils added memset()s after kalloc()s, because there is a comment in that flip stucture saying: >·······unsigned char>··slop[4]; /* N.B. bug overwrites buffer by 1 */ I tried to track this down with (among others) kdb, but that seems to have problems with trapping some special memory writes. Keith works on that... So has someone experienced something similar and found the reason? (i noticed that in tty_io.h there are several points where return values are not caught and no error handling is in place. is this work in progress? By whom?) |
From: Vojtech P. <vo...@su...> - 2002-10-11 09:52:54
|
On Thu, Oct 10, 2002 at 05:52:27PM -0700, Zach Welch wrote: > Attached is a quick backport of the 2.5 user level input driver, > diffed against the latest linux-2.4 BK tree. It's pretty much exactly > what I was dreaming about writing, so thanks to everyone that beat me to > the punch. I've also attached a patch against the latest 2.5 BK tree > that includes the fixes I've made. For historical reference, the > Makefile versions are 2.4.20-pre9 and 2.5.41. Fixes for 2.5 applied. I'll probably not be pushing the backport until the 2.5 input is stable, at which point I'll backport it to 2.4 as a whole (except, of course, keeping 2.4 keyboard and mice as they are). > I changed the semantics of the read function, as changed by Vojtech > yesterday. It seems to me that you don't want to block on read waiting > for "an event to arrive AND the device to be created" (quote is > paraphrasing of wait condition code). That will never wake up in a > single threaded program, as creation requires an ioctl to be sent - but > you're blocking... e.g cat will require SIGINT.... > > Instead, I changed read to check that the device exists or return ENODEV > at the very start, which then simplifies the existing async code and > wait condition. The wait condition was also changed to handle the event > of the device being destroyed in another thread, so the reader will then > correctly receive a ENODEV in that case as well. The second case might > better be considered an EOF condition instead, as the device did exist > when the call was started. That should be a trivial change as well, but > it is left as an exercise for the reader. :) > > Why can't the device attributes be changed once the input device is > registered? For example, we want to be able to dynamically adjust the > abs* fields. And yes, I know it's sick, but it seems like it will be > worse if our program frequently registers and unregisters its devices. > If we want to effect a change to a number of devices, there will be > quite a bit of thrashing around in the system. I suppose the real > problem lies in notifying the consumers of the device that its > attributes have changed. Oh well. Something for us to thing about. This is planned, you send an event (EV_SYN, SYN_CONFIG) when you changed the values. > Also, is there a 'virtual' bus id that can be used? With its own space > of assigned vendor/product keys? We're currently using our USB device > id and what, but we will want to be able to create input devices with no > matching hardware. Thoughts? Create it. -- Vojtech Pavlik SuSE Labs |
From: jedy w. <jed...@pr...> - 2002-10-11 01:03:48
|
lin...@li... wrote: >Send Linuxconsole-dev mailing list submissions to > lin...@li... > >To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/linuxconsole-dev >or, via email, send a message with subject or body 'help' to > lin...@li... > >You can reach the person managing the list at > lin...@li... > >When replying, please edit your Subject line so it is more specific >than "Re: Contents of Linuxconsole-dev digest..." > > >Today's Topics: > > 1. [BK PATCH] last sysrq fixes. (James Simmons) > >--__--__-- > >Message: 1 >Date: Wed, 9 Oct 2002 09:13:37 -0700 (PDT) >From: James Simmons <jsi...@in...> >To: Linus Torvalds <tor...@tr...> >cc: Linux console project <lin...@li...>, > Linux Kernel Mailing List <lin...@vg...> >Subject: [BK PATCH] last sysrq fixes. > > >This patch fixes the last of the handle_sysrq breakage. > >MS: (n) 1. A debilitating and surprisingly widespread affliction that >renders the sufferer barely able to perform the simplest task. 2. A disease. > >James Simmons [jsi...@us...] ____/| >fbdev/console/gfx developer \ o.O| >http://www.linux-fbdev.org =(_)= >http://linuxgfx.sourceforge.net U >http://linuxconsole.sourceforge.net > >You can import this changeset into BK by piping this whole message to: >'| bk receive [path to repository]' or apply the patch as usual. > >=================================================================== > > >ChangeSet@1.691, 2002-10-08 13:40:24-07:00, jsi...@ma... > Already fixed. > > > arch/um/kernel/um_arch.c | 2 +- > drivers/tc/zs.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > >diff -Nru a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c >--- a/arch/um/kernel/um_arch.c Wed Oct 9 08:36:23 2002 >+++ b/arch/um/kernel/um_arch.c Wed Oct 9 08:36:23 2002 >@@ -337,7 +337,7 @@ > void *unused2) > { > #ifdef CONFIG_SYSRQ >- handle_sysrq('p', ¤t->thread.regs, NULL, NULL); >+ handle_sysrq('p', ¤t->thread.regs, NULL); > #endif > machine_halt(); > return(0); >diff -Nru a/drivers/tc/zs.c b/drivers/tc/zs.c >--- a/drivers/tc/zs.c Wed Oct 9 08:36:23 2002 >+++ b/drivers/tc/zs.c Wed Oct 9 08:36:23 2002 >@@ -443,7 +443,7 @@ > if (break_pressed && info->line == sercons.index) { > if (ch != 0 && > time_before(jiffies, break_pressed + HZ*5)) { >- handle_sysrq(ch, regs, NULL, NULL); >+ handle_sysrq(ch, regs, NULL); > break_pressed = 0; > goto ignore_char; > } > >=================================================================== > > >This BitKeeper patch contains the following changesets: >+ >## Wrapped with gzip_uu ## > > >begin 664 bkpatch7145 >M'XL(`/=,I#T``\U674_;,!1]QK_"$H]3DWMM)[$C=2J#:9-8-<3$\V0<0T.3 >M!B4I'U-^_)RT?(HVI<"TME*MQ#X^]][C<[U+3RI;QCL759KGQ:PBN_1[4=7Q >M3JYOKFV6>5:7]21+9U-O9FOW]K@HW%M_7I5^51K?N#5%9@=5K4\S2]R$(UV; >M";VR917OH,?OG]2WES;>.?[Z[>3'WC$APR'=G^C9N?UE:SH<DKHHKW265"/M >MMBMF7EWJ697;6GNFR)O[J0T#8.X;8,0A"!L,042-P011"[0),"%#0>["&;T8 >MQC,X!)`.D[.P"8142`XH>J%""LQ'\$%2Y+&`F(D!1#$`78]./W$Z`/*%OF]( >M^\30O:RT.KFE9^F-33R2]C!YOH?"")6+%QN(%,@MUDL4G`>\X4Q*M=7ZD$F4 >M#0\C9.20!C+D`1F_$>?H04ID\,H/(:"!?.XI5E*FK:+]VOA_*L\\*ID`1P,1 >M1-`X5AH,!MR&8`+9IY,701=:="D6#:A02,?L(DFG=C35I;Y=D-&EF?CSW)_: >M<F8S-_K=/KECI9!AQ"(A&A8QAHVQG">G@$:*T$V(^EBM17]$3Z`+W=&[;$_W >M^JQ57(%O)KKT35UF[>!Q"J4#Q095%$;-62@2$W&TD53@2KMI"E?NL"#LF';Y >M5$%G/*M";'WHG;/=YT1]Z)W0(6B$0AYVQL2?V!(/8KZI+<&'V=*\+FANRW.; >MM)[097">9][F661MA3B"4U6D6F-8J&O\'F`_Z:"\[G[NM!^M+/X6SM%J:9T" >M6SU]Z/'H4U?_#@\*XUP%T"DL>-[X\!4*PW_3^"HSN4X3>U9-;T>)]=+3?+.4 >MNF0*E"(`M@SXK5"!\_ZEM1S2[F_\?HC/I+L.8`OY'C!!\8F(EYVH_SZV53_< >M5*U/0!\$"LJ=YTZ@T?]N@7IZF8^2]-P6*[/5-B8'ZZK=N"%7G7I<OQ]OM7B% >?4)9KMK&VNVN[F5@SK>;YT-74W91`D+\2(U7K,PP````` >` >end > > > > >--__--__-- > >_______________________________________________ >Linuxconsole-dev mailing list >Lin...@li... >https://lists.sourceforge.net/lists/listinfo/linuxconsole-dev > > >End of Linuxconsole-dev Digest > > > unsubscribe |
From: Zach W. <zw...@su...> - 2002-10-11 00:52:42
|
Hi all, Attached is a quick backport of the 2.5 user level input driver, diffed against the latest linux-2.4 BK tree. It's pretty much exactly what I was dreaming about writing, so thanks to everyone that beat me to the punch. I've also attached a patch against the latest 2.5 BK tree that includes the fixes I've made. For historical reference, the Makefile versions are 2.4.20-pre9 and 2.5.41. I changed the semantics of the read function, as changed by Vojtech yesterday. It seems to me that you don't want to block on read waiting for "an event to arrive AND the device to be created" (quote is paraphrasing of wait condition code). That will never wake up in a single threaded program, as creation requires an ioctl to be sent - but you're blocking... e.g cat will require SIGINT.... Instead, I changed read to check that the device exists or return ENODEV at the very start, which then simplifies the existing async code and wait condition. The wait condition was also changed to handle the event of the device being destroyed in another thread, so the reader will then correctly receive a ENODEV in that case as well. The second case might better be considered an EOF condition instead, as the device did exist when the call was started. That should be a trivial change as well, but it is left as an exercise for the reader. :) Why can't the device attributes be changed once the input device is registered? For example, we want to be able to dynamically adjust the abs* fields. And yes, I know it's sick, but it seems like it will be worse if our program frequently registers and unregisters its devices. If we want to effect a change to a number of devices, there will be quite a bit of thrashing around in the system. I suppose the real problem lies in notifying the consumers of the device that its attributes have changed. Oh well. Something for us to thing about. Also, is there a 'virtual' bus id that can be used? With its own space of assigned vendor/product keys? We're currently using our USB device id and what, but we will want to be able to create input devices with no matching hardware. Thoughts? Cheers, Zach Welch Superlucidity Services |
From: James S. <jsi...@ph...> - 2002-10-10 20:18:00
|
Okay. Just ignore the last patch I sent you. The other patchs are fine and don't depended on that last pacth. On Wed, 9 Oct 2002, Linus Torvalds wrote: > > On Wed, 9 Oct 2002, James Simmons wrote: > > > > This patch moves the terminal emulation code out of vt.c. Not in use yet > > but I wanted to make the patch as small as possible. > > Actually, I find that a small patch that does nothing useful is never > preferable over a larger patch that actually _does_ something. > > I hate having many "nonsense patches" followed by one small patch to > enable it all. That just hides the real changes, and then the small patch > _looks_ innocent, even though it may break everything in very subtle ways. > > Linus > > |
From: Linus T. <tor...@tr...> - 2002-10-09 19:51:36
|
On Wed, 9 Oct 2002, James Simmons wrote: > > This patch moves the terminal emulation code out of vt.c. Not in use yet > but I wanted to make the patch as small as possible. Actually, I find that a small patch that does nothing useful is never preferable over a larger patch that actually _does_ something. I hate having many "nonsense patches" followed by one small patch to enable it all. That just hides the real changes, and then the small patch _looks_ innocent, even though it may break everything in very subtle ways. Linus |
From: James S. <jsi...@in...> - 2002-10-09 19:21:30
|
This patch moves the terminal emulation code out of vt.c. Not in use yet but I wanted to make the patch as small as possible. MS: (n) 1. A debilitating and surprisingly widespread affliction that renders the sufferer barely able to perform the simplest task. 2. A disease. James Simmons [jsi...@us...] ____/| fbdev/console/gfx developer \ o.O| http://www.linux-fbdev.org =(_)= http://linuxgfx.sourceforge.net U http://linuxconsole.sourceforge.net You can import this changeset into BK by piping this whole message to: '| bk receive [path to repository]' or apply the patch as usual. =================================================================== ChangeSet@1.719, 2002-10-09 12:02:12-07:00, jsi...@ma... This file contains the terminal emulation code. The idea was to allow a lightweight vt console system for printk that didn't have the heavyness of terminal emulation. decvte.c | 2054 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 2054 insertions(+) diff -Nru a/drivers/char/decvte.c b/drivers/char/decvte.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/drivers/char/decvte.c Wed Oct 9 12:03:14 2002 @@ -0,0 +1,2054 @@ +/* + * decvte.c - DEC VT terminal emulation code. + * Copyright (C) 2000 James Simmons + * + * I moved all the VT emulation code out of console.c to here. It makes life + * much easier and the code smaller. It also allows other devices to emulate + * a TTY besides the video system. People can also change the makefile to + * support a different emulation if they wanted. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +#include <linux/module.h> +#include <linux/sched.h> +#include <linux/tty.h> +#include <linux/tty_flip.h> +#include <linux/kernel.h> +#include <linux/string.h> +#include <linux/errno.h> +#include <linux/kd.h> +#include <linux/slab.h> +#include <linux/major.h> +#include <linux/mm.h> +#include <linux/init.h> +#include <linux/devfs_fs_kernel.h> +#include <linux/vt_kern.h> +#include <linux/vt_buffer.h> +#include <linux/selection.h> +#include <linux/consolemap.h> +#include <linux/config.h> +#include <linux/version.h> + +#include <asm/io.h> +#include <asm/system.h> +#include <asm/uaccess.h> +#include <asm/bitops.h> + +#include <asm/linux_logo.h> + +#include "console_macros.h" + +/* + * DEC VT emulator + */ + +/* Different states of the emulator */ +enum { ESinit, + /* ESC substates */ + ESesc, ESacs, ESscf, ESgzd4, ESg1d4, ESg2d4, + ESg3d4, ESg1d6, ESg2d6, ESg3d6, ESdocs, + /* CSI substates */ + EScsi, EScsi_getpars, EScsi_gotpars, EScsi_space, + EScsi_exclam, EScsi_dquote, EScsi_dollar, EScsi_and, + EScsi_squote, EScsi_star, EScsi_plus, + /* OSC substates */ + ESosc, ESpalette, + /* Misc. states */ + ESfunckey, ESignore, +}; + +#define __VTE_CSI (c8bit == 0 ? "\033[" : "\233") +#define __VTE_DCS (c8bit == 0 ? "\033P" : "\220") +#define __VTE_ST (c8bit == 0 ? "\033\\" : "\234") +#define __VTE_APC (c8bit == 0 ? "\033_" : "\237") + +/* + * this is what the terminal answers to a ESC-Z or csi0c query. + */ +#define VT100ID "\033[?1;2c" +#define VT102ID "\033[?6c" + +/* + * Here is the default bell parameters: 750HZ, 1/8th of a second + */ +#define DEFAULT_BELL_PITCH 750 +#define DEFAULT_BELL_DURATION (HZ/8) + +/* + * LINE FEED (LF) + */ +void vte_lf(struct vc_data *vc) +{ + /* don't scroll if above bottom of scrolling region, or + * if below scrolling region + */ + if (y + 1 == bottom) + scroll_region_up(vc, top, bottom, 1); + else if (y < video_num_lines - 1) { + y++; + pos += video_size_row; + } + need_wrap = 0; +} + +/* + * REVERSE LINE FEED (RI) + */ +static void vte_ri(struct vc_data *vc) +{ + /* don't scroll if below top of scrolling region, or + * if above scrolling region + */ + if (y == top) + scroll_region_down(vc, top, bottom, 1); + else if (y > 0) { + y--; + pos -= video_size_row; + } + need_wrap = 0; +} + +/* + * CARRIAGE RETURN (CR) + */ +inline void vte_cr(struct vc_data *vc) +{ + pos -= x << 1; + need_wrap = x = 0; +} + +/* + * BACK SPACE (BS) + */ +inline void vte_bs(struct vc_data *vc) +{ + if (x) { + pos -= 2; + x--; + need_wrap = 0; + } +} + +/* + * CURSOR LINE TABULATION (CVT) + * + * NOTE: + * In accordance with our interpretation of VT as LF we will treat CVT as + * (par[0] * LF). Not very creative, but at least consequent. + */ +static void vte_cvt(struct vc_data *vc, int vpar) +{ + int i; + + for (i = 0; i < vpar; i++) { + vte_lf(vc); + } +} + +/* + * CURSOR BACKWARD TABULATION (CBT) + */ +static void vte_cbt(struct vc_data *vc, int vpar) +{ + int i; + + for (i = 0; i < vpar; i++) { + pos -= (x << 1); + while (x > 0) { + x--; + if (tab_stop[x >> 5] & (1 << (x & 31))) + break; + } + pos += (x << 1); + } +} + +/* + * CURSOR FORWARD TABULATION (CHT) + */ +static void vte_cht(struct vc_data *vc, int vpar) +{ + int i; + + for (i = 0; i < vpar; i++) { + pos -= (x << 1); + while (x < video_num_columns - 1) { + x++; + if (tab_stop[x >> 5] & (1 << (x & 31))) + break; + } + pos += (x << 1); + } +} + +/* + * ERASE IN PAGE (ED) + */ +void vte_ed(struct vc_data *vc, int vpar) +{ + unsigned short *start; + unsigned int count; + + switch (vpar) { + case 0: /* erase from cursor to end of display */ + count = (scr_end - pos) >> 1; + start = (unsigned short *) pos; + /* do in two stages */ + clear_region(vc, x, y, video_num_columns - x, 1); + clear_region(vc, 0, y + 1, video_num_columns, + video_num_lines - y - 1); + break; + case 1: /* erase from start to cursor */ + count = ((pos - origin) >> 1) + 1; + start = (unsigned short *) origin; + /* do in two stages */ + clear_region(vc, 0, 0, video_num_columns, y); + clear_region(vc, 0, y, x + 1, 1); + break; + case 2: /* erase whole display */ + count = video_num_columns * video_num_lines; + start = (unsigned short *) origin; + clear_region(vc, 0, 0, video_num_columns, video_num_lines); + break; + default: + return; + } + scr_memsetw(start, video_erase_char, 2 * count); + need_wrap = 0; +} + +/* + * ERASE IN LINE (EL) + */ +static void vte_el(struct vc_data *vc, int vpar) +{ + unsigned int count; + unsigned short *start; + + switch (vpar) { + case 0: /* erase from cursor to end of line */ + count = video_num_columns - x; + start = (unsigned short *) pos; + clear_region(vc, x, y, video_num_columns - x, 1); + break; + case 1: /* erase from start of line to cursor */ + start = (unsigned short *) (pos - (x << 1)); + count = x + 1; + clear_region(vc, 0, y, x + 1, 1); + break; + case 2: /* erase whole line */ + start = (unsigned short *) (pos - (x << 1)); + count = video_num_columns; + clear_region(vc, 0, y, video_num_columns, 1); + break; + default: + return; + } + scr_memsetw(start, video_erase_char, 2 * count); + need_wrap = 0; +} + +/* + * Erase character (ECH) + * + * NOTE: This function is not available in DEC VT1xx terminals. + */ +static void vte_ech(struct vc_data *vc, int vpar) +{ + int count; + + if (!vpar) + vpar++; + count = + (vpar > + video_num_columns - x) ? (video_num_columns - x) : vpar; + + scr_memsetw((unsigned short *) pos, video_erase_char, 2 * count); + clear_region(vc, x, y, count, 1); + need_wrap = 0; +} + +/* + * SELECT GRAPHIC RENDITION (SGR) + * + * NOTE: The DEC vt1xx series only implements attribute values 0,1,4,5 and 7. + */ +static void vte_sgr(struct vc_data *vc) +{ + int i; + + for (i = 0; i <= npar; i++) + switch (par[i]) { + case 0: /* all attributes off */ + default_attr(vc); + break; + case 1: /* bold or increased intensity */ + intensity = 2; + break; + case 2: /* faint or decreased intensity */ + intensity = 0; + break; + case 4: /* singly underlined. */ + underline = 1; + break; + case 5: /* slowly blinking (< 2.5 Hz) */ + case 6: /* rapidly blinking (>= 2.5 Hz) */ + blink = 1; + break; + case 7: /* negative image */ + reverse = 1; + break; + case 10: /* primary (default) font + * ANSI X3.64-1979 (SCO-ish?) + * Select primary font, don't display + * control chars if defined, don't set + * bit 8 on output. + */ + set_translate(vc, charset == 0 ? + G0_charset : G1_charset); + disp_ctrl = 0; + toggle_meta = 0; + break; + case 11: /* first alternative font + * ANSI X3.64-1979 (SCO-ish?) + * Select first alternate font, lets + * chars < 32 be displayed as ROM chars. + */ + set_translate(vc, IBMPC_MAP); + disp_ctrl = 1; + toggle_meta = 0; + break; + case 12: /* second alternative font + * Select second alternate font, toggle + * high bit before displaying as ROM char. + */ + set_translate(vc, IBMPC_MAP); + disp_ctrl = 1; + toggle_meta = 1; + break; + case 21: /* normal intensity */ + case 22: /* normal intensity */ + intensity = 1; + break; + case 24: /* not underlined (neither singly nor doubly) */ + underline = 0; + break; + case 25: /* steady (not blinking) */ + blink = 0; + break; + case 27: /* positive image */ + reverse = 0; + break; + case 38: /* foreground color (ISO 8613-6/ITU T.416) + * Enables underscore, white foreground + * with white underscore (Linux - use + * default foreground). + */ + color = (def_color & 0x0f) | background; + underline = 1; + break; + case 39: /* default display color */ + color = (def_color & 0x0f) | background; + underline = 0; + break; + case 49: /* default background color */ + color = (def_color & 0xf0) | foreground; + break; + default: + if (par[i] >= 30 && par[i] <= 37) + color = color_table[par[i] - 30] + | background; + else if (par[i] >= 40 && par[i] <= 47) + color = (color_table[par[i] - 40] << 4) + | foreground; + break; + } + update_attr(vc); +} + +/* + * Fake a DEC DSR for non-implemented features + */ +static void vte_fake_dec_dsr(struct tty_struct *tty, char *reply) +{ + struct vc_data *vc = (struct vc_data *) tty->driver_data; + char buf[40]; + + sprintf(buf, "%s?%sn", __VTE_CSI, reply); + respond_string(buf, tty); +} + +/* + * CURSOR POSITION REPORT (CPR) + * DEC EXTENDED CURSOR POSITION REPORT (DECXCPR) + */ +static void vte_cpr(struct tty_struct *tty, int ext) +{ + struct vc_data *vc = (struct vc_data *) tty->driver_data; + char buf[40]; + + if (ext) { + /* + * NOTE: Since we do not (yet?) implement any form of page + * memory, we will always return the cursor position in page 1. + */ + sprintf(buf, "%s?%d;%d;1R", __VTE_CSI, + y + (decom ? top + 1 : 1), x + 1); + } else { + sprintf(buf, "%s%d;%dR", __VTE_CSI, + y + (decom ? top + 1 : 1), x + 1); + } + respond_string(buf, tty); +} + +/* + * DEVICE STATUS REPORT (DSR) + */ +static inline void vte_dsr(struct tty_struct *tty) +{ + struct vc_data *vc = (struct vc_data *) tty->driver_data; + char buf[40]; + + sprintf(buf, "%s0n", __VTE_CSI); + respond_string(buf, tty); +} + +/* + * ANSWERBACK MESSAGE + */ +static inline void vte_answerback(struct tty_struct *tty) +{ + respond_string("l i n u x", tty); +} + +/* + * DA - DEVICE ATTRIBUTE + */ +static inline void vte_da(struct tty_struct *tty) +{ + struct vc_data *vc = (struct vc_data *) tty->driver_data; + char buf[40]; + + /* We claim VT220 compatibility... */ + sprintf(buf, "%s?62;1;2;6;7;8;9c", __VTE_CSI); + respond_string(buf, tty); +} + +#define VTE_VERSION 211 +/* + * DA - SECONDARY DEVICE ATTRIBUTE [VT220 and up] + * + * Reply parameters: + * 1 = Model (1=vt220, 18=vt330, 19=vt340, 41=vt420) + * 2 = Firmware version (nn = n.n) + * 3 = Installed options (0 = none) + */ +static void vte_dec_da2(struct tty_struct *tty) +{ + struct vc_data *vc = (struct vc_data *) tty->driver_data; + char buf[40]; + + sprintf(buf, "%s>%d;%d;0c", __VTE_CSI, 1, VTE_VERSION / 10); + respond_string(buf, tty); +} + +/* + * DA - TERTIARY DEVICE ATTRIBUTE [VT220 and up] + * + * Reply: unit ID (we report "0") + */ +static void vte_dec_da3(struct tty_struct *tty) +{ + struct vc_data *vc = (struct vc_data *) tty->driver_data; + char buf[40]; + + sprintf(buf, "%s!|%s%s", __VTE_DCS, "0", __VTE_ST); + respond_string(buf, tty); +} + +/* + * DECREPTPARM - DEC REPORT TERMINAL PARAMETERS [VT1xx/VT2xx/VT320] + */ +static void vte_decreptparm(struct tty_struct *tty) +{ + struct vc_data *vc = (struct vc_data *) tty->driver_data; + char buf[40]; + + sprintf(buf, "\033[%d;1;1;120;120;1;0x", par[0] + 2); + respond_string(buf, tty); +} + +/* + * SM - SET MODE / + * RM - RESET MODE + */ +static void set_mode(struct vc_data *vc, int on_off) +{ + int i; + + for (i = 0; i <= npar; i++) + /* DEC private modes set/reset */ + if (priv4) + switch (par[i]) { + case 1: /* DECCKM - Cursor keys mode */ + if (on_off) + set_kbd_mode(&vc->kbd_table, + VC_CKMODE); + else + clr_kbd_mode(&vc->kbd_table, + VC_CKMODE); + break; + case 2: /* DECANM - ANSI mode */ + break; + case 3: /* DECCOLM - Column mode */ +#if 0 + deccolm = on_off; + (void) vc_resize(video_num_lines, + deccolm ? 132 : 80); + /* this alone does not suffice; some user mode + utility has to change the hardware regs */ +#endif + break; + case 4: /* DECSCLM - Scrolling mode */ + break; + case 5: /* DECSCNM - Screen mode */ + if (decscnm != on_off) { + decscnm = on_off; + invert_screen(vc, 0, + screenbuf_size, 0); + update_attr(vc); + } + break; + case 6: /* DECOM - Origin mode */ + decom = on_off; + gotoxay(vc, 0, 0); + break; + case 7: /* DECAWM - Autowrap mode */ + decawm = on_off; + break; + case 8: /* DECARM - Autorepeat mode */ + decarm = on_off; + if (on_off) + set_kbd_mode(&vc->kbd_table, + VC_REPEAT); + else + clr_kbd_mode(&vc->kbd_table, + VC_REPEAT); + break; + case 9: + report_mouse = on_off ? 1 : 0; + break; + case 25: /* DECTCEM - Text cursor enable mode */ + dectcem = on_off; + break; + case 42: /* DECNCRS - National character set replacement mode */ + break; + case 60: /* DECHCCM - Horizontal cursor coupling mode */ + break; + case 61: /* DECVCCM - Vertical cursor coupling mode */ + break; + case 64: /* DECPCCM - Page cursor coupling mode */ + break; + case 66: /* DECNKM - Numeric keybad mode */ + decnkm = on_off; + if (on_off) + set_kbd_mode(&vc->kbd_table, + VC_APPLIC); + else + clr_kbd_mode(&vc->kbd_table, + VC_APPLIC); + break; + case 67: /* DECBKM - Backarrow key mode */ + break; + case 68: /* DECKBUM - Keyboard usage mode */ + break; + case 69: /* DECVSSM - Vertical split screen mode + */ + break; + case 73: /* DECXRLM - Transfer rate limiting mode */ + break; + case 81: /* DECKPM - Keyboard position mode */ + break; + case 1000: + report_mouse = on_off ? 2 : 0; + break; + } else + switch (par[i]) { /* ANSI modes set/reset */ + case 3: /* Monitor (display ctrls) */ + disp_ctrl = on_off; + break; + case 4: /* Insert Mode on/off */ + irm = on_off; + break; + case 20: /* Lf, Enter == CrLf/Lf */ + if (on_off) + set_kbd_mode(&vc->kbd_table, + VC_CRLF); + else + clr_kbd_mode(&vc->kbd_table, + VC_CRLF); + break; + } +} + +/* + * DECCIR - Cursor information report + */ +static void vte_deccir(struct tty_struct *tty) +{ + /* not yet implemented */ +} + +/* + * DECMSR - Macro space report + */ +static void vte_decmsr(struct tty_struct *tty) +{ + struct vc_data *vc = (struct vc_data *) tty->driver_data; + char buf[40]; + + sprintf(buf, "%s%d*{", __VTE_CSI, 0); /* No space left */ + respond_string(buf, tty); +} + +/* + * DECRPM - Report mode + */ +static void vte_decrpm(struct tty_struct *tty, int priv, int mode, + int status) +{ + struct vc_data *vc = (struct vc_data *) tty->driver_data; + char buf[40]; + + if (status == 0) { + status = 2; + } else { + if (status == 2) { + status = 0; + } + } + + if (priv) + sprintf(buf, "%s?%d;%d$y", __VTE_CSI, mode, status); + else + sprintf(buf, "%s%d;%d$y", __VTE_CSI, mode, status); + respond_string(buf, tty); +} + +/* + * DECRQM - Request mode + * + * Reply codes: + * 0 = reset + * 1 = set + * 2 = unknown + * 3 = premanently set + * 4 = permanently reset + */ +static void vte_decrqm(struct tty_struct *tty, int priv) +{ + struct vc_data *vc = (struct vc_data *) tty->driver_data; + + if (priv) { + switch (par[0]) { + case 1: /* DECCKM - Cursor keys mode */ + vte_decrpm(tty, priv, par[0], decckm); + break; + case 2: /* DECANM */ + case 3: /* DECCOLM */ + case 4: /* DECSCLM */ + vte_decrpm(tty, priv, par[0], 4); + break; + case 5: /* DECSCNM */ + vte_decrpm(tty, priv, par[0], decscnm); + break; + case 6: /* DECOM */ + vte_decrpm(tty, priv, par[0], decom); + break; + case 7: /* DECAWM */ + vte_decrpm(tty, priv, par[0], decawm); + break; + case 8: /* DECARM */ + vte_decrpm(tty, priv, par[0], decarm); + break; + case 25: /* DECTCEM */ + vte_decrpm(tty, priv, par[0], dectcem); + break; + case 42: /* DECNCRM */ + case 60: /* DECHCCM */ + case 61: /* DECVCCM */ + case 64: /* DECPCCM */ + vte_decrpm(tty, priv, par[0], 4); + break; + case 66: /* DECNKM */ + vte_decrpm(tty, priv, par[0], decnkm); + break; + case 67: /* DECBKM */ + case 68: /* DECKBUM */ + case 69: /* DECVSSM */ + case 73: /* DECXRLM */ + case 81: /* DECKPM */ + vte_decrpm(tty, priv, par[0], 4); + break; + default: + vte_decrpm(tty, priv, par[0], 2); + } + } else { + switch (par[0]) { + case 1: /* GATM */ + vte_decrpm(tty, priv, par[0], 4); + break; + case 2: /* KAM */ + vte_decrpm(tty, priv, par[0], kam); + break; + case 3: /* CRM */ + vte_decrpm(tty, priv, par[0], 4); + break; + case 4: /* IRM */ + vte_decrpm(tty, priv, par[0], irm); + break; + case 5: /* SRTM */ + case 6: /* ERM */ + case 7: /* VEM */ + case 8: /* BDSM */ + case 9: /* DCSM */ + case 10: /* HEM */ + case 11: /* PUM */ + case 12: /* SRM */ + case 13: /* FEAM */ + case 14: /* FETM */ + case 15: /* MATM */ + case 16: /* TTM */ + case 17: /* SATM */ + case 18: /* TSM */ + case 19: /* EBM */ + vte_decrpm(tty, priv, par[0], 4); + break; + case 20: /* LNM */ + vte_decrpm(tty, priv, par[0], lnm); + break; + case 21: /* GRCM */ + case 22: /* ZDM */ + vte_decrpm(tty, priv, par[0], 4); + break; + default: + vte_decrpm(tty, priv, par[0], 2); + } + } +} + +/* + * DECSCL - Set operating level + */ +static void vte_decscl(struct vc_data *vc) +{ + switch (par[0]) { + case 61: /* VT100 mode */ + if (npar == 1) { + decscl = 1; + c8bit = 0; + } + break; + case 62: /* VT200 mode */ + case 63: /* VT300 mode */ + case 64: /* VT400 mode */ + if (npar <= 2) { + decscl = 4; + if (par[1] == 1) + c8bit = 0; + else + c8bit = 1; + } + break; + } + return; +} + +/* + * DECTABSR - Tabulation stop report + */ +void vte_dectabsr(struct tty_struct *tty) +{ + /* not yet implemented */ +} + +/* + * DECTSR - Terminal state report + */ +void vte_dectsr(struct tty_struct *tty) +{ + /* not yet implemented */ +} + +static void setterm_command(struct vc_data *vc) +{ + switch (par[0]) { + case 1: /* set color for underline mode */ + if (can_do_color && par[1] < 16) { + ulcolor = color_table[par[1]]; + if (underline) + update_attr(vc); + } + break; + case 2: /* set color for half intensity mode */ + if (can_do_color && par[1] < 16) { + halfcolor = color_table[par[1]]; + if (intensity == 0) + update_attr(vc); + } + break; + case 8: /* store colors as defaults */ + def_color = attr; + if (hi_font_mask == 0x100) + def_color >>= 1; + default_attr(vc); + update_attr(vc); + break; + case 9: /* set blanking interval */ + vc->display_fg->blank_interval = + ((par[1] < 60) ? par[1] : 60) * 60 * HZ; + poke_blanked_console(vc->display_fg); + break; + case 10: /* set bell frequency in Hz */ + if (npar >= 1) + bell_pitch = par[1]; + else + bell_pitch = DEFAULT_BELL_PITCH; + break; + case 11: /* set bell duration in msec */ + if (npar >= 1) + bell_duration = (par[1] < 2000) ? + par[1] * HZ / 1000 : 0; + else + bell_duration = DEFAULT_BELL_DURATION; + break; + case 12: /* bring specified console to the front */ + if (par[1] >= 1 && vc_cons_allocated(par[1] - 1)) + set_console(par[1] - 1); + break; + case 13: /* unblank the screen */ + poke_blanked_console(vc->display_fg); + break; + case 14: /* set vesa powerdown interval */ + vc->display_fg->off_interval = + ((par[1] < 60) ? par[1] : 60) * 60 * HZ; + break; + } +} + +/* + * ICH - INSERT CHARACTER [VT220] + */ +static void vte_ich(struct vc_data *vc, unsigned int nr) +{ + if (nr > video_num_columns - x) + nr = video_num_columns - x; + else if (!nr) + nr = 1; + insert_char(vc, nr); +} + +/* + * IL - INSERT LINE + */ +static void vte_il(struct vc_data *vc, unsigned int nr) +{ + if (nr > video_num_lines - y) + nr = video_num_lines - y; + else if (!nr) + nr = 1; + insert_line(vc, nr); +} + +/* + * DCH - DELETE CHARACTER + */ +static void vte_dch(struct vc_data *vc, unsigned int nr) +{ + if (nr > video_num_columns - x) + nr = video_num_columns - x; + else if (!nr) + nr = 1; + delete_char(vc, nr); +} + +/* + * DL - DELETE LINE + */ +static void vte_dl(struct vc_data *vc, unsigned int nr) +{ + if (nr > video_num_lines - y) + nr = video_num_lines - y; + else if (!nr) + nr = 1; + delete_line(vc, nr); +} + +/* + * DECSC - SAVE CURSOR + * + * This saves the following states: + * - cursor position + * - graphic rendition + * - character set shift state + * - state of wrap flag + * - state of origin mode + * - state of selective erase (not implemented) + */ +void vte_decsc(struct vc_data *vc) +{ + saved_x = x; + saved_y = y; + s_intensity = intensity; + s_underline = underline; + s_blink = blink; + s_reverse = reverse; + s_charset = charset; + s_color = color; + saved_G0 = G0_charset; + saved_G1 = G1_charset; + saved_G2 = G2_charset; + saved_G3 = G3_charset; +} + +/* + * DECRC - RESTORE CURSOR + */ +static void vte_decrc(struct vc_data *vc) +{ + gotoxy(vc, saved_x, saved_y); + intensity = s_intensity; + underline = s_underline; + blink = s_blink; + reverse = s_reverse; + charset = s_charset; + color = s_color; + G0_charset = saved_G0; + G1_charset = saved_G1; + G2_charset = saved_G2; + G3_charset = saved_G3; + set_translate(vc, charset ? G1_charset : G0_charset); + update_attr(vc); + need_wrap = 0; +} + +/* + * RIS - RESET TO INITIAL STATE + * + * On DEC terminals this causes the following: + * - all set-up parameters are replaced by power-up defaults + * - all communications lines are disconnected (should we send SIGHUP to + * controlling process?) + * - all user-defined keys are cleared (not implemented) + * - the screen is cleared + * - cursor is place to upper-left corner + * - SGR state is set to normal + * - selective erase attribute write state is set to "non-selective erase" + * (not implemented) + * - all character sets are set to default (not implemented) + */ +void vte_ris(struct vc_data *vc, int do_clear) +{ + top = 0; + bottom = video_num_lines; + vc_state = ESinit; + priv1 = 0; + priv2 = 0; + priv3 = 0; + priv4 = 0; + set_translate(vc, LAT1_MAP); + G0_charset = LAT1_MAP; + G1_charset = GRAF_MAP; + charset = 0; + need_wrap = 0; + report_mouse = 0; + utf = 0; + utf_count = 0; + + disp_ctrl = 0; + toggle_meta = 0; + + c8bit = 0; /* disable 8-bit controls */ + decckm = 0; /* cursor key sequences */ + decsclm = 0; /* jump scroll */ + decscnm = 0; /* normal screen */ + decom = 0; /* absolute adressing */ + decawm = 1; /* autowrap disabled */ + decarm = 1; /* autorepeat enabled */ + dectcem = 1; /* text cursor enabled */ + + kam = 0; /* keyboard enabled */ + crm = 0; /* execute control functions */ + irm = 0; /* replace */ + lnm = 0; /* line feed */ + + set_kbd_mode(&vc->kbd_table, VC_REPEAT); + clr_kbd_mode(&vc->kbd_table, VC_CKMODE); + clr_kbd_mode(&vc->kbd_table, VC_APPLIC); + clr_kbd_mode(&vc->kbd_table, VC_CRLF); + vc->kbd_table.lockstate = KBD_DEFLOCK; + vc->kbd_table.slockstate = 0; + vc->kbd_table.ledmode = LED_SHOW_FLAGS; + vc->kbd_table.ledflagstate = + vc->kbd_table.default_ledflagstate = KBD_DEFLEDS; + vc->kbd_table.modeflags = KBD_DEFMODE; + vc->kbd_table.kbdmode = VC_XLATE; + set_leds(); + + cursor_type = CUR_DEFAULT; + complement_mask = s_complement_mask; + + default_attr(vc); + update_attr(vc); + + tab_stop[0] = 0x01010100; + tab_stop[1] = tab_stop[2] = tab_stop[3] = tab_stop[4] = 0x01010101; + + bell_pitch = DEFAULT_BELL_PITCH; + bell_duration = DEFAULT_BELL_DURATION; + + gotoxy(vc, 0, 0); + vte_decsc(vc); + if (do_clear) + vte_ed(vc, 2); +} + +/* + * TABULATION CLEAR (TBC) + * + * NOTE: + * In case of parameters 0 and 2 the number of lines affected depends on the + * setting of the Tabulation Stop Mode (TSM). Since we don't implement TSM, + * this is silently ignored. + * + * Parameters 1 and 4 are similiar to 0 and 3, but affect only line tabulation + * stops, which are not implemented. + * + * Parameter 2 may only be interpreted, when we implement a tabulation stop map + * per display line. + */ +static void vte_tbc(struct vc_data *vc, int vpar) +{ + switch (vpar) { + case 0: + /* + * The character tabulation stop at the active + * presentation position is cleared. + */ + tab_stop[x >> 5] &= ~(1 << (x & 31)); + return; + case 2: + /* + * All character tabulation stops in the active + * line are cleared. + */ + case 3: + /* + * All character tabulation stops are cleared. + */ + case 5: + /* + * All tabulation stops are cleared. + */ + tab_stop[0] = tab_stop[1] = tab_stop[2] = tab_stop[3] = + tab_stop[4] = 0; + } +} + +void terminal_emulation(struct tty_struct *tty, int c) +{ + /* + * C0 CONTROL CHARACTERS + * + * NOTE: Control characters can be used in the _middle_ + * of an escape sequence. (XXX: Really? Test!) + */ + struct vc_data *vc = (struct vc_data *) tty->driver_data; + + switch (c) { + case 0x00: /* NUL - Null */ + case 0x01: /* SOH - Start of header */ + case 0x02: /* STX - */ + case 0x03: /* ETX - */ + case 0x04: /* EOT - End of transmission */ + return; + case 0x05: /* ENQ - Enquiry */ + vte_answerback(tty); + return; + case 0x06: /* ACK - Acknowledge */ + return; + case 0x07: /* BEL - Bell */ + if (bell_duration) + kd_mksound(bell_pitch, bell_duration); + return; + case 0x08: /* BS - Back space */ + vte_bs(vc); + return; + case 0x09: /* HT - Character tabulation */ + pos -= (x << 1); + while (x < video_num_columns - 1) { + x++; + if (tab_stop[x >> 5] & (1 << (x & 31))) + break; + } + pos += (x << 1); + return; + case 0x0a: /* LF - Line feed */ + case 0x0b: /* VT - Line tabulation */ + /* + * Since line tabulation is not implemented in the DEC VT + * series (except VT131 ?), the DEC VT series treats any + * VT as LF. + */ + case 0x0c: /* FF - Form feed */ + /* + * DEC VT series processes FF as LF. + */ + vte_lf(vc); + if (!get_kbd_mode(&vc->kbd_table, VC_CRLF)) + return; + case 0x0d: /* CR - Carriage return */ + vte_cr(vc); + return; + case 0x0e: /* SO - Shift out / LS1 - Locking shift 1 */ + charset = 1; + set_translate(vc, G1_charset); + disp_ctrl = 1; + return; + case 0x0f: /* SI - Shift in / LS0 - Locking shift 0 */ + charset = 0; + set_translate(vc, G0_charset); + disp_ctrl = 0; + return; + case 0x10: /* DLE - */ + case 0x11: /* DC1 - Device control 1 */ + case 0x12: /* DC2 - Device control 1 */ + case 0x13: /* DC3 - Device control 1 */ + case 0x14: /* DC4 - Device control 1 */ + case 0x15: /* NAK - Negative acknowledge */ + case 0x16: /* SYN - Synchronize */ + case 0x17: /* ETB - */ + return; + case 0x18: /* CAN - Cancel */ + vc_state = ESinit; + return; + case 0x19: /* EM - */ + return; + case 0x1a: /* SUB - Substitute */ + vc_state = ESinit; + return; + case 0x1b: /* ESC - Escape */ + vc_state = ESesc; + return; + case 0x1c: /* IS4 - */ + case 0x1d: /* IS3 - */ + case 0x1e: /* IS2 - */ + case 0x1f: /* IS1 - */ + return; + case 0x7f: /* DEL - Delete */ + /* + * This character is ignored, unless a 96-set has been mapped, + * but this is not supported at the moment. + */ + return; + } + + if (c8bit == 1) + /* + * C1 control functions (8-bit mode). + */ + switch (c) { + case 0x80: /* unused */ + case 0x81: /* unused */ + case 0x82: /* BPH - Break permitted here */ + case 0x83: /* NBH - No break here */ + return; + case 0x84: /* IND - Line feed (DEC only) */ +#ifndef VTE_STRICT_ISO + vte_lf(vc); +#endif /* ndef VTE_STRICT_ISO */ + return; + case 0x85: /* NEL - Next line */ + vte_lf(vc); + vte_cr(vc); + return; + case 0x86: /* SSA - Start of selected area */ + case 0x87: /* ESA - End of selected area */ + return; + case 0x88: /* HTS - Character tabulation set */ + tab_stop[x >> 5] |= (1 << (x & 31)); + return; + case 0x89: /* HTJ - Character tabulation with justify */ + case 0x8a: /* VTS - Line tabulation set */ + case 0x8b: /* PLD - Partial line down */ + case 0x8c: /* PLU - Partial line up */ + return; + case 0x8d: /* RI - Reverse line feed */ + vte_ri(vc); + return; +#if 0 + case 0x8e: /* SS2 - Single shift 2 */ + need_shift = 1; + GS_charset = G2_charset; /* G2 -> GS */ + return; + case 0x8f: /* SS3 - Single shift 3 */ + need_shift = 1; + GS_charset = G3_charset; /* G3 -> GS */ + return; +#endif + case 0x90: /* DCS - Device control string */ + return; + case 0x91: /* PU1 - Private use 1 */ + case 0x92: /* PU2 - Private use 2 */ + case 0x93: /* STS - Set transmit state */ + case 0x94: /* CCH - Cancel character */ + case 0x95: /* MW - Message waiting */ + case 0x96: /* SPA - Start of guarded area */ + case 0x97: /* EPA - End of guarded area */ + case 0x98: /* SOS - Start of string */ + case 0x99: /* unused */ + return; + case 0x9a: /* SCI - Single character introducer */ +#ifndef VTE_STRICT_ISO + vte_da(tty); +#endif /* ndef VTE_STRICT_ISO */ + return; + case 0x9b: /* CSI - Control sequence introducer */ + vc_state = EScsi; + return; + case 0x9c: /* ST - String Terminator */ + case 0x9d: /* OSC - Operating system command */ + case 0x9e: /* PM - Privacy message */ + case 0x9f: /* APC - Application program command */ + return; + } + + switch (vc_state) { + case ESesc: + vc_state = ESinit; + switch (c) { + + case ' ': /* ACS - Announce code structure */ + vc_state = ESacs; + return; + case '#': /* SCF - Single control functions */ + vc_state = ESscf; + return; + case '%': /* DOCS - Designate other coding system */ + vc_state = ESdocs; + return; +#ifdef CONFIG_VT_HP + case '&': /* HP terminal emulation */ + vc_state = ESesc_and; + return; +#endif /* def CONFIG_VT_HP */ + case '(': /* GZD4 - G0-designate 94-set */ + vc_state = ESgzd4; + return; + case ')': /* G1D4 - G1-designate 94-set */ + vc_state = ESg1d4; + return; +#if 0 + case '*': /* G2D4 - G2-designate 94-set */ + vc_state = ESg2d4; + return; + case '+': /* G3D4 - G3-designate 94-set */ + vc_state = ESg3d4; + return; + case '-': /* G1D6 - G1-designate 96-set */ + vc_state = ESg1d6; + return; + case '.': /* G2D6 - G2-designate 96-set */ + vc_state = ESg2d6; + return; + case '/': /* G3D6 - G3-designate 96-set */ + vc_state = ESg3d6; + return; +#endif + /* ===== Private control functions ===== */ + + case '6': /* DECBI - Back index */ + return; + case '7': /* DECSC - Save cursor */ + vte_decsc(vc); + return; + case '8': /* DECRC - Restore cursor */ + vte_decrc(vc); + return; + case '9': /* DECFI - Forward index */ + return; + case '=': /* DECKPAM - Keypad application mode */ + decnkm = 1; + set_kbd_mode(&vc->kbd_table, VC_APPLIC); + return; + case '>': /* DECKPNM - Keypad numeric mode */ + decnkm = 0; + clr_kbd_mode(&vc->kbd_table, VC_APPLIC); + return; + + /* ===== C1 control functions ===== */ + case '@': /* unallocated */ + case 'A': /* unallocated */ + case 'B': /* BPH - Break permitted here */ + case 'C': /* NBH - No break here */ + case 'D': /* IND - Line feed (DEC only) */ +#ifndef VTE_STRICT_ISO + vte_lf(vc); +#endif /* ndef VTE_STRICT_ISO */ + return; + case 'E': /* NEL - Next line */ + vte_cr(vc); + vte_lf(vc); + return; + case 'F': /* SSA - Start of selected area */ + case 'G': /* ESA - End of selected area */ + return; + case 'H': /* HTS - Character tabulation set */ + tab_stop[x >> 5] |= (1 << (x & 31)); + return; + case 'I': /* HTJ - Character tabulation with justify */ + case 'J': /* VTS - Line tabulation set */ + case 'K': /* PLD - Partial line down */ + case 'L': /* PLU - Partial line up */ + return; + case 'M': /* RI - Reverse line feed */ + vte_ri(vc); + return; + case 'N': /* SS2 - Single shift 2 */ + shift = 1; + GS_charset = G2_charset; /* G2 -> GS */ + return; + case 'O': /* SS3 - Single shift 3 */ + shift = 1; + GS_charset = G3_charset; + return; + case 'P': /* DCS - Device control string */ + return; + case 'Q': /* PU1 - Private use 1 */ + case 'R': /* PU2 - Private use 2 */ + case 'S': /* STS - Set transmit state */ + case 'T': /* CCH - Cancel character */ + case 'U': /* MW - Message waiting */ + case 'V': /* SPA - Start of guarded area */ + case 'W': /* EPA - End of guarded area */ + case 'X': /* SOS - Start of string */ + case 'Y': /* unallocated */ + return; + case 'Z': /* SCI - Single character introducer */ +#ifndef VTE_STRICT_ISO + vte_da(tty); +#endif /* ndef VTE_STRICT_ISO */ + return; + case '[': /* CSI - Control sequence introducer */ + vc_state = EScsi; + return; + case '\\': /* ST - String Terminator */ + return; + case ']': /* OSC - Operating system command */ + /* XXX: Fixme! Wrong sequence and format! */ + vc_state = ESosc; + return; + case '^': /* PM - Privacy Message */ + case '_': /* APC - Application Program Command */ + return; + + /* ===== Single control functions ===== */ + case '`': /* DMI - Disable manual input */ + kam = 0; + return; + case 'b': /* EMI - Enable manual input */ + kam = 1; + return; + case 'c': /* RIS - Reset ti initial state */ + vte_ris(vc, 1); + return; + case 'd': /* CMD - Coding Method Delimiter */ + return; +#if 0 + case 'n': /* LS2 - Locking shift G2 */ + GL_charset = G2_charset; /* (G2 -> GL) */ + return; + case 'o': /* LS3 - Locking shift G3 */ + GL_charset = G3_charset; /* (G3 -> GL) */ + return; + case '|': /* LS3R - Locking shift G3 right */ + GR_charset = G3_charset; /* G3 -> GR */ + return; + case '}': /* LS2R - Locking shift G2 right */ + GR_charset = G2_charset; /* G2 -> GR */ + return; + case '~': /* LS1R - Locking shift G1 right */ + GR_charset = G1_charset; /* G1 -> GR */ + return; +#endif + } + return; + case ESacs: + vc_state = ESinit; + switch (c) { + case 'F': /* Select 7-bit C1 control transmission */ + if (decscl != 1) /* Ignore if in VT100 mode */ + c8bit = 0; + return; + case 'G': /* Select 8-Bit C1 control transmission */ + if (decscl != 1) /* Ignore if in VT100 mode */ + c8bit = 1; + return; + case 'L': /* ANSI conformance level 1 */ + case 'M': /* ANSI conformance level 2 */ + case 'N': /* ANSI conformance level 3 */ + /* Not yet implemented. */ + return; + } + return; + case ESosc: + vc_state = ESinit; + switch (c) { + case 'P': /* palette escape sequence */ + for (npar = 0; npar < NPAR; npar++) + par[npar] = 0; + npar = 0; + vc_state = ESpalette; + return; + case 'R': /* reset palette */ + reset_palette(vc); + vc_state = ESinit; + return; + } + return; + case ESpalette: + if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') + || (c >= 'a' && c <= 'f')) { + par[npar++] = + (c > '9' ? (c & 0xDF) - 'A' + 10 : c - '0'); + if (npar == 7) { + int i = par[0] * 3, j = 1; + palette[i] = 16 * par[j++]; + palette[i++] += par[j++]; + palette[i] = 16 * par[j++]; + palette[i++] += par[j++]; + palette[i] = 16 * par[j++]; + palette[i] += par[j]; + set_palette(vc); + vc_state = ESinit; + } + } else + vc_state = ESinit; + return; + case EScsi: + for (npar = 0; npar < NPAR; npar++) + par[npar] = 0; + npar = 0; + vc_state = EScsi_getpars; + if (c == '[') { + /* Function key */ + vc_state = ESfunckey; + return; + } + priv1 = (c == '<'); + priv2 = (c == '='); + priv3 = (c == '>'); + priv4 = (c == '?'); + if (priv1) { + vc_state = ESinit; + return; + } + if (priv2 || priv3 || priv4) { + return; + } + case EScsi_getpars: + if (c == ';' && npar < NPAR - 1) { + npar++; + return; + } else if (c >= '0' && c <= '9') { + par[npar] *= 10; + par[npar] += c - '0'; + return; + } else + vc_state = EScsi_gotpars; + case EScsi_gotpars: + vc_state = ESinit; + /* + * Process control functions with private parameter flag. + */ + switch (c) { + case '$': + if (priv4) { + vc_state = EScsi_dollar; + return; + } + break; + case 'J': + if (priv4) { + /* DECSED - Selective erase in display */ + return; + } + break; + case 'K': + if (priv4) { + /* DECSEL - Selective erase in display */ + return; + } + break; + case 'h': /* SM - Set Mode */ + set_mode(vc, 1); + return; + case 'l': /* RM - Reset Mode */ + set_mode(vc, 0); + return; + case 'c': + if (priv2) { + if (!par[0]) + vte_dec_da3(tty); + priv2 = 0; + return; + } + if (priv3) { + if (!par[0]) + vte_dec_da2(tty); + priv3 = 0; + return; + } + if (priv4) { + if (par[0]) + cursor_type = + par[0] | (par[1] << 8) | + (par[2] << 16); + else + cursor_type = CUR_DEFAULT; + priv4 = 0; + return; + } + break; + case 'm': + if (priv4) { + clear_selection(); + if (par[0]) + complement_mask = + par[0] << 8 | par[1]; + else + complement_mask = + s_complement_mask; + priv4 = 0; + return; + } + break; + case 'n': + if (priv4) { + switch (par[0]) { + case 6: /* DECXCPR - Extended CPR */ + vte_cpr(tty, 1); + break; + case 15: /* DEC printer status */ + vte_fake_dec_dsr(tty, "13"); + break; + case 25: /* DEC UDK status */ + vte_fake_dec_dsr(tty, "21"); + break; + case 26: /* DEC keyboard status */ + vte_fake_dec_dsr(tty, "27;1;0;1"); + break; + case 53: /* DEC locator status */ + vte_fake_dec_dsr(tty, "53"); + break; + case 62: /* DEC macro space */ + vte_decmsr(tty); + break; + case 75: /* DEC data integrity */ + vte_fake_dec_dsr(tty, "70"); + break; + case 85: /* DEC multiple session status */ + vte_fake_dec_dsr(tty, "83"); + break; + } + } else + switch (par[0]) { + case 5: /* DSR - Device status report */ + vte_dsr(tty); + break; + case 6: /* CPR - Cursor position report */ + vte_cpr(tty, 0); + break; + } + priv4 = 0; + return; + } + if (priv1 || priv2 || priv3 || priv4) { + priv1 = priv2 = priv3 = priv4 = 0; + return; + } + /* + * Process control functions with standard parameter strings. + */ + switch (c) { + + /* ===== Control functions w/ intermediate byte ===== */ + case ' ': /* Intermediate byte: SP (ISO 6429) */ + vc_state = EScsi_space; + return; + case '!': /* Intermediate byte: ! (DEC VT series) */ + vc_state = EScsi_exclam; + return; + case '"': /* Intermediate byte: " (DEC VT series) */ + vc_state = EScsi_dquote; + return; + case '$': /* Intermediate byte: $ (DEC VT series) */ + vc_state = EScsi_dollar; + return; + case '&': /* Intermediate byte: & (DEC VT series) */ + vc_state = EScsi_and; + return; + case '*': /* Intermediate byte: * (DEC VT series) */ + vc_state = EScsi_star; + return; + case '+': /* Intermediate byte: + (DEC VT series) */ + vc_state = EScsi_plus; + return; + /* ==== Control functions w/o intermediate byte ==== */ + case '@': /* ICH - Insert character */ + vte_ich(vc, par[0]); + return; + case 'A': /* CUU - Cursor up */ + case 'k': /* VPB - Line position backward */ + if (!par[0]) + par[0]++; + gotoxy(vc, x, y - par[0]); + return; + case 'B': /* CUD - Cursor down */ + case 'e': /* VPR - Line position forward */ + if (!par[0]) + par[0]++; + gotoxy(vc, x, y + par[0]); + return; + case 'C': /* CUF - Cursor right */ + case 'a': /* HPR - Character position forward */ + if (!par[0]) + par[0]++; + gotoxy(vc, x + par[0], y); + return; + case 'D': /* CUB - Cursor left */ + case 'j': /* HPB - Character position backward */ + if (!par[0]) + par[0]++; + gotoxy(vc, x - par[0], y); + return; + case 'E': /* CNL - Cursor next line */ + if (!par[0]) + par[0]++; + gotoxy(vc, 0, y + par[0]); + return; + case 'F': /* CPL - Cursor preceeding line */ + if (!par[0]) + par[0]++; + gotoxy(vc, 0, y - par[0]); + return; + case 'G': /* CHA - Cursor character absolute */ + case '`': /* HPA - Character position absolute */ + if (par[0]) + par[0]--; + gotoxy(vc, par[0], y); + return; + case 'H': /* CUP - Cursor position */ + case 'f': /* HVP - Horizontal and vertical position */ + if (par[0]) + par[0]--; + if (par[1]) + par[1]--; + gotoxay(vc, par[1], par[0]); + return; + case 'I': /* CHT - Cursor forward tabulation */ + if (!par[0]) + par[0]++; + vte_cht(vc, par[0]); + return; + case 'J': /* ED - Erase in page */ + vte_ed(vc, par[0]); + return; + case 'K': /* EL - Erase in line */ + vte_el(vc, par[0]); + return; + case 'L': /* IL - Insert line */ + vte_il(vc, par[0]); + return; + case 'M': /* DL - Delete line */ + vte_dl(vc, par[0]); + return; + case 'P': /* DCH - Delete character */ + vte_dch(vc, par[0]); + return; + case 'U': /* NP - Next page */ + case 'V': /* PP - Preceeding page */ + return; + case 'W': /* CTC - Cursor tabulation control */ + switch (par[0]) { + case 0: /* Set character tab stop at current position */ + tab_stop[x >> 5] |= (1 << (x & 31)); + return; + case 2: /* Clear character tab stop at curr. position */ + vte_tbc(vc, 0); + return; + case 5: /* All character tab stops are cleared. */ + vte_tbc(vc, 5); + return; + } + return; + case 'X': /* ECH - Erase character */ + vte_ech(vc, par[0]); + return; + case 'Y': /* CVT - Cursor line tabulation */ + if (!par[0]) + par[0]++; + vte_cvt(vc, par[0]); + return; + case 'Z': /* CBT - Cursor backward tabulation */ + vte_cbt(vc, par[0]); + return; + case ']': +#ifndef VT_STRICT_ISO + setterm_command(vc); +#endif /* def VT_STRICT_ISO */ + return; + case 'c': /* DA - Device attribute */ + if (!par[0]) + vte_da(tty); + return; + case 'd': /* VPA - Line position absolute */ + if (par[0]) + par[0]--; + gotoxay(vc, x, par[0]); + return; + case 'g': /* TBC - Tabulation clear */ + vte_tbc(vc, par[0]); + return; + case 'm': /* SGR - Select graphics rendition */ + vte_sgr(vc); + return; + + /* ===== Private control sequences ===== */ + + case 'q': /* DECLL - but only 3 leds */ + switch (par[0]) { + case 0: /* all LEDs off */ + case 1: /* LED 1 on */ + case 2: /* LED 2 on */ + case 3: /* LED 3 on */ + setledstate(&vc->kbd_table, + (par[0] < 3) ? par[0] : 4); + case 4: /* LED 4 on */ + ; + } + return; + case 'r': /* DECSTBM - Set top and bottom margin */ + if (!par[0]) + par[0]++; + if (!par[1]) + par[1] = video_num_lines; + /* Minimum allowed region is 2 lines */ + if (par[0] < par[1] && par[1] <= video_num_lines) { + top = par[0] - 1; + bottom = par[1]; + gotoxay(vc, 0, 0); + } + return; + case 's': /* DECSLRM - Set left and right margin */ + return; + case 't': /* DECSLPP - Set lines per page */ + return; + case 'x': /* DECREQTPARM - Request terminal parameters */ + vte_decreptparm(tty); + return; + case 'y': + if (par[0] == 4) { + /* DECTST - Invoke confidence test */ + return; + } + } + return; + case EScsi_space: + vc_state = ESinit; + switch (c) { + /* + * Note: All codes betweem 0x40 and 0x6f are subject to + * standardisation by the ISO. The codes netweem 0x70 + * and 0x7f are free for private use. + */ + case '@': /* SL - Scroll left */ + case 'A': /* SR - Scroll right */ + return; + case 'P': /* PPA - Page position absolute */ + case 'Q': /* PPR - Page position forward */ + case 'R': /* PPB - Page position backward */ + return; + } + return; + case EScsi_exclam: + vc_state = ESinit; + switch (c) { + case 'p': /* DECSTR - Soft terminal reset */ + /* + * Note: On a true DEC VT there are differences + * between RIS and DECSTR. Right now we ignore + * this... -dbk + */ + vte_ris(vc, 1); + return; + } + return; + case EScsi_dquote: + vc_state = ESinit; + switch (c) { + case 'p': /* DECSCL - Set operating level */ + vte_decscl(vc); + return; + case 'q': /* DECSCA - Select character protection + attribute */ + return; + case 'v': /* DECRQDE - Request window report */ + ; + } + return; + case EScsi_dollar: + vc_state = ESinit; + switch (c) { + case 'p': /* DECRQM - Request mode */ + vte_decrqm(tty, priv4); + return; + case 'r': /* DECCARA - Change attributes in rectangular area */ + return; + case 't': /* DECRARA - Reverse attributes in rectangular area */ + return; + case 'u': /* DECRQTSR - Request terminal state */ + if (par[0] == 1) + vte_dectsr(tty); + return; + case 'v': /* DECCRA - Copy rectangular area */ + return; + case 'w': /* DECRQPSR - Request presentation status */ + switch (par[0]) { + case 1: + vte_deccir(tty); + break; + case 2: + vte_dectabsr(tty); + break; + } + return; + case 'x': /* DECFRA - Fill rectangular area */ + return; + case 'z': /* DECERA - Erase rectangular area */ + return; + case '{': /* DECSERA - Selective erase rectangular area */ + return; + case '|': /* DECSCPP - Set columns per page */ + return; + case '}': /* DECSASD - Select active status display */ + return; + case '~': /* DECSSDT - Select status display type + */ + return; + } + return; + case EScsi_and: + vc_state = ESinit; + switch (c) { + case 'u': /* DECRQUPSS - Request user-preferred supplemental set */ + return; + case 'x': /* Enable Session Command */ + return; + } + return; + case EScsi_squote: + vc_state = ESinit; + switch (c) { + case '}': /* DECIC - Insert column */ + return; + case '~': /* DECDC - Delete column */ + return; + } + case EScsi_star: + vc_state = ESinit; + switch (c) { + case 'x': /* DECSACE - Select attribute change extent */ + return; + case 'y': /* DECRQCRA - Request checksum on rectangular area */ + return; + case 'z': /* DECINVM - Invoke macro */ + return; + case '|': /* DECSNLS - Select number of lines */ + return; + case '}': /* DECLFKC - Local function key control + */ + return; + } + return; + case EScsi_plus: + vc_state = ESinit; + switch (c) { + case 'p': /* DECSR - Secure reset */ + return; + } + return; + case ESdocs: + vc_state = ESinit; + switch (c) { + case '@': /* defined in ISO 2022 */ + utf = 0; + return; + case 'G': /* prelim official escape code */ + case '8': /* retained for compatibility */ + utf = 1; + return; + } + return; +#ifdef CONFIG_VT_HP + case ESesc_and: + vc_state = ESinit; + switch (c) { + case 'f': /* Set function key label */ + return; + case 'j': /* Display function key labels */ + return; + } + return; +#endif + case ESfunckey: + vc_state = ESinit; + return; + case ESscf: + vc_state = ESinit; + if (c == '8') { + /* DEC screen alignment test. kludge :-) */ + video_erase_char = + (video_erase_char & 0xff00) | 'E'; + vte_ed(vc, 2); + video_erase_char = + (video_erase_char & 0xff00) | ' '; + do_update_region(vc, origin, screenbuf_size / 2); + } + return; + case ESgzd4: + switch (c) { + case '0': /* DEC Special graphics */ + G0_charset = GRAF_MAP; + break; +#if 0 + case '>': /* DEC Technical */ + G0_charset = DEC_TECH_MAP; + break; +#endif + case 'A': /* ISO Latin-1 supplemental */ + G0_charset = LAT1_MAP; + break; + case 'B': /* ASCII */ + G0_charset = LAT1_MAP; + break; + case 'U': + G0_charset = IBMPC_MAP; + break; + case 'K': + G0_charset = USER_MAP; + break; + } + if (charset == 0) + set_translate(vc, G0_charset); + vc_state = ESinit; + return; + case ESg1d4: + switch (c) { + case '0': /* DEC Special graphics */ + G1_charset = GRAF_MAP; + break; +#if 0 + case '>': /* DEC Technical */ + G1_charset = DEC_TECH_MAP; + break; +#endif + case 'A': /* ISO Latin-1 supplemental */ + G1_charset = LAT1_MAP; + break; + case 'B': /* ASCII */ + G1_charset = LAT1_MAP; + break; + case 'U': + G1_charset = IBMPC_MAP; + break; + case 'K': + G1_charset = USER_MAP; + break; + } + if (charset == 1) + set_translate(vc, G1_charset); + vc_state = ESinit; + return; + case ESg2d4: + switch (c) { + case '0': /* DEC Special graphics */ + G2_charset = GRAF_MAP; + break; +#if 0 + case '>': /* DEC Technical */ + G2_charset = DEC_TECH_MAP; + break; +#endif + case 'A': /* ISO Latin-1 supplemental */ + G2_charset = LAT1_MAP; + break; + case 'B': /* ASCII */ + G2_charset = LAT1_MAP; + break; + case 'U': + G2_charset = IBMPC_MAP; + break; + case 'K': + G2_charset = USER_MAP; + break; + } + if (charset == 1) + set_translate(vc, G2_charset); + vc_state = ESinit; + return; + case ESg3d4: + switch (c) { + case '0': /* DEC Special graphics */ + G3_charset = GRAF_MAP; + break; +#if 0 + case '>': /* DEC Technical */ + G3_charset = DEC_TECH_MAP; + break; +#endif + case 'A': /* ISO Latin-1 supplemental */ + G3_charset = LAT1_MAP; + break; + case 'B': /* ASCII */ + G3_charset = LAT1_MAP; + break; + case 'U': + G3_charset = IBMPC_MAP; + break; + case 'K': + G3_charset = USER_MAP; + break; + } + if (charset == 1) + set_translate(vc, G3_charset); + vc_state = ESinit; + return; + default: + vc_state = ESinit; + } +} =================================================================== This BitKeeper patch contains the following changesets: + ## Wrapped with gzip_uu ## begin 664 bkpatch4191 M'XL(`')]I#T``\0[:7OB1M*?X5=TG#>S,(-!`GPRQV(LV^S8F!>P<TSFX1%2 M8[06$M$!)O'\]ZVJ;@D$PF:N9.)=0W=U===]=/M'=N-S[SCS7]\:CUW'S_[( M+EP_.,Z,]8<9M^TBU[U@9%O.?='A`<QV7!=F2Z'OE7S/*!FPQK7YKA_H`YMG M`:"M!\:(3;GG'V?48B4>">83?ISI:.<WE_5.-OO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-09 19:19:11
|
Started to nuke the global currcon variable. Really bad for pre-emptive kernels. MS: (n) 1. A debilitating and surprisingly widespread affliction that renders the sufferer barely able to perform the simplest task. 2. A disease. James Simmons [jsi...@us...] ____/| fbdev/console/gfx developer \ o.O| http://www.linux-fbdev.org =(_)= http://linuxgfx.sourceforge.net U http://linuxconsole.sourceforge.net You can import this changeset into BK by piping this whole message to: '| bk receive [path to repository]' or apply the patch as usual. =================================================================== ChangeSet@1.718, 2002-10-09 11:55:52-07:00, jsi...@ma... Started to nuke the gloabl currcon variable. I changed over the unimap and font handling functions to use struct vc_data instead. I also seperated out the framebuffer code from the VT code since very soon the framebuffer will be able to function without a VT. arch/mips64/kernel/ioctl32.c | 3 arch/ppc64/kernel/ioctl32.c | 67 +++++++++++-------- arch/sparc64/kernel/ioctl32.c | 34 +++++++--- arch/x86_64/ia32/ia32_ioctl.c | 35 +++++++--- drivers/char/consolemap.c | 142 ++++++++++++++++++++---------------------- drivers/char/keyboard.c | 1 drivers/char/selection.c | 4 - drivers/char/vc_screen.c | 1 drivers/char/vt.c | 65 +++++++++---------- drivers/char/vt_ioctl.c | 44 ++++++------- drivers/video/dummycon.c | 1 drivers/video/mdacon.c | 3 drivers/video/newport_con.c | 1 drivers/video/promcon.c | 13 +-- drivers/video/sticon.c | 1 drivers/video/vgacon.c | 9 +- include/linux/consolemap.h | 6 - include/linux/vt_kern.h | 25 +++---- include/video/fbcon.h | 2 19 files changed, 246 insertions(+), 211 deletions(-) diff -Nru a/arch/mips64/kernel/ioctl32.c b/arch/mips64/kernel/ioctl32.c --- a/arch/mips64/kernel/ioctl32.c Wed Oct 9 11:58:53 2002 +++ b/arch/mips64/kernel/ioctl32.c Wed Oct 9 11:58:53 2002 @@ -619,6 +619,8 @@ IOCTL32_DEFAULT(FIONBIO), IOCTL32_DEFAULT(FIONREAD), +#ifdef CONFIG_VT + IOCTL32_DEFAULT(PIO_FONT), IOCTL32_DEFAULT(GIO_FONT), IOCTL32_DEFAULT(KDSIGACCEPT), @@ -662,6 +664,7 @@ IOCTL32_DEFAULT(VT_RESIZEX), IOCTL32_DEFAULT(VT_LOCKSWITCH), IOCTL32_DEFAULT(VT_UNLOCKSWITCH), +#endif #ifdef CONFIG_NET /* Socket level stuff */ diff -Nru a/arch/ppc64/kernel/ioctl32.c b/arch/ppc64/kernel/ioctl32.c --- a/arch/ppc64/kernel/ioctl32.c Wed Oct 9 11:58:54 2002 +++ b/arch/ppc64/kernel/ioctl32.c Wed Oct 9 11:58:54 2002 @@ -1794,6 +1794,8 @@ static int do_fontx_ioctl(unsigned int fd, int cmd, struct consolefontdesc32 *user_cfd, struct file *file) { + struct tty_struct *tty = (struct tty_struct *) file->private_data; + struct vc_data *vc = (struct vc_data *) tty->driver_data; struct consolefontdesc cfdarg; struct console_font_op op; int i, perm; @@ -1816,7 +1818,7 @@ op.height = cfdarg.charheight; op.charcount = cfdarg.charcount; op.data = cfdarg.chardata; - return con_font_op(fg_console, &op); + return con_font_op(vc, &op); case GIO_FONTX: if (!cfdarg.chardata) return 0; @@ -1826,7 +1828,7 @@ op.height = cfdarg.charheight; op.charcount = cfdarg.charcount; op.data = cfdarg.chardata; - i = con_font_op(fg_console, &op); + i = con_font_op(vc, &op); if (i) return i; cfdarg.charheight = op.height; @@ -1849,9 +1851,10 @@ static int do_kdfontop_ioctl(unsigned int fd, unsigned int cmd, struct console_font_op32 *fontop, struct file *file) { - struct console_font_op op; + struct tty_struct *tty = (struct tty_struct *) file->private_data; + struct vc_data *vc = (struct vc_data *) tty->driver_data; int perm = vt_check(file), i; - struct vt_struct *vt; + struct console_font_op op; if (perm < 0) return perm; @@ -1861,8 +1864,7 @@ return -EPERM; op.data = (unsigned char *)A(((struct console_font_op32 *)&op)->data); op.flags |= KD_FONT_FLAG_OLD; - vt = (struct vt_struct *)((struct tty_struct *)file->private_data)->driver_data; - i = con_font_op(vt->vc_num, &op); + i = con_font_op(vc, &op); if (i) return i; ((struct console_font_op32 *)&op)->data = (unsigned long)op.data; if (copy_to_user((void *) fontop, &op, sizeof(struct console_font_op32))) @@ -1870,6 +1872,33 @@ return 0; } +struct unimapdesc32 { + unsigned short entry_ct; + u32 entries; +}; + +static int do_unimap_ioctl(unsigned int fd, unsigned int cmd, struct unimapdesc32 *user_ud, struct file *file) +{ + struct tty_struct *tty = (struct tty_struct *) file->private_data; + struct vc_data *vc = (struct vc_data *) tty->driver_data; + int perm = vt_check(file); + struct unimapdesc32 tmp; + + if (perm < 0) return perm; + if (copy_from_user(&tmp, user_ud, sizeof tmp)) + return -EFAULT; + switch (cmd) { + case PIO_UNIMAP: + if (!perm) return -EPERM; + return con_set_unimap(vc, tmp.entry_ct, (struct unipair *)A(tmp.entries)); + case GIO_UNIMAP: + return con_get_unimap(vc, tmp.entry_ct, &(user_ud->entry_ct), (struct unipair *)A(tmp.entries)); + } + return 0; +} +#endif /* CONFIG_VT */ + +#ifdef CONFIG_FB struct fb_fix_screeninfo32 { char id[16]; /* identification string eg "TT Builtin" */ unsigned int smem_start; /* Start of frame buffer mem */ @@ -1993,30 +2022,8 @@ } return err; } +#endif /* CONFIG_FB */ -struct unimapdesc32 { - unsigned short entry_ct; - u32 entries; -}; - -static int do_unimap_ioctl(unsigned int fd, unsigned int cmd, struct unimapdesc32 *user_ud, struct file *file) -{ - struct unimapdesc32 tmp; - int perm = vt_check(file); - - if (perm < 0) return perm; - if (copy_from_user(&tmp, user_ud, sizeof tmp)) - return -EFAULT; - switch (cmd) { - case PIO_UNIMAP: - if (!perm) return -EPERM; - return con_set_unimap(fg_console, tmp.entry_ct, (struct unipair *)A(tmp.entries)); - case GIO_UNIMAP: - return con_get_unimap(fg_console, tmp.entry_ct, &(user_ud->entry_ct), (struct unipair *)A(tmp.entries)); - } - return 0; -} -#endif /* CONFIG_VT */ static int do_smb_getmountuid(unsigned int fd, unsigned int cmd, unsigned long arg) { mm_segment_t old_fs = get_fs(); @@ -4465,6 +4472,8 @@ HANDLE_IOCTL(PIO_UNIMAP, do_unimap_ioctl), HANDLE_IOCTL(GIO_UNIMAP, do_unimap_ioctl), HANDLE_IOCTL(KDFONTOP, do_kdfontop_ioctl), +#endif +#ifdef CONFIG_FB HANDLE_IOCTL(FBIOGET_FSCREENINFO, do_fbioget_fscreeninfo_ioctl), HANDLE_IOCTL(FBIOGETCMAP, do_fbiogetcmap_ioctl), HANDLE_IOCTL(FBIOPUTCMAP, do_fbioputcmap_ioctl), diff -Nru a/arch/sparc64/kernel/ioctl32.c b/arch/sparc64/kernel/ioctl32.c --- a/arch/sparc64/kernel/ioctl32.c Wed Oct 9 11:58:53 2002 +++ b/arch/sparc64/kernel/ioctl32.c Wed Oct 9 11:58:54 2002 @@ -873,6 +873,7 @@ return err ? -EFAULT : 0; } +#ifdef CONFIG_FB struct fbcmap32 { int index; /* first element (0 origin) */ int count; @@ -1112,6 +1113,7 @@ if (cmap.transp) kfree(cmap.transp); return err; } +#endif /* CONFIG_FB */ static int hdio_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg) { @@ -2077,6 +2079,7 @@ extern int tty_ioctl(struct inode * inode, struct file * file, unsigned int cmd, unsigned long arg); +#ifdef CONFIG_VT static int vt_check(struct file *file) { struct tty_struct *tty; @@ -2109,6 +2112,8 @@ static int do_fontx_ioctl(unsigned int fd, int cmd, struct consolefontdesc32 *user_cfd, struct file *file) { + struct tty_struct *tty = (struct tty_struct *)file->private_data; + struct vc_data *vc = (struct vc_data *) tty->driver_data; struct consolefontdesc cfdarg; struct console_font_op op; int i, perm; @@ -2131,7 +2136,7 @@ op.height = cfdarg.charheight; op.charcount = cfdarg.charcount; op.data = cfdarg.chardata; - return con_font_op(fg_console, &op); + return con_font_op(vc, &op); case GIO_FONTX: if (!cfdarg.chardata) return 0; @@ -2141,7 +2146,7 @@ op.height = cfdarg.charheight; op.charcount = cfdarg.charcount; op.data = cfdarg.chardata; - i = con_font_op(fg_console, &op); + i = con_font_op(vc, &op); if (i) return i; cfdarg.charheight = op.height; @@ -2164,9 +2169,10 @@ static int do_kdfontop_ioctl(unsigned int fd, unsigned int cmd, struct console_font_op32 *fontop, struct file *file) { - struct console_font_op op; + struct tty_struct *tty = (struct tty_struct *)file->private_data; + struct vc_data *vc = (struct vc_data *) tty->driver_data; int perm = vt_check(file), i; - struct vt_struct *vt; + struct console_font_op op; if (perm < 0) return perm; @@ -2176,8 +2182,7 @@ return -EPERM; op.data = (unsigned char *)A(((struct console_font_op32 *)&op)->data); op.flags |= KD_FONT_FLAG_OLD; - vt = (struct vt_struct *)((struct tty_struct *)file->private_data)->driver_data; - i = con_font_op(vt->vc_num, &op); + i = con_font_op(vc, &op); if (i) return i; ((struct console_font_op32 *)&op)->data = (unsigned long)op.data; if (copy_to_user((void *) fontop, &op, sizeof(struct console_font_op32))) @@ -2192,8 +2197,10 @@ static int do_unimap_ioctl(unsigned int fd, unsigned int cmd, struct unimapdesc32 *user_ud, struct file *file) { - struct unimapdesc32 tmp; + struct tty_struct *tty = (struct tty_struct *)file->private_data; + struct vc_data *vc = (struct vc_data *) tty->driver_data; int perm = vt_check(file); + struct unimapdesc32 tmp; if (perm < 0) return perm; if (copy_from_user(&tmp, user_ud, sizeof tmp)) @@ -2201,12 +2208,13 @@ switch (cmd) { case PIO_UNIMAP: if (!perm) return -EPERM; - return con_set_unimap(fg_console, tmp.entry_ct, (struct unipair *)A(tmp.entries)); + return con_set_unimap(vc, tmp.entry_ct, (struct unipair *)A(tmp.entries)); case GIO_UNIMAP: - return con_get_unimap(fg_console, tmp.entry_ct, &(user_ud->entry_ct), (struct unipair *)A(tmp.entries)); + return con_get_unimap(vc, tmp.entry_ct, &(user_ud->entry_ct), (struct unipair *)A(tmp.entries)); } return 0; } +#endif /* CONFIG_VT */ static int do_smb_getmountuid(unsigned int fd, unsigned int cmd, unsigned long arg) { @@ -4273,6 +4281,7 @@ COMPATIBLE_IOCTL(TIOCSSERIAL) COMPATIBLE_IOCTL(TIOCSERGETLSR) COMPATIBLE_IOCTL(TIOCSLTC) +#ifdef CONFIG_FB /* Big F */ COMPATIBLE_IOCTL(FBIOGTYPE) COMPATIBLE_IOCTL(FBIOSATTR) @@ -4293,6 +4302,7 @@ COMPATIBLE_IOCTL(FBIOPUT_CURSORSTATE) COMPATIBLE_IOCTL(FBIOGET_CON2FBMAP) COMPATIBLE_IOCTL(FBIOPUT_CON2FBMAP) +#endif /* Little f */ COMPATIBLE_IOCTL(FIOCLEX) COMPATIBLE_IOCTL(FIONCLEX) @@ -4423,6 +4433,7 @@ COMPATIBLE_IOCTL(TUNSETIFF) COMPATIBLE_IOCTL(TUNSETPERSIST) COMPATIBLE_IOCTL(TUNSETOWNER) +#ifdef CONFIG_VT /* Big V */ COMPATIBLE_IOCTL(VT_SETMODE) COMPATIBLE_IOCTL(VT_GETMODE) @@ -4436,6 +4447,7 @@ COMPATIBLE_IOCTL(VT_RESIZEX) COMPATIBLE_IOCTL(VT_LOCKSWITCH) COMPATIBLE_IOCTL(VT_UNLOCKSWITCH) +#endif /* Little v */ COMPATIBLE_IOCTL(VUIDSFORMAT) COMPATIBLE_IOCTL(VUIDGFORMAT) @@ -5007,12 +5019,14 @@ HANDLE_IOCTL(0x1260, broken_blkgetsize) HANDLE_IOCTL(BLKSECTGET, w_long) HANDLE_IOCTL(BLKPG, blkpg_ioctl_trans) +#ifdef CONFIG_FB HANDLE_IOCTL(FBIOPUTCMAP32, fbiogetputcmap) HANDLE_IOCTL(FBIOGETCMAP32, fbiogetputcmap) HANDLE_IOCTL(FBIOSCURSOR32, fbiogscursor) HANDLE_IOCTL(FBIOGET_FSCREENINFO, fb_ioctl_trans) HANDLE_IOCTL(FBIOGETCMAP, fb_ioctl_trans) HANDLE_IOCTL(FBIOPUTCMAP, fb_ioctl_trans) +#endif HANDLE_IOCTL(HDIO_GET_UNMASKINTR, hdio_ioctl_trans) HANDLE_IOCTL(HDIO_GET_DMA, hdio_ioctl_trans) HANDLE_IOCTL(HDIO_GET_32BIT, hdio_ioctl_trans) @@ -5048,11 +5062,13 @@ HANDLE_IOCTL(LOOP_GET_STATUS, loop_status) #define AUTOFS_IOC_SETTIMEOUT32 _IOWR(0x93,0x64,unsigned int) HANDLE_IOCTL(AUTOFS_IOC_SETTIMEOUT32, ioc_settimeout) +#ifdef CONFIG_VT HANDLE_IOCTL(PIO_FONTX, do_fontx_ioctl) HANDLE_IOCTL(GIO_FONTX, do_fontx_ioctl) HANDLE_IOCTL(PIO_UNIMAP, do_unimap_ioctl) HANDLE_IOCTL(GIO_UNIMAP, do_unimap_ioctl) HANDLE_IOCTL(KDFONTOP, do_kdfontop_ioctl) +#endif HANDLE_IOCTL(EXT2_IOC32_GETFLAGS, do_ext2_ioctl) HANDLE_IOCTL(EXT2_IOC32_SETFLAGS, do_ext2_ioctl) HANDLE_IOCTL(EXT2_IOC32_GETVERSION, do_ext2_ioctl) diff -Nru a/arch/x86_64/ia32/ia32_ioctl.c b/arch/x86_64/ia32/ia32_ioctl.c --- a/arch/x86_64/ia32/ia32_ioctl.c Wed Oct 9 11:58:53 2002 +++ b/arch/x86_64/ia32/ia32_ioctl.c Wed Oct 9 11:58:53 2002 @@ -790,6 +790,7 @@ return err ? -EFAULT : 0; } +#ifdef CONFIG_FB struct fbcmap32 { int index; /* first element (0 origin) */ int count; @@ -930,6 +931,7 @@ if (cmap.transp) kfree(cmap.transp); return err; } +#endif /* CONFIG_FB */ static int hdio_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg) { @@ -1633,6 +1635,8 @@ extern int tty_ioctl(struct inode * inode, struct file * file, unsigned int cmd, unsigned long arg); +#ifdef CONFIG_VT + static int vt_check(struct file *file) { struct tty_struct *tty; @@ -1665,6 +1669,8 @@ static int do_fontx_ioctl(unsigned int fd, int cmd, struct consolefontdesc32 *user_cfd, struct file *file) { + struct tty_struct *tty = (struct tty_struct *)file->private_data; + struct vc_data *vc = (struct vc_data *) tty->driver_data; struct consolefontdesc cfdarg; struct console_font_op op; int i, perm; @@ -1687,7 +1693,7 @@ op.height = cfdarg.charheight; op.charcount = cfdarg.charcount; op.data = cfdarg.chardata; - return con_font_op(fg_console, &op); + return con_font_op(vc, &op); case GIO_FONTX: if (!cfdarg.chardata) return 0; @@ -1697,7 +1703,7 @@ op.height = cfdarg.charheight; op.charcount = cfdarg.charcount; op.data = cfdarg.chardata; - i = con_font_op(fg_console, &op); + i = con_font_op(vc, &op); if (i) return i; cfdarg.charheight = op.height; @@ -1720,9 +1726,10 @@ static int do_kdfontop_ioctl(unsigned int fd, unsigned int cmd, struct console_font_op32 *fontop, struct file *file) { - struct console_font_op op; + struct tty_struct *tty = (struct tty_struct *)file->private_data; + struct vc_data *vc = (struct vc_data *) tty->driver_data; int perm = vt_check(file), i; - struct vt_struct *vt; + struct console_font_op op; if (perm < 0) return perm; @@ -1732,8 +1739,7 @@ return -EPERM; op.data = (unsigned char *)A(((struct console_font_op32 *)&op)->data); op.flags |= KD_FONT_FLAG_OLD; - vt = (struct vt_struct *)((struct tty_struct *)file->private_data)->driver_data; - i = con_font_op(vt->vc_num, &op); + i = con_font_op(vc, &op); if (i) return i; ((struct console_font_op32 *)&op)->data = (unsigned long)op.data; if (copy_to_user((void *) fontop, &op, sizeof(struct console_font_op32))) @@ -1748,8 +1754,10 @@ static int do_unimap_ioctl(unsigned int fd, unsigned int cmd, struct unimapdesc32 *user_ud, struct file *file) { - struct unimapdesc32 tmp; + struct tty_struct *tty = (struct tty_struct *)file->private_data; + struct vc_data *vc = (struct vc_data *) tty->driver_data; int perm = vt_check(file); + struct unimapdesc32 tmp; if (perm < 0) return perm; if (copy_from_user(&tmp, user_ud, sizeof tmp)) @@ -1757,12 +1765,13 @@ switch (cmd) { case PIO_UNIMAP: if (!perm) return -EPERM; - return con_set_unimap(fg_console, tmp.entry_ct, (struct unipair *)A(tmp.entries)); + return con_set_unimap(vc, tmp.entry_ct, (struct unipair *)A(tmp.entries)); case GIO_UNIMAP: - return con_get_unimap(fg_console, tmp.entry_ct, &(user_ud->entry_ct), (struct unipair *)A(tmp.entries)); + return con_get_unimap(vc, tmp.entry_ct, &(user_ud->entry_ct), (struct unipair *)A(tmp.entries)); } return 0; } +#endif /* CONFIG_VT */ static int do_smb_getmountuid(unsigned int fd, unsigned int cmd, unsigned long arg) { @@ -3172,6 +3181,7 @@ COMPATIBLE_IOCTL(TIOCGPTN) COMPATIBLE_IOCTL(TIOCSPTLCK) COMPATIBLE_IOCTL(TIOCSERGETLSR) +#ifdef CONFIG_FB COMPATIBLE_IOCTL(FBIOGET_VSCREENINFO) COMPATIBLE_IOCTL(FBIOPUT_VSCREENINFO) COMPATIBLE_IOCTL(FBIOPAN_DISPLAY) @@ -3182,6 +3192,7 @@ COMPATIBLE_IOCTL(FBIOPUT_CURSORSTATE) COMPATIBLE_IOCTL(FBIOGET_CON2FBMAP) COMPATIBLE_IOCTL(FBIOPUT_CON2FBMAP) +#endif /* Little f */ COMPATIBLE_IOCTL(FIOCLEX) COMPATIBLE_IOCTL(FIONCLEX) @@ -3291,6 +3302,7 @@ COMPATIBLE_IOCTL(SCSI_IOCTL_TAGGED_DISABLE) COMPATIBLE_IOCTL(SCSI_IOCTL_GET_BUS_NUMBER) COMPATIBLE_IOCTL(SCSI_IOCTL_SEND_COMMAND) +#ifdef CONFIG_VT /* Big V */ COMPATIBLE_IOCTL(VT_SETMODE) COMPATIBLE_IOCTL(VT_GETMODE) @@ -3304,6 +3316,7 @@ COMPATIBLE_IOCTL(VT_RESIZEX) COMPATIBLE_IOCTL(VT_LOCKSWITCH) COMPATIBLE_IOCTL(VT_UNLOCKSWITCH) +#endif /* Little v, the video4linux ioctls */ COMPATIBLE_IOCTL(VIDIOCGCAP) COMPATIBLE_IOCTL(VIDIOCGCHAN) @@ -3747,8 +3760,10 @@ HANDLE_IOCTL(0x1260, broken_blkgetsize) HANDLE_IOCTL(BLKSECTGET, w_long) HANDLE_IOCTL(BLKPG, blkpg_ioctl_trans) +#ifdef CONFIG_FB HANDLE_IOCTL(FBIOGETCMAP, fb_ioctl_trans) HANDLE_IOCTL(FBIOPUTCMAP, fb_ioctl_trans) +#endif HANDLE_IOCTL(HDIO_GET_UNMASKINTR, hdio_ioctl_trans) HANDLE_IOCTL(HDIO_GET_DMA, hdio_ioctl_trans) HANDLE_IOCTL(HDIO_GET_32BIT, hdio_ioctl_trans) @@ -3779,11 +3794,13 @@ HANDLE_IOCTL(CDROM_SEND_PACKET, cdrom_ioctl_trans) HANDLE_IOCTL(LOOP_SET_STATUS, loop_status) HANDLE_IOCTL(LOOP_GET_STATUS, loop_status) +#ifdef CONFIG_VT HANDLE_IOCTL(PIO_FONTX, do_fontx_ioctl) HANDLE_IOCTL(GIO_FONTX, do_fontx_ioctl) HANDLE_IOCTL(PIO_UNIMAP, do_unimap_ioctl) HANDLE_IOCTL(GIO_UNIMAP, do_unimap_ioctl) HANDLE_IOCTL(KDFONTOP, do_kdfontop_ioctl) +#endif HANDLE_IOCTL(EXT2_IOC32_GETFLAGS, do_ext2_ioctl) HANDLE_IOCTL(EXT2_IOC32_SETFLAGS, do_ext2_ioctl) HANDLE_IOCTL(EXT2_IOC32_GETVERSION, do_ext2_ioctl) diff -Nru a/drivers/char/consolemap.c b/drivers/char/consolemap.c --- a/drivers/char/consolemap.c Wed Oct 9 11:58:53 2002 +++ b/drivers/char/consolemap.c Wed Oct 9 11:58:53 2002 @@ -19,7 +19,6 @@ #include <linux/tty.h> #include <asm/uaccess.h> #include <linux/consolemap.h> -#include <linux/console_struct.h> #include <linux/vt_kern.h> static unsigned short translations[][256] = { @@ -182,7 +181,7 @@ static struct uni_pagedir *dflt; -static void set_inverse_transl(struct vc_data *conp, struct uni_pagedir *p, int i) +static void set_inverse_transl(struct vc_data *vc, struct uni_pagedir *p, int i) { int j, glyph; unsigned short *t = translations[i]; @@ -199,7 +198,7 @@ memset(q, 0, MAX_GLYPH); for (j = 0; j < E_TABSZ; j++) { - glyph = conv_uni_to_pc(conp, t[j]); + glyph = conv_uni_to_pc(vc, t[j]); if (glyph >= 0 && glyph < MAX_GLYPH && q[glyph] < 32) { /* prefer '-' above SHY etc. */ q[glyph] = j; @@ -207,10 +206,10 @@ } } -unsigned short *set_translate(int m,int currcons) +void set_translate(struct vc_data *vc, int m) { - inv_translate[currcons] = m; - return translations[m]; + inv_translate[vc->vc_num] = m; + vc->vc_translate = translations[m]; } /* @@ -220,29 +219,32 @@ * was active, or using Unicode. * Still, it is now possible to a certain extent to cut and paste non-ASCII. */ -unsigned char inverse_translate(struct vc_data *conp, int glyph) +unsigned char inverse_translate(struct vc_data *vc, int glyph) { struct uni_pagedir *p; if (glyph < 0 || glyph >= MAX_GLYPH) return 0; - else if (!(p = (struct uni_pagedir *)*conp->vc_uni_pagedir_loc) || - !p->inverse_translations[inv_translate[conp->vc_num]]) + else if (!(p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc) || + !p->inverse_translations[inv_translate[vc->vc_num]]) return glyph; else - return p->inverse_translations[inv_translate[conp->vc_num]][glyph]; + return p->inverse_translations[inv_translate[vc->vc_num]][glyph]; } static void update_user_maps(void) { - int i; struct uni_pagedir *p, *q = NULL; + struct vc_data *vc; + int i; for (i = 0; i < MAX_NR_CONSOLES; i++) { - if (!vc_cons_allocated(i)) + vc = vc_cons[i].d; + + if (!vc) continue; - p = (struct uni_pagedir *)*vc_cons[i].d->vc_uni_pagedir_loc; + p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; if (p && p != q) { - set_inverse_transl(vc_cons[i].d, p, USER_MAP); + set_inverse_transl(vc, p, USER_MAP); q = p; } } @@ -256,7 +258,7 @@ * 0xf000-0xf0ff "transparent" Unicodes) whereas the "new" variants set * Unicodes explicitly. */ -int con_set_trans_old(unsigned char * arg) +int con_set_trans_old(struct vc_data *vc, unsigned char * arg) { int i; unsigned short *p = translations[USER_MAP]; @@ -275,7 +277,7 @@ return 0; } -int con_get_trans_old(unsigned char * arg) +int con_get_trans_old(struct vc_data *vc, unsigned char * arg) { int i, ch; unsigned short *p = translations[USER_MAP]; @@ -286,13 +288,13 @@ for (i=0; i<E_TABSZ ; i++) { - ch = conv_uni_to_pc(vc_cons[fg_console].d, p[i]); + ch = conv_uni_to_pc(vc, p[i]); __put_user((ch & ~0xff) ? 0 : ch, arg+i); } return 0; } -int con_set_trans_new(ushort * arg) +int con_set_trans_new(struct vc_data *vc, ushort * arg) { int i; unsigned short *p = translations[USER_MAP]; @@ -312,7 +314,7 @@ return 0; } -int con_get_trans_new(ushort * arg) +int con_get_trans_new(struct vc_data *vc, ushort * arg) { int i; unsigned short *p = translations[USER_MAP]; @@ -363,28 +365,29 @@ } } -void con_free_unimap(int con) +void con_free_unimap(struct vc_data *vc) { struct uni_pagedir *p; - struct vc_data *conp = vc_cons[con].d; - p = (struct uni_pagedir *)*conp->vc_uni_pagedir_loc; + p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; if (!p) return; - *conp->vc_uni_pagedir_loc = 0; + *vc->vc_uni_pagedir_loc = 0; if (--p->refcount) return; con_release_unimap(p); kfree(p); } -static int con_unify_unimap(struct vc_data *conp, struct uni_pagedir *p) +static int con_unify_unimap(struct vc_data *vc, struct uni_pagedir *p) { int i, j, k; struct uni_pagedir *q; for (i = 0; i < MAX_NR_CONSOLES; i++) { - if (!vc_cons_allocated(i)) + struct vc_data *tmp = vc_cons[i].d; + + if (!tmp) continue; - q = (struct uni_pagedir *)*vc_cons[i].d->vc_uni_pagedir_loc; + q = (struct uni_pagedir *)*tmp->vc_uni_pagedir_loc; if (!q || q == p || q->sum != p->sum) continue; for (j = 0; j < 32; j++) { @@ -407,7 +410,7 @@ } if (j == 32) { q->refcount++; - *conp->vc_uni_pagedir_loc = (unsigned long)q; + *vc->vc_uni_pagedir_loc = (unsigned long)q; con_release_unimap(p); kfree(p); return 1; @@ -443,12 +446,11 @@ } /* ui is a leftover from using a hashtable, but might be used again */ -int con_clear_unimap(int con, struct unimapinit *ui) +int con_clear_unimap(struct vc_data *vc, struct unimapinit *ui) { struct uni_pagedir *p, *q; - struct vc_data *conp = vc_cons[con].d; - p = (struct uni_pagedir *)*conp->vc_uni_pagedir_loc; + p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; if (p && p->readonly) return -EIO; if (!p || --p->refcount) { q = (struct uni_pagedir *)kmalloc(sizeof(*p), GFP_KERNEL); @@ -458,7 +460,7 @@ } memset(q, 0, sizeof(*q)); q->refcount=1; - *conp->vc_uni_pagedir_loc = (unsigned long)q; + *vc->vc_uni_pagedir_loc = (unsigned long)q; } else { if (p == dflt) dflt = NULL; p->refcount++; @@ -469,13 +471,12 @@ } int -con_set_unimap(int con, ushort ct, struct unipair *list) +con_set_unimap(struct vc_data *vc, ushort ct, struct unipair *list) { - int err = 0, err1, i; struct uni_pagedir *p, *q; - struct vc_data *conp = vc_cons[con].d; - - p = (struct uni_pagedir *)*conp->vc_uni_pagedir_loc; + int err = 0, err1, i; + + p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; if (p->readonly) return -EIO; if (!ct) return 0; @@ -484,10 +485,10 @@ int j, k; u16 **p1, *p2, l; - err1 = con_clear_unimap(con, NULL); + err1 = con_clear_unimap(vc, NULL); if (err1) return err1; - q = (struct uni_pagedir *)*conp->vc_uni_pagedir_loc; + q = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; for (i = 0, l = 0; i < 32; i++) if ((p1 = p->uni_pgdir[i])) for (j = 0; j < 32; j++) @@ -497,7 +498,7 @@ err1 = con_insert_unipair(q, l, p2[k]); if (err1) { p->refcount++; - *conp->vc_uni_pagedir_loc = (unsigned long)p; + *vc->vc_uni_pagedir_loc = (unsigned long)p; con_release_unimap(q); kfree(q); return err1; @@ -516,12 +517,11 @@ list++; } - if (con_unify_unimap(conp, p)) + if (con_unify_unimap(vc, p)) return err; for (i = 0; i <= 3; i++) - set_inverse_transl(conp, p, i); /* Update all inverse translations */ - + set_inverse_transl(vc, p, i); /* Update all inverse translations */ return err; } @@ -531,19 +531,18 @@ PIO_FONTRESET ioctl is called. */ int -con_set_default_unimap(int con) +con_set_default_unimap(struct vc_data *vc) { int i, j, err = 0, err1; u16 *q; struct uni_pagedir *p; - struct vc_data *conp = vc_cons[con].d; if (dflt) { - p = (struct uni_pagedir *)*conp->vc_uni_pagedir_loc; + p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; if (p == dflt) return 0; dflt->refcount++; - *conp->vc_uni_pagedir_loc = (unsigned long)dflt; + *vc->vc_uni_pagedir_loc = (unsigned long)dflt; if (p && --p->refcount) { con_release_unimap(p); kfree(p); @@ -552,11 +551,10 @@ } /* The default font is always 256 characters */ - - err = con_clear_unimap(con,NULL); + err = con_clear_unimap(vc, NULL); if (err) return err; - p = (struct uni_pagedir *)*conp->vc_uni_pagedir_loc; + p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; q = dfont_unitable; for (i = 0; i < 256; i++) @@ -566,46 +564,43 @@ err = err1; } - if (con_unify_unimap(conp, p)) { - dflt = (struct uni_pagedir *)*conp->vc_uni_pagedir_loc; + if (con_unify_unimap(vc, p)) { + dflt = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; return err; } for (i = 0; i <= 3; i++) - set_inverse_transl(conp, p, i); /* Update all inverse translations */ + set_inverse_transl(vc, p, i); /* Update all inverse translations */ dflt = p; return err; } int -con_copy_unimap(int dstcon, int srccon) +con_copy_unimap(struct vc_data *dst, struct vc_data *src) { - struct vc_data *sconp = vc_cons[srccon].d; - struct vc_data *dconp = vc_cons[dstcon].d; struct uni_pagedir *q; - if (!vc_cons_allocated(srccon) || !*sconp->vc_uni_pagedir_loc) + if (!src || !*src->vc_uni_pagedir_loc) return -EINVAL; - if (*dconp->vc_uni_pagedir_loc == *sconp->vc_uni_pagedir_loc) + if (*dst->vc_uni_pagedir_loc == *src->vc_uni_pagedir_loc) return 0; - con_free_unimap(dstcon); - q = (struct uni_pagedir *)*sconp->vc_uni_pagedir_loc; + con_free_unimap(dst); + q = (struct uni_pagedir *)*src->vc_uni_pagedir_loc; q->refcount++; - *dconp->vc_uni_pagedir_loc = (long)q; + *dst->vc_uni_pagedir_loc = (long)q; return 0; } int -con_get_unimap(int con, ushort ct, ushort *uct, struct unipair *list) +con_get_unimap(struct vc_data *vc, ushort ct, ushort *uct, struct unipair *list) { int i, j, k, ect; u16 **p1, *p2; struct uni_pagedir *p; - struct vc_data *conp = vc_cons[con].d; ect = 0; - if (*conp->vc_uni_pagedir_loc) { - p = (struct uni_pagedir *)*conp->vc_uni_pagedir_loc; + if (*vc->vc_uni_pagedir_loc) { + p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; for (i = 0; i < 32; i++) if ((p1 = p->uni_pgdir[i])) for (j = 0; j < 32; j++) @@ -625,16 +620,16 @@ return ((ect <= ct) ? 0 : -ENOMEM); } -void con_protect_unimap(int con, int rdonly) +void con_protect_unimap(struct vc_data *vc, int rdonly) { struct uni_pagedir *p = (struct uni_pagedir *) - *vc_cons[con].d->vc_uni_pagedir_loc; + *vc->vc_uni_pagedir_loc; if (p) p->readonly = rdonly; } int -conv_uni_to_pc(struct vc_data *conp, long ucs) +conv_uni_to_pc(struct vc_data *vc, long ucs) { int h; u16 **p1, *p2; @@ -655,10 +650,10 @@ else if ((ucs & ~UNI_DIRECT_MASK) == UNI_DIRECT_BASE) return ucs & UNI_DIRECT_MASK; - if (!*conp->vc_uni_pagedir_loc) + if (!*vc->vc_uni_pagedir_loc) return -3; - p = (struct uni_pagedir *)*conp->vc_uni_pagedir_loc; + p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; if ((p1 = p->uni_pgdir[ucs >> 11]) && (p2 = p1[(ucs >> 6) & 0x1f]) && (h = p2[ucs & 0x3f]) < MAX_GLYPH) @@ -677,7 +672,10 @@ { int i; - for (i = 0; i < MAX_NR_CONSOLES; i++) - if (vc_cons_allocated(i) && !*vc_cons[i].d->vc_uni_pagedir_loc) - con_set_default_unimap(i); + for (i = 0; i < MAX_NR_CONSOLES; i++) { + struct vc_data *vc = vc_cons[i].d; + + if (vc && !*vc->vc_uni_pagedir_loc) + con_set_default_unimap(vc); + } } diff -Nru a/drivers/char/keyboard.c b/drivers/char/keyboard.c --- a/drivers/char/keyboard.c Wed Oct 9 11:58:53 2002 +++ b/drivers/char/keyboard.c Wed Oct 9 11:58:53 2002 @@ -35,7 +35,6 @@ #include <linux/init.h> #include <linux/slab.h> -#include <linux/console_struct.h> #include <linux/kbd_kern.h> #include <linux/kbd_diacr.h> #include <linux/vt_kern.h> diff -Nru a/drivers/char/selection.c b/drivers/char/selection.c --- a/drivers/char/selection.c Wed Oct 9 11:58:53 2002 +++ b/drivers/char/selection.c Wed Oct 9 11:58:53 2002 @@ -22,7 +22,6 @@ #include <linux/vt_kern.h> #include <linux/consolemap.h> -#include <linux/console_struct.h> #include <linux/selection.h> #ifndef MIN @@ -288,7 +287,8 @@ */ int paste_selection(struct tty_struct *tty) { - struct vt_struct *vt = (struct vt_struct *) tty->driver_data; + struct vc_data *vc = (struct vc_data *) tty->driver_data; + struct vt_struct *vt = vt_cons[vc->vc_num]; int pasted = 0, count; DECLARE_WAITQUEUE(wait, current); diff -Nru a/drivers/char/vc_screen.c b/drivers/char/vc_screen.c --- a/drivers/char/vc_screen.c Wed Oct 9 11:58:53 2002 +++ b/drivers/char/vc_screen.c Wed Oct 9 11:58:53 2002 @@ -32,7 +32,6 @@ #include <linux/mm.h> #include <linux/init.h> #include <linux/vt_kern.h> -#include <linux/console_struct.h> #include <linux/selection.h> #include <linux/kbd_kern.h> #include <linux/console.h> diff -Nru a/drivers/char/vt.c b/drivers/char/vt.c --- a/drivers/char/vt.c Wed Oct 9 11:58:53 2002 +++ b/drivers/char/vt.c Wed Oct 9 11:58:53 2002 @@ -90,7 +90,6 @@ #include <linux/devfs_fs_kernel.h> #include <linux/vt_kern.h> #include <linux/selection.h> -#include <linux/console_struct.h> #include <linux/kbd_kern.h> #include <linux/consolemap.h> #include <linux/timer.h> @@ -669,7 +668,7 @@ vt_cons[currcons] = (struct vt_struct *)(p+sizeof(struct vc_data)); visual_init(currcons, 1); if (!*vc_cons[currcons].d->vc_uni_pagedir_loc) - con_set_default_unimap(currcons); + con_set_default_unimap(vc_cons[currcons].d); q = (long)kmalloc(screenbuf_size, GFP_KERNEL); if (!q) { kfree((char *) p); @@ -1073,9 +1072,8 @@ * control chars if defined, don't set * bit 8 on output. */ - translate = set_translate(charset == 0 - ? G0_charset - : G1_charset,currcons); + set_translate(vc_cons[currcons].d, charset == 0 ? + G0_charset : G1_charset); disp_ctrl = 0; toggle_meta = 0; break; @@ -1083,7 +1081,7 @@ * Select first alternate font, lets * chars < 32 be displayed as ROM chars. */ - translate = set_translate(IBMPC_MAP,currcons); + set_translate(vc_cons[currcons].d, IBMPC_MAP); disp_ctrl = 1; toggle_meta = 0; break; @@ -1091,7 +1089,7 @@ * Select second alternate font, toggle * high bit before displaying as ROM char. */ - translate = set_translate(IBMPC_MAP,currcons); + set_translate(vc_cons[currcons].d, IBMPC_MAP); disp_ctrl = 1; toggle_meta = 1; break; @@ -1373,7 +1371,7 @@ color = s_color; G0_charset = saved_G0; G1_charset = saved_G1; - translate = set_translate(charset ? G1_charset : G0_charset,currcons); + set_translate(vc_cons[currcons].d, charset ? G1_charset : G0_charset); update_attr(currcons); need_wrap = 0; } @@ -1389,7 +1387,7 @@ bottom = video_num_lines; vc_state = ESnormal; ques = 0; - translate = set_translate(LAT1_MAP,currcons); + set_translate(vc_cons[currcons].d, LAT1_MAP); G0_charset = LAT1_MAP; G1_charset = GRAF_MAP; charset = 0; @@ -1474,12 +1472,12 @@ return; case 14: charset = 1; - translate = set_translate(G1_charset,currcons); + set_translate(vc_cons[currcons].d, G1_charset); disp_ctrl = 1; return; case 15: charset = 0; - translate = set_translate(G0_charset,currcons); + set_translate(vc_cons[currcons].d, G0_charset); disp_ctrl = 0; return; case 24: case 26: @@ -1786,7 +1784,7 @@ else if (c == 'K') G0_charset = USER_MAP; if (charset == 0) - translate = set_translate(G0_charset,currcons); + set_translate(vc_cons[currcons].d, G0_charset); vc_state = ESnormal; return; case ESsetG1: @@ -1799,7 +1797,7 @@ else if (c == 'K') G1_charset = USER_MAP; if (charset == 1) - translate = set_translate(G1_charset,currcons); + set_translate(vc_cons[currcons].d, G1_charset); vc_state = ESnormal; return; default: @@ -1834,9 +1832,9 @@ #endif int c, tc, ok, n = 0, draw_x = -1; - unsigned int currcons; + unsigned int currcons = minor(tty->device) - tty->driver.minor_start; unsigned long draw_from = 0, draw_to = 0; - struct vt_struct *vt = (struct vt_struct *)tty->driver_data; + struct vc_data *vc = (struct vc_data *)tty->driver_data; u16 himask, charmask; const unsigned char *orig_buf = NULL; int orig_count; @@ -1844,13 +1842,12 @@ if (in_interrupt()) return count; - currcons = vt->vc_num; - if (!vc_cons_allocated(currcons)) { + if (!vc) { /* could this happen? */ static int error = 0; if (!error) { error = 1; - printk("con_write: tty %d not allocated\n", currcons+1); + printk("con_write: tty %d not allocated\n", currcons + 1); } return 0; } @@ -2308,7 +2305,8 @@ static void con_unthrottle(struct tty_struct *tty) { - struct vt_struct *vt = (struct vt_struct *) tty->driver_data; + struct vc_data *vc = (struct vc_data *) tty->driver_data; + struct vt_struct *vt = vt_cons[vc->vc_num]; wake_up_interruptible(&vt->paste_wait); } @@ -2345,7 +2343,7 @@ static void con_flush_chars(struct tty_struct *tty) { - struct vt_struct *vt; + struct vc_data *vc; if (in_interrupt()) /* from flush_to_ldisc */ return; @@ -2354,9 +2352,9 @@ /* if we race with con_close(), vt may be null */ acquire_console_sem(); - vt = (struct vt_struct *)tty->driver_data; - if (vt) - set_cursor(vt->vc_num); + vc = (struct vc_data *)tty->driver_data; + if (vc) + set_cursor(vc->vc_num); release_console_sem(); } @@ -2375,7 +2373,7 @@ return i; vt_cons[currcons]->vc_num = currcons; - tty->driver_data = vt_cons[currcons]; + tty->driver_data = vc_cons[currcons].d; vc_cons[currcons].d->vc_tty = tty; if (!tty->winsize.ws_row && !tty->winsize.ws_col) { @@ -2389,15 +2387,15 @@ static void con_close(struct tty_struct *tty, struct file * filp) { - struct vt_struct *vt; + struct vc_data *vc; if (!tty) return; if (tty->count != 1) return; vcs_make_devfs (minor(tty->device) - tty->driver.minor_start, 1); - vt = (struct vt_struct*)tty->driver_data; - if (vt) - vc_cons[vt->vc_num].d->vc_tty = NULL; + vc = (struct vc_data *)tty->driver_data; + if (vc) + vc_cons[vc->vc_num].d->vc_tty = NULL; tty->driver_data = 0; } @@ -2845,12 +2843,13 @@ #define max_font_size 65536 -int con_font_op(int currcons, struct console_font_op *op) +int con_font_op(struct vc_data *vc, struct console_font_op *op) { - int rc = -EINVAL; + struct console_font_op old_op; int size = max_font_size, set; + int currcons = vc->vc_num; + int rc = -EINVAL; u8 *temp = NULL; - struct console_font_op old_op; if (vt_cons[currcons]->vc_mode != KD_TEXT) goto quit; @@ -2891,7 +2890,7 @@ } else if (op->op == KD_FONT_OP_GET) set = 0; else - return sw->con_font_op(vc_cons[currcons].d, op); + return sw->con_font_op(vc, op); if (op->data) { temp = kmalloc(size, GFP_KERNEL); if (!temp) @@ -2904,7 +2903,7 @@ } acquire_console_sem(); - rc = sw->con_font_op(vc_cons[currcons].d, op); + rc = sw->con_font_op(vc, op); release_console_sem(); op->data = old_op.data; diff -Nru a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c --- a/drivers/char/vt_ioctl.c Wed Oct 9 11:58:53 2002 +++ b/drivers/char/vt_ioctl.c Wed Oct 9 11:58:53 2002 @@ -279,7 +279,7 @@ } static inline int -do_fontx_ioctl(int cmd, struct consolefontdesc *user_cfd, int perm) +do_fontx_ioctl(struct vc_data *vc, int cmd, struct consolefontdesc *user_cfd, int perm) { struct consolefontdesc cfdarg; struct console_font_op op; @@ -298,7 +298,7 @@ op.height = cfdarg.charheight; op.charcount = cfdarg.charcount; op.data = cfdarg.chardata; - return con_font_op(fg_console, &op); + return con_font_op(vc, &op); case GIO_FONTX: { op.op = KD_FONT_OP_GET; op.flags = KD_FONT_FLAG_OLD; @@ -306,7 +306,7 @@ op.height = cfdarg.charheight; op.charcount = cfdarg.charcount; op.data = cfdarg.chardata; - i = con_font_op(fg_console, &op); + i = con_font_op(vc, &op); if (i) return i; cfdarg.charheight = op.height; @@ -320,7 +320,7 @@ } static inline int -do_unimap_ioctl(int cmd, struct unimapdesc *user_ud,int perm) +do_unimap_ioctl(struct vc_data *vc, int cmd, struct unimapdesc *user_ud,int perm) { struct unimapdesc tmp; int i = 0; @@ -336,9 +336,9 @@ case PIO_UNIMAP: if (!perm) return -EPERM; - return con_set_unimap(fg_console, tmp.entry_ct, tmp.entries); + return con_set_unimap(vc, tmp.entry_ct, tmp.entries); case GIO_UNIMAP: - return con_get_unimap(fg_console, tmp.entry_ct, &(user_ud->entry_ct), tmp.entries); + return con_get_unimap(vc, tmp.entry_ct, &(user_ud->entry_ct), tmp.entries); } return 0; } @@ -350,13 +350,13 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, unsigned int cmd, unsigned long arg) { - int i, perm; + struct vc_data *vc = (struct vc_data *)tty->driver_data; + struct kbd_struct * kbd; unsigned int console; unsigned char ucval; - struct kbd_struct * kbd; - struct vt_struct *vt = (struct vt_struct *)tty->driver_data; + int i, perm; - console = vt->vc_num; + console = vc->vc_num; if (!vc_cons_allocated(console)) /* impossible? */ return -ENOIOCTLCMD; @@ -869,7 +869,7 @@ op.height = 0; op.charcount = 256; op.data = (char *) arg; - return con_font_op(fg_console, &op); + return con_font_op(vc, &op); } case GIO_FONT: { @@ -880,7 +880,7 @@ op.height = 32; op.charcount = 256; op.data = (char *) arg; - return con_font_op(fg_console, &op); + return con_font_op(vc, &op); } case PIO_CMAP: @@ -893,7 +893,7 @@ case PIO_FONTX: case GIO_FONTX: - return do_fontx_ioctl(cmd, (struct consolefontdesc *)arg, perm); + return do_fontx_ioctl(vc, cmd, (struct consolefontdesc *)arg, perm); case PIO_FONTRESET: { @@ -909,9 +909,9 @@ struct console_font_op op; op.op = KD_FONT_OP_SET_DEFAULT; op.data = NULL; - i = con_font_op(fg_console, &op); + i = con_font_op(vc, &op); if (i) return i; - con_set_default_unimap(fg_console); + con_set_default_unimap(vc); return 0; } #endif @@ -923,7 +923,7 @@ return -EFAULT; if (!perm && op.op != KD_FONT_OP_GET) return -EPERM; - i = con_font_op(console, &op); + i = con_font_op(vc, &op); if (i) return i; if (copy_to_user((void *) arg, &op, sizeof(op))) return -EFAULT; @@ -933,18 +933,18 @@ case PIO_SCRNMAP: if (!perm) return -EPERM; - return con_set_trans_old((unsigned char *)arg); + return con_set_trans_old(vc, (unsigned char *)arg); case GIO_SCRNMAP: - return con_get_trans_old((unsigned char *)arg); + return con_get_trans_old(vc, (unsigned char *)arg); case PIO_UNISCRNMAP: if (!perm) return -EPERM; - return con_set_trans_new((unsigned short *)arg); + return con_set_trans_new(vc, (unsigned short *)arg); case GIO_UNISCRNMAP: - return con_get_trans_new((unsigned short *)arg); + return con_get_trans_new(vc, (unsigned short *)arg); case PIO_UNIMAPCLR: { struct unimapinit ui; @@ -952,13 +952,13 @@ return -EPERM; i = copy_from_user(&ui, (void *)arg, sizeof(struct unimapinit)); if (i) return -EFAULT; - con_clear_unimap(fg_console, &ui); + con_clear_unimap(vc, &ui); return 0; } case PIO_UNIMAP: case GIO_UNIMAP: - return do_unimap_ioctl(cmd, (struct unimapdesc *)arg, perm); + return do_unimap_ioctl(vc, cmd, (struct unimapdesc *)arg, perm); case VT_LOCKSWITCH: if (!capable(CAP_SYS_TTY_CONFIG)) diff -Nru a/drivers/video/dummycon.c b/drivers/video/dummycon.c --- a/drivers/video/dummycon.c Wed Oct 9 11:58:53 2002 +++ b/drivers/video/dummycon.c Wed Oct 9 11:58:53 2002 @@ -9,7 +9,6 @@ #include <linux/kdev_t.h> #include <linux/tty.h> #include <linux/console.h> -#include <linux/console_struct.h> #include <linux/vt_kern.h> #include <linux/init.h> diff -Nru a/drivers/video/mdacon.c b/drivers/video/mdacon.c --- a/drivers/video/mdacon.c Wed Oct 9 11:58:53 2002 +++ b/drivers/video/mdacon.c Wed Oct 9 11:58:53 2002 @@ -33,7 +33,6 @@ #include <linux/module.h> #include <linux/tty.h> #include <linux/console.h> -#include <linux/console_struct.h> #include <linux/string.h> #include <linux/kd.h> #include <linux/slab.h> @@ -377,7 +376,7 @@ static void mdacon_deinit(struct vc_data *c) { - /* con_set_default_unimap(c->vc_num); */ + /* con_set_default_unimap(c); */ if (mda_display_fg == c) mda_display_fg = NULL; diff -Nru a/drivers/video/newport_con.c b/drivers/video/newport_con.c --- a/drivers/video/newport_con.c Wed Oct 9 11:58:53 2002 +++ b/drivers/video/newport_con.c Wed Oct 9 11:58:53 2002 @@ -16,7 +16,6 @@ #include <linux/kd.h> #include <linux/selection.h> #include <linux/console.h> -#include <linux/console_struct.h> #include <linux/vt_kern.h> #include <linux/mm.h> #include <linux/module.h> diff -Nru a/drivers/video/promcon.c b/drivers/video/promcon.c --- a/drivers/video/promcon.c Wed Oct 9 11:58:53 2002 +++ b/drivers/video/promcon.c Wed Oct 9 11:58:53 2002 @@ -15,7 +15,6 @@ #include <linux/slab.h> #include <linux/delay.h> #include <linux/console.h> -#include <linux/console_struct.h> #include <linux/vt_kern.h> #include <linux/selection.h> #include <linux/fb.h> @@ -156,9 +155,9 @@ k++; } set_fs(KERNEL_DS); - con_clear_unimap(conp->vc_num, NULL); - con_set_unimap(conp->vc_num, k, p); - con_protect_unimap(conp->vc_num, 1); + con_clear_unimap(conp, NULL); + con_set_unimap(conp, k, p); + con_protect_unimap(conp, 1); set_fs(old_fs); kfree(p); } @@ -176,7 +175,7 @@ p = *conp->vc_uni_pagedir_loc; if (conp->vc_uni_pagedir_loc == &conp->vc_uni_pagedir || !--conp->vc_uni_pagedir_loc[1]) - con_free_unimap(conp->vc_num); + con_free_unimap(conp); conp->vc_uni_pagedir_loc = promcon_uni_pagedir; promcon_uni_pagedir[1]++; if (!promcon_uni_pagedir[0] && p) { @@ -193,9 +192,9 @@ { /* When closing the last console, reset video origin */ if (!--promcon_uni_pagedir[1]) - con_free_unimap(conp->vc_num); + con_free_unimap(conp); conp->vc_uni_pagedir_loc = &conp->vc_uni_pagedir; - con_set_default_unimap(conp->vc_num); + con_set_default_unimap(conp); } static int diff -Nru a/drivers/video/sticon.c b/drivers/video/sticon.c --- a/drivers/video/sticon.c Wed Oct 9 11:58:53 2002 +++ b/drivers/video/sticon.c Wed Oct 9 11:58:53 2002 @@ -49,7 +49,6 @@ #include <linux/kernel.h> #include <linux/tty.h> #include <linux/console.h> -#include <linux/console_struct.h> #include <linux/errno.h> #include <linux/vt_kern.h> #include <linux/selection.h> diff -Nru a/drivers/video/vgacon.c b/drivers/video/vgacon.c --- a/drivers/video/vgacon.c Wed Oct 9 11:58:53 2002 +++ b/drivers/video/vgacon.c Wed Oct 9 11:58:53 2002 @@ -41,7 +41,6 @@ #include <linux/kernel.h> #include <linux/tty.h> #include <linux/console.h> -#include <linux/console_struct.h> #include <linux/string.h> #include <linux/kd.h> #include <linux/slab.h> @@ -334,11 +333,11 @@ p = *c->vc_uni_pagedir_loc; if (c->vc_uni_pagedir_loc == &c->vc_uni_pagedir || !--c->vc_uni_pagedir_loc[1]) - con_free_unimap(c->vc_num); + con_free_unimap(c); c->vc_uni_pagedir_loc = vgacon_uni_pagedir; vgacon_uni_pagedir[1]++; if (!vgacon_uni_pagedir[0] && p) - con_set_default_unimap(c->vc_num); + con_set_default_unimap(c); } static inline void vga_set_mem_top(struct vc_data *c) @@ -352,10 +351,10 @@ if (!--vgacon_uni_pagedir[1]) { c->vc_visible_origin = vga_vram_base; vga_set_mem_top(c); - con_free_unimap(c->vc_num); + con_free_unimap(c); } c->vc_uni_pagedir_loc = &c->vc_uni_pagedir; - con_set_default_unimap(c->vc_num); + con_set_default_unimap(c); } static u8 vgacon_build_attr(struct vc_data *c, u8 color, u8 intensity, u8 blink, u8 underline, u8 reverse) diff -Nru a/include/linux/consolemap.h b/include/linux/consolemap.h --- a/include/linux/consolemap.h Wed Oct 9 11:58:54 2002 +++ b/include/linux/consolemap.h Wed Oct 9 11:58:54 2002 @@ -10,6 +10,6 @@ struct vc_data; -extern unsigned char inverse_translate(struct vc_data *conp, int glyph); -extern unsigned short *set_translate(int m,int currcons); -extern int conv_uni_to_pc(struct vc_data *conp, long ucs); +extern unsigned char inverse_translate(struct vc_data *vc, int glyph); +extern void set_translate(struct vc_data *vc, int m); +extern int conv_uni_to_pc(struct vc_data *vc, long ucs); diff -Nru a/include/linux/vt_kern.h b/include/linux/vt_kern.h --- a/include/linux/vt_kern.h Wed Oct 9 11:58:53 2002 +++ b/include/linux/vt_kern.h Wed Oct 9 11:58:53 2002 @@ -7,6 +7,7 @@ */ #include <linux/config.h> +#include <linux/console_struct.h> #include <linux/vt.h> #include <linux/kd.h> #include <linux/tty.h> @@ -51,7 +52,7 @@ void do_blank_screen(int gfx_mode); void unblank_screen(void); void poke_blanked_console(void); -int con_font_op(int currcons, struct console_font_op *op); +int con_font_op(struct vc_data *vc, struct console_font_op *op); int con_set_cmap(unsigned char *cmap); int con_get_cmap(unsigned char *cmap); void scrollback(int); @@ -69,17 +70,17 @@ struct unimapinit; struct unipair; -int con_set_trans_old(unsigned char * table); -int con_get_trans_old(unsigned char * table); -int con_set_trans_new(unsigned short * table); -int con_get_trans_new(unsigned short * table); -int con_clear_unimap(int currcons, struct unimapinit *ui); -int con_set_unimap(int currcons, ushort ct, struct unipair *list); -int con_get_unimap(int currcons, ushort ct, ushort *uct, struct unipair *list); -int con_set_default_unimap(int currcons); -void con_free_unimap(int currcons); -void con_protect_unimap(int currcons, int rdonly); -int con_copy_unimap(int dstcons, int srccons); +int con_set_trans_old(struct vc_data *vc, unsigned char * table); +int con_get_trans_old(struct vc_data *vc, unsigned char * table); +int con_set_trans_new(struct vc_data *vc, unsigned short * table); +int con_get_trans_new(struct vc_data *vc, unsigned short * table); +int con_clear_unimap(struct vc_data *vc, struct unimapinit *ui); +int con_set_unimap(struct vc_data *vc, ushort ct, struct unipair *list); +int con_get_unimap(struct vc_data *vc, ushort ct, ushort *uct, struct unipair *list); +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, struct vc_data *src); /* vt.c */ diff -Nru a/include/video/fbcon.h b/include/video/fbcon.h --- a/include/video/fbcon.h Wed Oct 9 11:58:53 2002 +++ b/include/video/fbcon.h Wed Oct 9 11:58:53 2002 @@ -13,8 +13,8 @@ #include <linux/config.h> #include <linux/types.h> -#include <linux/console_struct.h> #include <linux/vt_buffer.h> +#include <linux/vt_kern.h> #include <asm/io.h> =================================================================== This BitKeeper patch contains the following changesets: + ## Wrapped with gzip_uu ## begin 664 bkpatch4038 M'XL(`&Y\I#T``^T];7/;-M*?I5^!7N<R=FK9Q`M!TFYR2>,TIWG2)),TG9MI M.QJ:I&S5DJ@C*2>^ZO[[L\"2$D61%$G'EWZP^[*V""P6V%<L%M2WY&,<1*>] M/^+);!;.X_ZWY)]AG)SV9N[G3\%T>ARX47(UG<ROC^=!`D_?AR$\/5G&T4D< M>2<>]`FGP2!.W(MIT(<&[]S$NR(W012?]N@Q7W^2W"Z"T][[EZ\^OG[^OM]_ M\H2\N'+GE\&'("%/GO23,+IQIW[\S(7APOEQ$KGS>!8D[K$7SE;KIBMF&`S^ M,:G%#5.NJ#2$M?*H3ZDK:.`;3-A2]+/I/"N=1@$=-0R'FJ;#K!6CG!O]<T*/ M+6H3@YU0X\1P"*6GIGEJLH%AG1H&J<=.OJ,.&1C]'\B7G=.+OD<^)#!2X`-F M,E]>!R2Y"LCE-(2U)]XRBH`;Y,:-)HH7QV1(/#V$3T)@AVZ[G$]F[H*X<Y^, MPWE"X+D/=%^2\7+N)1.8DT*]C`,2)]'22\B--_+=Q"63>9P$KJ^0NM,X)'&P M"")7D1(N$XUZ'+FSX&(Y'L-07NBK#\*9?O++S_A!/)E[@9*,6Q*'0&FQUZ?) M=$HN`J*H5V1D-,&#Y$H-XP*JX_[_$4XI<_KO-@+4'[3\Z?<-U^@_W<,A-_*N M3F:312S%R740S8/IR23TDBEGQUZ.:<+@;`5_V<;*L;DCI2$E=9AA7?`]HK)_ M!"V;MFER:R6$;=-F-,<+`/N(9LX*UM$`>3.IZPO?D((Z0O*@$=&U0^2HYK`X M]EZ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68/J0H M[O<:HGK+4ZT89]SMM-^2NIA`W\X9(E#'215N%[RN.DG:%?JMU]*UE?P.+\UK M)_XE`^1TP*24:ATP'TSY7U0']'L-:W5@B\6=K+E3:LW7[]IM*]0MWP#<3J`+ MR#?"#`.(NPJS)`/K09CO+^>L7])<*\QK]G829'5V<DYU;?^02EU=N!/=PP>+ M=5'$>I.U]?!:U3"D#POGO]B`XLV3].*)L]Y&Y(_A54O=##>5Z:7*FF8V-K/3 MK6^I$\+&N[J:O<.SK:JV>Z]H.TW=QITJJFFLN,73XO/NAT,/7N=^#SGUJU]K M%37C;A<]-<NW#]E;Z-L*<:L7X[>3X6W4F0RK%Y?!,'<\KA%D8#[(\+W),'YW M0:T,9]SM(L,ZC77.L8@'08EQ+TG75N\O5/X3RX)SF:E==%C[@Z`.FU*PZG>^ M[U>RN[Z/_@NA9^K=R0P/EG;OBCO-WQCT<%/\/K][1GUC0$'9JCG<*;CC.JI3 M!?/!YR2(YN1N=W'.,C2M;ABM>Z4%[XVK]LKT<?V%$6V5L=VW6/1OPC\@AKUZ M%H,8'7O_J4=F,Y,JSVFO(`:PJIQ<4[T#K@WH0Y+L_C0/OUND5O/6#.[RQB)\ M4PGB(]]OJ7)ZLG=\]505LV,M.[GS?6%P<>ID3YW#:=#]VI7^\C7`U_VN51%# M@^M2A3.G&B(ZH^AXQV9[&G>XU;(]F2]5ZKU-WOZK&&>-+XZ==:WFSBUYE^L" MVR9_ZXL7FAO\#E\%L6^+4X/:IHQ:5,"V28)A87<U_@^[]'L]YJ,E)9RES.T4 E;V':RBJQ_VN'\G3SU9;Z=;7Q<O;$MX.QXS"O___@&A]!17,````` ` end |
From: James S. <jsi...@in...> - 2002-10-09 16:20:02
|
This patch fixes the last of the handle_sysrq breakage. MS: (n) 1. A debilitating and surprisingly widespread affliction that renders the sufferer barely able to perform the simplest task. 2. A disease. James Simmons [jsi...@us...] ____/| fbdev/console/gfx developer \ o.O| http://www.linux-fbdev.org =(_)= http://linuxgfx.sourceforge.net U http://linuxconsole.sourceforge.net You can import this changeset into BK by piping this whole message to: '| bk receive [path to repository]' or apply the patch as usual. =================================================================== ChangeSet@1.691, 2002-10-08 13:40:24-07:00, jsi...@ma... Already fixed. arch/um/kernel/um_arch.c | 2 +- drivers/tc/zs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff -Nru a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c --- a/arch/um/kernel/um_arch.c Wed Oct 9 08:36:23 2002 +++ b/arch/um/kernel/um_arch.c Wed Oct 9 08:36:23 2002 @@ -337,7 +337,7 @@ void *unused2) { #ifdef CONFIG_SYSRQ - handle_sysrq('p', ¤t->thread.regs, NULL, NULL); + handle_sysrq('p', ¤t->thread.regs, NULL); #endif machine_halt(); return(0); diff -Nru a/drivers/tc/zs.c b/drivers/tc/zs.c --- a/drivers/tc/zs.c Wed Oct 9 08:36:23 2002 +++ b/drivers/tc/zs.c Wed Oct 9 08:36:23 2002 @@ -443,7 +443,7 @@ if (break_pressed && info->line == sercons.index) { if (ch != 0 && time_before(jiffies, break_pressed + HZ*5)) { - handle_sysrq(ch, regs, NULL, NULL); + handle_sysrq(ch, regs, NULL); break_pressed = 0; goto ignore_char; } =================================================================== This BitKeeper patch contains the following changesets: + ## Wrapped with gzip_uu ## begin 664 bkpatch7145 M'XL(`/=,I#T``\U674_;,!1]QK_"$H]3DWMM)[$C=2J#:9-8-<3$\V0<0T.3 M!B4I'U-^_)RT?(HVI<"TME*MQ#X^]][C<[U+3RI;QCL759KGQ:PBN_1[4=7Q M3JYOKFV6>5:7]21+9U-O9FOW]K@HW%M_7I5^51K?N#5%9@=5K4\S2]R$(UV; M";VR917OH,?OG]2WES;>.?[Z[>3'WC$APR'=G^C9N?UE:SH<DKHHKW265"/M MMBMF7EWJ697;6GNFR)O[J0T#8.X;8,0A"!L,042-P011"[0),"%#0>["&;T8 MQC,X!)`.D[.P"8142`XH>J%""LQ'\$%2Y+&`F(D!1#$`78]./W$Z`/*%OF]( M^\30O:RT.KFE9^F-33R2]C!YOH?"")6+%QN(%,@MUDL4G`>\X4Q*M=7ZD$F4 M#0\C9.20!C+D`1F_$>?H04ID\,H/(:"!?.XI5E*FK:+]VOA_*L\\*ID`1P,1 M1-`X5AH,!MR&8`+9IY,701=:="D6#:A02,?L(DFG=C35I;Y=D-&EF?CSW)_: M<F8S-_K=/KECI9!AQ"(A&A8QAHVQG">G@$:*T$V(^EBM17]$3Z`+W=&[;$_W M^JQ57(%O)KKT35UF[>!Q"J4#Q095%$;-62@2$W&TD53@2KMI"E?NL"#LF';Y M5$%G/*M";'WHG;/=YT1]Z)W0(6B$0AYVQL2?V!(/8KZI+<&'V=*\+FANRW.; MM)[097">9][F661MA3B"4U6D6F-8J&O\'F`_Z:"\[G[NM!^M+/X6SM%J:9T" M6SU]Z/'H4U?_#@\*XUP%T"DL>-[X\!4*PW_3^"HSN4X3>U9-;T>)]=+3?+.4 MNF0*E"(`M@SXK5"!\_ZEM1S2[F_\?HC/I+L.8`OY'C!!\8F(EYVH_SZV53_< M5*U/0!\$"LJ=YTZ@T?]N@7IZF8^2]-P6*[/5-B8'ZZK=N"%7G7I<OQ]OM7B% ?4)9KMK&VNVN[F5@SK>;YT-74W91`D+\2(U7K,PP````` ` end |
From: Vojtech P. <vo...@su...> - 2002-10-08 09:18:45
|
On Tue, Oct 08, 2002 at 07:04:32PM +1000, Brad Hards wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Tue, 8 Oct 2002 18:54, Vojtech Pavlik wrote: > > Because the USB keyboard tells us which keys it has, we don't need a > > scancode->keycode table. (We have something like that in the HID driver, > > because the HID codes aren't the same as Linux keycodes, but the table > > is fixed.) > Except that some people like to remap the keyboard layout. I guess you need to > do it in userspace (ie X) now. > > > For PS/2 you unfortunately cannot have a fixed table, and thus > > EVIOCSKEYCODE is needed. > > > > Btw, the classic KD* scancode loading ioctls should now be supported as > > well. > This is only on the legacy keyboard driver, right? > I'm really concentrating on the event interface. > > Brad > - -- > http://linux.conf.au. 22-25Jan2003. Perth, Aust. I'm registered. Are you? > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.0.6 (GNU/Linux) > Comment: For info see http://www.gnupg.org > > iD8DBQE9op+hW6pHgIdAuOMRAhOZAJ4+3PAO1a9jsETxGa1gtkqFdaScwgCgol7r > +UIJzxLconX6TnG9+IezFg4= > =cSBP > -----END PGP SIGNATURE----- -- Vojtech Pavlik SuSE Labs |
From: Brad H. <bh...@bi...> - 2002-10-08 09:12:10
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tue, 8 Oct 2002 18:54, Vojtech Pavlik wrote: > Because the USB keyboard tells us which keys it has, we don't need a > scancode->keycode table. (We have something like that in the HID driver, > because the HID codes aren't the same as Linux keycodes, but the table > is fixed.) Except that some people like to remap the keyboard layout. I guess you need to do it in userspace (ie X) now. > For PS/2 you unfortunately cannot have a fixed table, and thus > EVIOCSKEYCODE is needed. > > Btw, the classic KD* scancode loading ioctls should now be supported as > well. This is only on the legacy keyboard driver, right? I'm really concentrating on the event interface. Brad - -- http://linux.conf.au. 22-25Jan2003. Perth, Aust. I'm registered. Are you? -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE9op+hW6pHgIdAuOMRAhOZAJ4+3PAO1a9jsETxGa1gtkqFdaScwgCgol7r +UIJzxLconX6TnG9+IezFg4= =cSBP -----END PGP SIGNATURE----- |
From: Vojtech P. <vo...@su...> - 2002-10-08 08:55:38
|
On Tue, Oct 08, 2002 at 06:38:23PM +1000, Brad Hards wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Tue, 8 Oct 2002 18:36, Vojtech Pavlik wrote: > > Are you by any chance trying to do this on a USB keyboard? Bad luck, USB > > keyboards don't have scancode->keycode tables. (at least not yet) > Of course I'm trying it on a USB keyboard! Grrr. Thought I was reading the > code all wrong.... Because the USB keyboard tells us which keys it has, we don't need a scancode->keycode table. (We have something like that in the HID driver, because the HID codes aren't the same as Linux keycodes, but the table is fixed.) For PS/2 you unfortunately cannot have a fixed table, and thus EVIOCSKEYCODE is needed. Btw, the classic KD* scancode loading ioctls should now be supported as well. -- Vojtech Pavlik SuSE Labs |
From: Brad H. <bh...@bi...> - 2002-10-08 08:46:04
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tue, 8 Oct 2002 18:36, Vojtech Pavlik wrote: > Are you by any chance trying to do this on a USB keyboard? Bad luck, USB > keyboards don't have scancode->keycode tables. (at least not yet) Of course I'm trying it on a USB keyboard! Grrr. Thought I was reading the code all wrong.... > Try a normal PS/2 keyboard (or a Sun keyboard, or whatever). The keyboard has two cables. I'll give it a whirl. > > I guess EVIOCSKEYCODE just assignes the int[1] keycode to the int[0] > > scancode. I can't make that work until I understand the scancodes > > business more, I think. > > Yep. Brad - -- http://linux.conf.au. 22-25Jan2003. Perth, Aust. I'm registered. Are you? -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE9opl/W6pHgIdAuOMRApetAJ4gU6z3Qgb33noftC/VsISGD/x8DACgnUuj y4vYJkNUw/ltr/TWz276w3E= =xhVW -----END PGP SIGNATURE----- |
From: Brad H. <bh...@bi...> - 2002-10-08 08:38:54
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tue, 8 Oct 2002 18:33, Vojtech Pavlik wrote: > No, but they have the "PHYS" value readable from either /dev/input/event > devices using an ioctl, or from /proc/bus/input/devices. This reflects > which connector on the USB Hub they're connected to. #include <stdlib.h> #include <stdio.h> #include <sys/ioctl.h> #include <sys/types.h> #include <sys/stat.h> #include <asm/types.h> #include <fcntl.h> #include <unistd.h> #include <stdint.h> #include <linux/input.h> int main (int argc, char **argv) { int fd = -1; char phys[256]= "Unknown"; /* ioctl() requires a file descriptor, so we check we got one, and then open it */ if (argc != 2) { fprintf(stderr, "usage: %s event-device - probably /dev/input/event0\n", argv[0]); exit(1); } if ((fd = open(argv[1], O_RDONLY)) < 0) { perror("evdev open"); exit(1); } /* suck out the name information * return value is the length of the physical path, for success * or -EFAULT for failure */ if(ioctl(fd, EVIOCGPHYS(sizeof(phys)), phys) < 0) { perror("event ioctl"); } printf("The device on %s says it's physical path is %s\n", argv[1], phys); close(fd); exit(0); } Brad - -- http://linux.conf.au. 22-25Jan2003. Perth, Aust. I'm registered. Are you? -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE9opfSW6pHgIdAuOMRAvC0AJsGTChZT5VGaDx6pbzvBgD5wV6BNQCglr0T Ad1WtJN+Wm7GsKRZ5SGK1fM= =WWBh -----END PGP SIGNATURE----- |
From: Vojtech P. <vo...@su...> - 2002-10-08 08:36:16
|
On Tue, Oct 08, 2002 at 01:05:15PM +1000, Brad Hards wrote: > I'm trying to finish off my documentation, and it's down to EVIOC[G,S]KEYCODE. > > The problem is that I don't think I understand what the arguments are. > > EVIOCGKEYCODE takes a int[2], and the first int looks like it should be passed > in (ie I set int[0] to some value, then call ioctl(fd, EVIOCGKEYCODE, int), > and then read back the other value in int[1]). > > I guess that the first argument is a scancode, and the second is a keycode. > > However when I pass in what I think is a reasonable value (as given by > showkeys -s), I'm getting -EINVAL. > > Example: showkey -s gives me 0x39 for a space bar held down. I assumed if I > > codes[0] = 0x39; > if(ioctl(fd, EVIOCGKEYCODE, codes)) > perror("evdev ioctl"); > printf("[0]= %d, [1] = %d\n", codes[0], codes[1]); > > Then I would get back codes[1] == KEY_SPACE. > > However I get > evdev ioctl: Invalid argument > [0]= 57, [1] = 1073784704 > > Anyone familiar with this? Or can provide a hint? Are you by any chance trying to do this on a USB keyboard? Bad luck, USB keyboards don't have scancode->keycode tables. (at least not yet) Try a normal PS/2 keyboard (or a Sun keyboard, or whatever). > I guess EVIOCSKEYCODE just assignes the int[1] keycode to the int[0] scancode. > I can't make that work until I understand the scancodes business more, I > think. Yep. -- Vojtech Pavlik SuSE Labs |
From: Vojtech P. <vo...@su...> - 2002-10-08 08:33:24
|
On Fri, Sep 27, 2002 at 01:22:39PM -0600, Brad Midgley wrote: > > Right now i am putting together a system which (among other) uses > > a userspace mechanism to determine the vt which it should bind > > keyboards to. for conveniance i am useing the hotplug interface > > and consider extending hotplug to return vt numbers. > > i wrote an app a while ago that put up "press 0" and "press 1" etc on each head and used the result to map keyboards. (it was in conjunction with a failed attempt to patch the kernel for multihead) > > i looked a bit and couldn't find the source, but you get the idea. > > one problem is that two usb keyboards would come up in a random order and you'd have to do this at every boot and every time keyboards were plugged/unplugged. not fun. do usb keyboards have a serial number? (dreaming i'm sure) No, but they have the "PHYS" value readable from either /dev/input/event devices using an ioctl, or from /proc/bus/input/devices. This reflects which connector on the USB Hub they're connected to. -- Vojtech Pavlik SuSE Labs |
From: Vojtech P. <vo...@su...> - 2002-10-08 08:12:59
|
On Tue, Oct 08, 2002 at 10:17:24AM +1000, Brad Hards wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Mon, 7 Oct 2002 18:07, Vojtech Pavlik wrote: > > On Fri, Sep 27, 2002 at 09:34:31PM +1000, Brad Hards wrote: > > > And it is broken, at least on USB. We're reporting the same on both > > > EVIOCGPHYS and EVIOGUNIQ - the path. > > > > Hmm, It doesn't seem so to me: > <snip> > You were right, of course. I cut'n'pasted my test code, and forgot to change > the ioctl from EVIOCGPHYS to EVIOCGUNIQ. I feel quite embarressed :-( > > > Others usually don't set UNIQ and only set PHYS as they don't have an > > unique identifier. > So a NULL string means "I don't have a unique identifier"? Yes. > I can't actually find a HID device that has a serial number. Maybe I need to > make one... That would work. I think some Wacoms might have serial numbers, at least their tools (in the wacom protocol, not USB) do. -- Vojtech Pavlik SuSE Labs |