From: Aivils S. <ai...@us...> - 2004-10-22 07:46:30
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1411/ruby-2.6/drivers/char Modified Files: Kconfig Makefile keyboard.c selection.c tty_io.c vt.c vt_ioctl.c Log Message: sync to 2.6.9 Index: Kconfig =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/Kconfig,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- Kconfig 24 Aug 2004 05:31:53 -0000 1.10 +++ Kconfig 22 Oct 2004 07:46:16 -0000 1.11 @@ -66,7 +66,7 @@ config HW_CONSOLE bool - depends on VT && !S390 && !UM + depends on VT && !S390 && !USERMODE default y config SERIAL_NONSTANDARD @@ -431,6 +431,14 @@ will also be built as a module. This has to be loaded before "ser_a2232". If you want to do this, answer M here. +config SGI_SNSC + bool "SGI Altix system controller communication support" + depends on (IA64_SGI_SN2 || IA64_GENERIC) + help + If you have an SGI Altix and you want to enable system + controller communication from user space (you want this!), + say Y. Otherwise, say N. + source "drivers/serial/Kconfig" config UNIX98_PTYS @@ -594,39 +602,6 @@ which will also be compiled when this driver is built as a module. -config QIC02_TAPE - tristate "QIC-02 tape support" - help - If you have a non-SCSI tape drive like that, say Y. - - To compile this driver as a module, choose M here: the - module will be called tpqic02. - -config QIC02_DYNCONF - bool "Do you want runtime configuration for QIC-02" - depends on QIC02_TAPE - help - You can either configure this driver once and for all by editing a - header file (<file:include/linux/tpqic02.h>), in which case you - should say N, or you can fetch a program via anonymous FTP which is - able to configure this driver during runtime. The program to do - this is called 'qic02conf' and it is part of the - tpqic02-support-X.Y.tar.gz support package. - - If you want to use the qic02conf program, say Y. - -comment "Edit configuration parameters in ./include/linux/tpqic02.h!" - depends on QIC02_TAPE && !QIC02_DYNCONF - -comment "Setting runtime QIC-02 configuration is done with qic02conf" - depends on QIC02_TAPE && QIC02_DYNCONF - -comment "from the tpqic02-support package. It is available at" - depends on QIC02_TAPE && QIC02_DYNCONF - -comment "metalab.unc.edu or ftp://titus.cfw.com/pub/Linux/util/" - depends on QIC02_TAPE && QIC02_DYNCONF - source "drivers/char/ipmi/Kconfig" source "drivers/char/watchdog/Kconfig" @@ -785,7 +760,7 @@ config GEN_RTC tristate "Generic /dev/rtc emulation" - depends on RTC!=y && !IA64 + depends on RTC!=y && !IA64 && !ARM ---help--- If you say Y here and create a character special file /dev/rtc with major number 10 and minor number 135 using mknod ("man mknod"), you @@ -1013,5 +988,13 @@ out to lunch past a certain margin. It can reboot the system or merely print a warning. +config MMTIMER + tristate "MMTIMER Memory mapped RTC for SGI Altix" + depends on IA64_GENERIC || IA64_SGI_SN2 + default y + help + The mmtimer device allows direct userspace access to the + Altix system timer. + endmenu Index: Makefile =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/Makefile,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Makefile 24 Aug 2004 05:31:53 -0000 1.11 +++ Makefile 22 Oct 2004 07:46:16 -0000 1.12 @@ -7,10 +7,13 @@ # FONTMAPFILE = cp437.uni -obj-y += mem.o random.o tty_io.o n_tty.o tty_ioctl.o pty.o misc.o +obj-y += mem.o random.o tty_io.o n_tty.o tty_ioctl.o -obj-$(CONFIG_VT) += vt_ioctl.o decvte.o vc_screen.o consolemap.o \ - consolemap_deftbl.o selection.o keyboard.o vt_proc.o vt_sysfs.o +obj-$(CONFIG_LEGACY_PTYS) += pty.o +obj-$(CONFIG_UNIX98_PTYS) += pty.o +obj-y += misc.o +obj-$(CONFIG_VT) += vt_ioctl.o vc_screen.o consolemap.o \ + consolemap_deftbl.o selection.o keyboard.o vt_proc.o vt_sysfs.o decvte.o obj-$(CONFIG_HW_CONSOLE) += vt.o defkeymap.o obj-$(CONFIG_MAGIC_SYSRQ) += sysrq.o obj-$(CONFIG_ESPSERIAL) += esp.o @@ -39,8 +42,10 @@ obj-$(CONFIG_AMIGA_BUILTIN_SERIAL) += amiserial.o obj-$(CONFIG_SX) += sx.o generic_serial.o obj-$(CONFIG_RIO) += rio/ generic_serial.o -obj-$(CONFIG_HVC_CONSOLE) += hvc_console.o +obj-$(CONFIG_HVC_CONSOLE) += hvc_console.o hvsi.o obj-$(CONFIG_RAW_DRIVER) += raw.o +obj-$(CONFIG_SGI_SNSC) += snsc.o +obj-$(CONFIG_MMTIMER) += mmtimer.o obj-$(CONFIG_VIOCONS) += viocons.o obj-$(CONFIG_VIOTAPE) += viotape.o obj-$(CONFIG_HVCS) += hvcs.o Index: keyboard.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/keyboard.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- keyboard.c 24 Aug 2004 05:31:53 -0000 1.14 +++ keyboard.c 22 Oct 2004 07:46:16 -0000 1.15 @@ -94,7 +94,7 @@ */ static struct input_handler kbd_handler; -static unsigned long key_down[256/BITS_PER_LONG]; /* keyboard key bitmap */ +static unsigned long key_down[NBITS(KEY_MAX)]; /* keyboard key bitmap */ static unsigned char shift_down[NR_SHIFT]; /* shift state counters.. */ static int dead_key_next; static int npadch = -1; /* -1 or number assembled on pad */ @@ -110,7 +110,7 @@ /* Simple translation table for the SysRq keys */ #ifdef CONFIG_MAGIC_SYSRQ -unsigned char kbd_sysrq_xlate[128] = +unsigned char kbd_sysrq_xlate[KEY_MAX] = "\000\0331234567890-=\177\t" /* 0x00 - 0x0f */ "qwertyuiop[]\r\000as" /* 0x10 - 0x1f */ "dfghjkl;'`\000\\zxcv" /* 0x20 - 0x2f */ @@ -890,6 +890,9 @@ #if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_ALPHA) || defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_SPARC32) || defined(CONFIG_SPARC64) || defined(CONFIG_PARISC) || defined(CONFIG_SUPERH) +#define HW_RAW(dev) (test_bit(EV_MSC, dev->evbit) && test_bit(MSC_RAW, dev->mscbit) &&\ + ((dev)->id.bustype == BUS_I8042) && ((dev)->id.vendor == 0x0001) && ((dev)->id.product == 0x0001)) + static unsigned short x86_keycodes[256] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, @@ -956,6 +959,8 @@ #else +#define HW_RAW(dev) 0 + #warning "Cannot generate rawmode keyboard for your architecture yet." static int emulate_raw(struct vc_data *vc, unsigned int keycode, unsigned char up_flag) @@ -968,7 +973,14 @@ } #endif -void kbd_keycode(struct vt_struct *vt, unsigned int keycode, int down) +void kbd_rawcode(struct vt_struct *vt, unsigned char data) +{ + struct vc_data *vc = vt->fg_console; + if (vc->kbd_table.kbdmode == VC_RAW) + put_queue(vc, data); +} + +void kbd_keycode(struct vt_struct *vt, unsigned int keycode, int down, int hw_raw) { struct vc_data *vc = vt->fg_console; unsigned short keysym, *key_map; @@ -1000,7 +1012,7 @@ return; #endif /* CONFIG_MAC_EMUMOUSEBTN */ - if ((raw_mode = (vc->kbd_table.kbdmode == VC_RAW))) + if ((raw_mode = (vc->kbd_table.kbdmode == VC_RAW)) && !hw_raw) if (emulate_raw(vc, keycode, !down << 7)) if (keycode < BTN_MISC) printk(KERN_WARNING "keyboard.c: can't emulate rawmode for keycode %d\n", keycode); @@ -1066,6 +1078,9 @@ return; } + if (keycode > NR_KEYS) + return; + keysym = key_map[keycode]; type = KTYP(keysym); @@ -1095,13 +1110,16 @@ } static void kbd_event(struct input_handle *handle, unsigned int event_type, - unsigned int keycode, int down) + unsigned int event_code, int value) { struct vt_struct *vt = handle->private; - - if ((event_type != EV_KEY) || !vt) + + if (!vt) return; - kbd_keycode(vt, keycode, down); + if (event_type == EV_MSC && event_code == MSC_RAW && HW_RAW(handle->dev)) + kbd_rawcode(vt, value); + if (event_type == EV_KEY) + kbd_keycode(vt, event_code, value, HW_RAW(handle->dev)); tasklet_schedule(&keyboard_tasklet); do_poke_blanked_console = 1; schedule_work(&vt->vt_work); Index: selection.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/selection.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- selection.c 17 Jun 2004 10:44:52 -0000 1.5 +++ selection.c 22 Oct 2004 07:46:16 -0000 1.6 @@ -26,10 +26,6 @@ #include <linux/selection.h> #include <linux/tiocl.h> -#ifndef MIN -#define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - /* Don't take this from <ctype.h>: 011-015 on the screen aren't spaces */ #define isspace(c) ((c) == ' ') @@ -291,12 +287,15 @@ { struct vc_data *vc = (struct vc_data *) tty->driver_data; int pasted = 0, count; + struct tty_ldisc *ld; DECLARE_WAITQUEUE(wait, current); acquire_console_sem(); poke_blanked_console(vc->display_fg); release_console_sem(); + ld = tty_ldisc_ref_wait(tty); + add_wait_queue(&vc->paste_wait, &wait); while (sel_buffer && sel_buffer_lth > pasted) { set_current_state(TASK_INTERRUPTIBLE); @@ -305,12 +304,14 @@ continue; } count = sel_buffer_lth - pasted; - count = MIN(count, tty->ldisc.receive_room(tty)); + count = min(count, tty->ldisc.receive_room(tty)); tty->ldisc.receive_buf(tty, sel_buffer + pasted, 0, count); pasted += count; } remove_wait_queue(&vc->paste_wait, &wait); set_current_state(TASK_RUNNING); + + tty_ldisc_deref(ld); return 0; } Index: tty_io.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/tty_io.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- tty_io.c 24 Aug 2004 05:31:53 -0000 1.12 +++ tty_io.c 22 Oct 2004 07:46:16 -0000 1.13 @@ -92,6 +92,7 @@ #include <linux/smp_lock.h> #include <linux/device.h> #include <linux/idr.h> +#include <linux/wait.h> #include <asm/uaccess.h> #include <asm/system.h> @@ -120,10 +121,14 @@ EXPORT_SYMBOL(tty_std_termios); [...1273 lines suppressed...] - char name[64]; + if (driver->type == TTY_DRIVER_TYPE_PTY) + pty_line_name(driver, index, name); + else tty_line_name(driver, index, name); - class_simple_device_add(tty_class, dev, device, name); - } + class_simple_device_add(tty_class, dev, device, name); } /** @@ -2452,7 +2935,7 @@ class_simple_device_add(tty_class, MKDEV(TTYAUX_MAJOR, 1), NULL, "console"); #ifdef CONFIG_UNIX98_PTYS - cdev_init(&ptmx_cdev, &tty_fops); + cdev_init(&ptmx_cdev, &ptmx_fops); if (cdev_add(&ptmx_cdev, MKDEV(TTYAUX_MAJOR, 2), 1) || register_chrdev_region(MKDEV(TTYAUX_MAJOR, 2), 1, "/dev/ptmx") < 0) panic("Couldn't register /dev/ptmx driver\n"); Index: vt.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/vt.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- vt.c 24 Aug 2004 05:31:53 -0000 1.21 +++ vt.c 22 Oct 2004 07:46:16 -0000 1.22 @@ -424,7 +424,7 @@ video_erase_char = (build_attr(vc, color, intensity, 0, 0, decscnm) << 8) | ' '; } -static void clear_buffer_attributes(struct vc_data *vc) +void clear_buffer_attributes(struct vc_data *vc) { unsigned short *p = (unsigned short *) origin; int count = screenbuf_size/2; @@ -1775,6 +1775,8 @@ if (current_vc + vc_count - 1 > MAX_NR_CONSOLES) return NULL; + vt->first_vc = current_vc; + vt->vc_count = vc_count; display_desc = vt->vt_sw->con_startup(vt, init); if (!display_desc) return NULL; @@ -1783,8 +1785,6 @@ init_MUTEX(&vt->lock); vt->vt_num = current_vt; vt->display_desc = (char *)display_desc; - vt->first_vc = current_vc; - vt->vc_count = vc_count; list_add_tail(&vt->node, &vt_list); vt->vt_dont_switch = 0; vt->scrollback_delta = 0; Index: vt_ioctl.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/vt_ioctl.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- vt_ioctl.c 24 Aug 2004 05:31:53 -0000 1.9 +++ vt_ioctl.c 22 Oct 2004 07:46:16 -0000 1.10 @@ -615,7 +615,8 @@ hide_cursor(old_vc); if (old_vc != new_vc) { int update; - + int old_was_color = old_vc->vc_can_do_color; + new_vc->display_fg->fg_console = new_vc; save_screen(old_vc); set_origin(old_vc); @@ -623,7 +624,17 @@ set_origin(new_vc); update = new_vc->display_fg->vt_sw->con_switch(new_vc); set_palette(new_vc); - if (update && new_vc->vc_mode != KD_GRAPHICS) + /* + * If console changed from mono<->color, the best we can do + * is to clear the buffer attributes. As it currently stands, + * rebuilding new attributes from the old buffer is not doable + * without overly complex code. + */ + if (old_was_color != new_vc->vc_can_do_color) { + update_attr(new_vc); + clear_buffer_attributes(new_vc); + } + if (update && new_vc->vc_mode != KD_GRAPHICS) do_update_region(new_vc, new_vc->vc_origin, new_vc->vc_screenbuf_size/2); } @@ -942,8 +953,7 @@ default: return -EINVAL; } - if (tty->ldisc.flush_buffer) - tty->ldisc.flush_buffer(tty); + tty_ldisc_flush(tty); return 0; case KDGKBMODE: |