From: Aivils S. <ai...@us...> - 2004-04-23 07:37:08
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8321/ruby-2.6/drivers/char Modified Files: Kconfig Makefile tty_io.c vt.c Log Message: sync to 2.6.5 Index: Kconfig =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/Kconfig,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Kconfig 20 Feb 2004 06:52:18 -0000 1.6 +++ Kconfig 23 Apr 2004 07:36:55 -0000 1.7 @@ -452,7 +452,8 @@ source "drivers/serial/Kconfig" config UNIX98_PTYS - bool "Unix98 PTY support" + bool "Unix98 PTY support" if EMBEDDED + default y ---help--- A pseudo terminal (PTY) is a software device consisting of two halves: a master and a slave. The slave device behaves identical to @@ -470,28 +471,38 @@ terminal slave can be accessed as /dev/pts/<number>. What was traditionally /dev/ttyp2 will then be /dev/pts/2, for example. - The entries in /dev/pts/ are created on the fly by a virtual - file system; therefore, if you say Y here you should say Y to - "/dev/pts file system for Unix98 PTYs" as well. + All modern Linux systems use the Unix98 ptys. Say Y unless + you're on an embedded system and want to conserve memory. - If you want to say Y here, you need to have the C library glibc 2.1 - or later (equal to libc-6.1, check with "ls -l /lib/libc.so.*"). - Read the instructions in <file:Documentation/Changes> pertaining to - pseudo terminals. It's safe to say N. +config LEGACY_PTYS + bool "Legacy (BSD) PTY support" + default y + ---help--- + A pseudo terminal (PTY) is a software device consisting of two + halves: a master and a slave. The slave device behaves identical to + a physical terminal; the master device is used by a process to + read data from and write data to the slave, thereby emulating a + terminal. Typical programs for the master side are telnet servers + and xterms. -config UNIX98_PTY_COUNT - int "Maximum number of Unix98 PTYs in use (0-2048)" - depends on UNIX98_PTYS + Linux has traditionally used the BSD-like names /dev/ptyxx + for masters and /dev/ttyxx for slaves of pseudo + terminals. This scheme has a number of problems, including + security. This option enables these legacy devices; on most + systems, it is safe to say N. + + +config LEGACY_PTY_COUNT + int "Maximum number of legacy PTY in use" + depends on LEGACY_PTYS default "256" - help - The maximum number of Unix98 PTYs that can be used at any one time. - The default is 256, and should be enough for desktop systems. Server - machines which support incoming telnet/rlogin/ssh connections and/or - serve several X terminals may want to increase this: every incoming - connection and every xterm uses up one PTY. + ---help--- + The maximum number of legacy PTYs that can be used at any one time. + The default is 256, and should be more than enough. Embedded + systems may want to reduce this to save memory. - When not in use, each additional set of 256 PTYs occupy - approximately 8 KB of kernel memory on 32-bit architectures. + When not in use, each legacy PTY occupies 12 bytes on 32-bit + architectures and 24 bytes on 64-bit architectures. config PRINTER tristate "Parallel printer support" @@ -595,30 +606,6 @@ bool "Support for console on line printer" depends on PC9800_OLDLP - -menu "Mice" - -config BUSMOUSE - tristate "Bus Mouse Support" - ---help--- - Say Y here if your machine has a bus mouse as opposed to a serial - mouse. Most people have a regular serial MouseSystem or - Microsoft mouse (made by Logitech) that plugs into a COM port - (rectangular with 9 or 25 pins). These people say N here. - - If you have a laptop, you either have to check the documentation or - experiment a bit to find out whether the trackball is a serial mouse - or not; it's best to say Y here for you. - - This is the generic bus mouse driver code. If you have a bus mouse, - you will have to say Y here and also to the specific driver for your - mouse below. - - To compile this driver as a module, choose M here: the - module will be called busmouse. - -endmenu - config QIC02_TAPE tristate "QIC-02 tape support" help @@ -736,6 +723,7 @@ config NVRAM tristate "/dev/nvram support" + depends on ATARI || X86 || X86_64 || ARM || GENERIC_NVRAM ---help--- If you say Y here and create a character special file /dev/nvram with major number 10 and minor number 144 using mknod ("man mknod"), @@ -761,7 +749,7 @@ config RTC tristate "Enhanced Real Time Clock Support" - depends on !PPC32 && !PARISC && !IA64 && !X86_PC9800 + depends on !PPC32 && !PARISC && !IA64 && !X86_PC9800 && !M68K ---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 @@ -801,8 +789,7 @@ precision in some cases. To compile this driver as a module, choose M here: the - module will be called genrtc. To load the module automatically - add 'alias char-major-10-135 genrtc' to your /etc/modules.conf + module will be called genrtc. config GEN_RTC_X bool "Extended RTC operation" Index: Makefile =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/Makefile,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Makefile 20 Feb 2004 06:52:18 -0000 1.8 +++ Makefile 23 Apr 2004 07:36:55 -0000 1.9 @@ -44,12 +44,12 @@ obj-$(CONFIG_RAW_DRIVER) += raw.o obj-$(CONFIG_SGI_L1_SERIAL) += sn_serial.o obj-$(CONFIG_VIOCONS) += viocons.o +obj-$(CONFIG_VIOTAPE) += viotape.o obj-$(CONFIG_PRINTER) += lp.o obj-$(CONFIG_TIPAR) += tipar.o obj-$(CONFIG_PC9800_OLDLP) += lp_old98.o -obj-$(CONFIG_BUSMOUSE) += busmouse.o obj-$(CONFIG_DTLK) += dtlk.o obj-$(CONFIG_R3964) += n_r3964.o obj-$(CONFIG_APPLICOM) += applicom.o Index: tty_io.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/tty_io.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- tty_io.c 20 Feb 2004 06:52:18 -0000 1.8 +++ tty_io.c 23 Apr 2004 07:36:55 -0000 1.9 @@ -121,7 +121,7 @@ #ifdef CONFIG_UNIX98_PTYS extern struct tty_driver *ptm_driver; /* Unix98 pty masters; for /dev/ptmx */ -extern struct tty_driver *pts_driver; /* Unix98 pty slaves; for /dev/ptmx */ +extern int pty_limit; /* Config limit on Unix98 ptys */ #endif extern void disable_early_printk(void); @@ -478,12 +478,15 @@ if (tty->session > 0) { struct list_head *l; for_each_task_pid(tty->session, PIDTYPE_SID, p, l, pid) { - if (p->tty == tty) - p->tty = NULL; - if (!p->leader) - continue; - send_group_sig_info(SIGHUP, SEND_SIG_PRIV, p); - send_group_sig_info(SIGCONT, SEND_SIG_PRIV, p); + task_t *task = p; + do { + if (task->tty == tty) + task->tty = NULL; + if (task->leader) { + send_group_sig_info(SIGHUP, SEND_SIG_PRIV, task); + send_group_sig_info(SIGCONT, SEND_SIG_PRIV, task); + } + } while_each_thread(p, task); if (tty->pgrp > 0) p->tty_old_pgrp = tty->pgrp; } @@ -588,8 +591,12 @@ tty->pgrp = -1; read_lock(&tasklist_lock); - for_each_task_pid(current->session, PIDTYPE_SID, p, l, pid) - p->tty = NULL; + for_each_task_pid(current->session, PIDTYPE_SID, p, l, pid) { + task_t *task = p; + do { + task->tty = NULL; + } while_each_thread(p, task); + } read_unlock(&tasklist_lock); unlock_kernel(); } @@ -796,7 +803,13 @@ down_tty_sem(idx); /* check whether we're reopening an existing tty */ - tty = driver->ttys[idx]; + if (driver->flags & TTY_DRIVER_DEVPTS_MEM) { + tty = devpts_get_tty(idx); + if (tty && driver->subtype == PTY_TYPE_MASTER) + tty = tty->link; + } else { + tty = driver->ttys[idx]; + } if (tty) goto fast_track; /* @@ -824,7 +837,14 @@ tty->index = idx; tty_line_name(driver, idx, tty->name); - tp_loc = &driver->termios[idx]; + if (driver->flags & TTY_DRIVER_DEVPTS_MEM) { + tp_loc = &tty->termios; + ltp_loc = &tty->termios_locked; + } else { + tp_loc = &driver->termios[idx]; + ltp_loc = &driver->termios_locked[idx]; + } + if (!*tp_loc) { tp = (struct termios *) kmalloc(sizeof(struct termios), GFP_KERNEL); @@ -833,7 +853,6 @@ *tp = driver->init_termios; } - ltp_loc = &driver->termios_locked[idx]; if (!*ltp_loc) { ltp = (struct termios *) kmalloc(sizeof(struct termios), GFP_KERNEL); @@ -851,7 +870,14 @@ o_tty->index = idx; tty_line_name(driver->other, idx, o_tty->name); - o_tp_loc = &driver->other->termios[idx]; + if (driver->flags & TTY_DRIVER_DEVPTS_MEM) { + o_tp_loc = &o_tty->termios; + o_ltp_loc = &o_tty->termios_locked; + } else { + o_tp_loc = &driver->other->termios[idx]; + o_ltp_loc = &driver->other->termios_locked[idx]; + } + if (!*o_tp_loc) { o_tp = (struct termios *) kmalloc(sizeof(struct termios), GFP_KERNEL); @@ -860,7 +886,6 @@ *o_tp = driver->other->init_termios; } - o_ltp_loc = &driver->other->termios_locked[idx]; if (!*o_ltp_loc) { o_ltp = (struct termios *) kmalloc(sizeof(struct termios), GFP_KERNEL); @@ -872,7 +897,9 @@ /* * Everything allocated ... set up the o_tty structure. */ - driver->other->ttys[idx] = o_tty; + if (!(driver->other->flags & TTY_DRIVER_DEVPTS_MEM)) { + driver->other->ttys[idx] = o_tty; + } if (!*o_tp_loc) *o_tp_loc = o_tp; if (!*o_ltp_loc) @@ -893,7 +920,9 @@ * Failures after this point use release_mem to clean up, so * there's no need to null out the local pointers. */ - driver->ttys[idx] = tty; + if (!(driver->flags & TTY_DRIVER_DEVPTS_MEM)) { + driver->ttys[idx] = tty; + } if (!*tp_loc) *tp_loc = tp; @@ -991,12 +1020,20 @@ { struct tty_struct *o_tty; struct termios *tp; + int devpts = tty->driver->flags & TTY_DRIVER_DEVPTS_MEM; if ((o_tty = tty->link) != NULL) { - o_tty->driver->ttys[idx] = NULL; + if (!devpts) + o_tty->driver->ttys[idx] = NULL; if (o_tty->driver->flags & TTY_DRIVER_RESET_TERMIOS) { - tp = o_tty->driver->termios[idx]; - o_tty->driver->termios[idx] = NULL; + tp = o_tty->termios; + if (!devpts) + o_tty->driver->termios[idx] = NULL; + kfree(tp); + + tp = o_tty->termios_locked; + if (!devpts) + o_tty->driver->termios_locked[idx] = NULL; kfree(tp); } o_tty->magic = 0; @@ -1007,12 +1044,20 @@ free_tty_struct(o_tty); } - tty->driver->ttys[idx] = NULL; + if (!devpts) + tty->driver->ttys[idx] = NULL; if (tty->driver->flags & TTY_DRIVER_RESET_TERMIOS) { - tp = tty->driver->termios[idx]; - tty->driver->termios[idx] = NULL; + tp = tty->termios; + if (!devpts) + tty->driver->termios[idx] = NULL; + kfree(tp); + + tp = tty->termios_locked; + if (!devpts) + tty->driver->termios_locked[idx] = NULL; kfree(tp); } + tty->magic = 0; tty->driver->refcount--; file_list_lock(); @@ -1056,22 +1101,24 @@ "free (%s)\n", tty->name); return; } - if (tty != tty->driver->ttys[idx]) { - printk(KERN_DEBUG "release_dev: driver.table[%d] not tty " - "for (%s)\n", idx, tty->name); - return; - } - if (tty->termios != tty->driver->termios[idx]) { - printk(KERN_DEBUG "release_dev: driver.termios[%d] not termios " - "for (%s)\n", - idx, tty->name); - return; - } - if (tty->termios_locked != tty->driver->termios_locked[idx]) { - printk(KERN_DEBUG "release_dev: driver.termios_locked[%d] not " - "termios_locked for (%s)\n", - idx, tty->name); - return; + if (!(tty->driver->flags & TTY_DRIVER_DEVPTS_MEM)) { + if (tty != tty->driver->ttys[idx]) { + printk(KERN_DEBUG "release_dev: driver.table[%d] not tty " + "for (%s)\n", idx, tty->name); + return; + } + if (tty->termios != tty->driver->termios[idx]) { + printk(KERN_DEBUG "release_dev: driver.termios[%d] not termios " + "for (%s)\n", + idx, tty->name); + return; + } + if (tty->termios_locked != tty->driver->termios_locked[idx]) { + printk(KERN_DEBUG "release_dev: driver.termios_locked[%d] not " + "termios_locked for (%s)\n", + idx, tty->name); + return; + } } #endif @@ -1081,7 +1128,8 @@ #endif #ifdef TTY_PARANOIA_CHECK - if (tty->driver->other) { + if (tty->driver->other && + !(tty->driver->flags & TTY_DRIVER_DEVPTS_MEM)) { if (o_tty != tty->driver->other->ttys[idx]) { printk(KERN_DEBUG "release_dev: other->table[%d] " "not o_tty for (%s)\n", @@ -1216,11 +1264,20 @@ struct pid *pid; read_lock(&tasklist_lock); - for_each_task_pid(tty->session, PIDTYPE_SID, p, l, pid) - p->tty = NULL; - if (o_tty) - for_each_task_pid(o_tty->session, PIDTYPE_SID, p,l, pid) - p->tty = NULL; + for_each_task_pid(tty->session, PIDTYPE_SID, p, l, pid) { + task_t *task = p; + do { + task->tty = NULL; + } while_each_thread(p, task); + } + if (o_tty) { + for_each_task_pid(o_tty->session, PIDTYPE_SID, p,l, pid) { + task_t *task = p; + do { + task->tty = NULL; + } while_each_thread(p, task); + } + } read_unlock(&tasklist_lock); } @@ -1334,23 +1391,29 @@ return -ENODEV; } - if (device == MKDEV(TTYAUX_MAJOR,2)) { #ifdef CONFIG_UNIX98_PTYS + if (device == MKDEV(TTYAUX_MAJOR,2)) { /* find a device that is not in use. */ + static int next_ptmx_dev = 0; retval = -1; driver = ptm_driver; - for (index = 0; index < driver->num ; index++) + while (driver->refcount < pty_limit) { + index = next_ptmx_dev; + next_ptmx_dev = (next_ptmx_dev+1) % driver->num; if (!init_dev(driver, index, &tty)) goto ptmx_found; /* ok! */ + } return -EIO; /* no free ptys */ ptmx_found: set_bit(TTY_PTY_LOCK, &tty->flags); /* LOCK THE SLAVE */ - devpts_pty_new(index, MKDEV(pts_driver->major, pts_driver->minor_start) + index); + if (devpts_pty_new(tty->link)) { + /* BADNESS - need to destroy both ptm and pts! */ + return -ENOMEM; + } noctty = 1; -#else - return -ENODEV; -#endif /* CONFIG_UNIX_98_PTYS */ - } else { + } else +#endif + { driver = get_tty_driver(device, &index); if (!driver) return -ENODEV; @@ -1576,8 +1639,12 @@ */ read_lock(&tasklist_lock); - for_each_task_pid(tty->session, PIDTYPE_SID, p, l, pid) - p->tty = NULL; + for_each_task_pid(tty->session, PIDTYPE_SID, p, l, pid) { + task_t *task = p; + do { + task->tty = NULL; + } while_each_thread(p, task); + } read_unlock(&tasklist_lock); } else return -EPERM; @@ -2136,8 +2203,6 @@ EXPORT_SYMBOL(tty_register_device); EXPORT_SYMBOL(tty_unregister_device); -static struct kobject tty_kobj = {.name = "tty"}; - struct tty_driver *alloc_tty_driver(int lines) { struct tty_driver *driver; @@ -2197,16 +2262,17 @@ int error; int i; dev_t dev; - char *s; - void **p; + void **p = NULL; if (driver->flags & TTY_DRIVER_INSTALLED) return 0; - p = kmalloc(driver->num * 3 * sizeof(void *), GFP_KERNEL); - if (!p) - return -ENOMEM; - memset(p, 0, driver->num * 3 * sizeof(void *)); + if (!(driver->flags & TTY_DRIVER_DEVPTS_MEM)) { + p = kmalloc(driver->num * 3 * sizeof(void *), GFP_KERNEL); + if (!p) + return -ENOMEM; + memset(p, 0, driver->num * 3 * sizeof(void *)); + } if (!driver->major) { error = alloc_chrdev_region(&dev, driver->minor_start, driver->num, @@ -2225,19 +2291,21 @@ return error; } - driver->ttys = (struct tty_struct **)p; - driver->termios = (struct termios **)(p + driver->num); - driver->termios_locked = (struct termios **)(p + driver->num * 2); + if (p) { + driver->ttys = (struct tty_struct **)p; + driver->termios = (struct termios **)(p + driver->num); + driver->termios_locked = (struct termios **)(p + driver->num * 2); + } else { + driver->ttys = NULL; + driver->termios = NULL; + driver->termios_locked = NULL; + } - driver->cdev.kobj.parent = &tty_kobj; - strcpy(driver->cdev.kobj.name, driver->name); - for (s = strchr(driver->cdev.kobj.name, '/'); s; s = strchr(s, '/')) - *s = '!'; cdev_init(&driver->cdev, &tty_fops); driver->cdev.owner = driver->owner; error = cdev_add(&driver->cdev, dev, driver->num); if (error) { - kobject_del(&driver->cdev.kobj); + cdev_del(&driver->cdev); unregister_chrdev_region(dev, driver->num); driver->ttys = NULL; driver->termios = driver->termios_locked = NULL; @@ -2353,7 +2421,9 @@ } postcore_initcall(tty_class_init); - + +/* 3/2004 jmc: why do these devices exist? */ + static struct cdev tty_cdev, console_cdev; #ifdef CONFIG_UNIX98_PTYS static struct cdev ptmx_cdev; @@ -2368,7 +2438,6 @@ */ static int __init tty_init(void) { - strcpy(tty_cdev.kobj.name, "dev.tty"); cdev_init(&tty_cdev, &tty_fops); if (cdev_add(&tty_cdev, MKDEV(TTYAUX_MAJOR, 0), 1) || register_chrdev_region(MKDEV(TTYAUX_MAJOR, 0), 1, "/dev/tty") < 0) @@ -2376,7 +2445,6 @@ devfs_mk_cdev(MKDEV(TTYAUX_MAJOR, 0), S_IFCHR|S_IRUGO|S_IWUGO, "tty"); class_simple_device_add(tty_class, MKDEV(TTYAUX_MAJOR, 0), NULL, "tty"); - strcpy(console_cdev.kobj.name, "dev.console"); cdev_init(&console_cdev, &console_fops); if (cdev_add(&console_cdev, MKDEV(TTYAUX_MAJOR, 1), 1) || register_chrdev_region(MKDEV(TTYAUX_MAJOR, 1), 1, "/dev/console") < 0) @@ -2384,11 +2452,7 @@ devfs_mk_cdev(MKDEV(TTYAUX_MAJOR, 1), S_IFCHR|S_IRUSR|S_IWUSR, "console"); class_simple_device_add(tty_class, MKDEV(TTYAUX_MAJOR, 1), NULL, "console"); - tty_kobj.kset = tty_cdev.kobj.kset; - kobject_register(&tty_kobj); - #ifdef CONFIG_UNIX98_PTYS - strcpy(ptmx_cdev.kobj.name, "dev.ptmx"); cdev_init(&ptmx_cdev, &tty_fops); if (cdev_add(&ptmx_cdev, MKDEV(TTYAUX_MAJOR, 2), 1) || register_chrdev_region(MKDEV(TTYAUX_MAJOR, 2), 1, "/dev/ptmx") < 0) @@ -2396,9 +2460,8 @@ devfs_mk_cdev(MKDEV(TTYAUX_MAJOR, 2), S_IFCHR|S_IRUGO|S_IWUGO, "ptmx"); class_simple_device_add(tty_class, MKDEV(TTYAUX_MAJOR, 2), NULL, "ptmx"); #endif - + #ifdef CONFIG_VT - strcpy(vc0_cdev.kobj.name, "dev.vc0"); cdev_init(&vc0_cdev, &console_fops); if (cdev_add(&vc0_cdev, MKDEV(TTY_MAJOR, 0), 1) || register_chrdev_region(MKDEV(TTY_MAJOR, 0), 1, "/dev/vc/0") < 0) Index: vt.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/vt.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- vt.c 20 Feb 2004 06:52:18 -0000 1.17 +++ vt.c 23 Apr 2004 07:36:55 -0000 1.18 @@ -715,11 +715,11 @@ switch (vc->display_fg->blank_mode) { case VESA_NO_BLANKING: - sw->con_blank(vc, VESA_VSYNC_SUSPEND+1); + sw->con_blank(vc, VESA_VSYNC_SUSPEND+1, 0); break; case VESA_VSYNC_SUSPEND: case VESA_HSYNC_SUSPEND: - sw->con_blank(vc, VESA_POWERDOWN+1); + sw->con_blank(vc, VESA_POWERDOWN+1, 0); break; } } @@ -746,7 +746,7 @@ if (entering_gfx) { hide_cursor(vc); save_screen(vc); - sw->con_blank(vc, -1); + sw->con_blank(vc, -1, 1); vc->display_fg->vt_blanked = 1; set_origin(vc); return; @@ -764,7 +764,7 @@ save_screen(vc); /* In case we need to reset origin, blanking hook returns 1 */ - i = sw->con_blank(vc, 1); + i = sw->con_blank(vc, 1, 0); vc->display_fg->vt_blanked = 1; if (i) set_origin(vc); @@ -776,7 +776,7 @@ mod_timer(&vc->display_fg->timer, jiffies + vc->display_fg->off_interval); } if (vc->display_fg->blank_mode) - sw->con_blank(vc, vc->display_fg->blank_mode + 1); + sw->con_blank(vc, vc->display_fg->blank_mode + 1, 0); } /* @@ -816,7 +816,7 @@ } vc->display_fg->vt_blanked = 0; - if (sw->con_blank(vc, 0)) + if (sw->con_blank(vc, 0, 1)) /* Low-level driver cannot restore -> do it ourselves */ update_screen(vc); if (console_blank_hook) @@ -1229,6 +1229,8 @@ if (in_interrupt()) return count; + might_sleep(); + if (!vc) { printk("vt_write: tty %d not allocated\n", tty->index); return 0; @@ -1436,15 +1438,20 @@ static void vt_close(struct tty_struct *tty, struct file * filp) { struct vc_data *vc; + acquire_console_sem(); - if (!tty || tty->count != 1) - return; + if (!tty || tty->count != 1) { + release_console_sem(); + return; + } + vc = (struct vc_data *)tty->driver_data; if (vc) { vcs_remove_devfs(tty); vc->vc_tty = NULL; } tty->driver_data = NULL; + release_console_sem(); } static int vt_write(struct tty_struct * tty, int from_user, @@ -1721,7 +1728,7 @@ if (get_user(data, (char *) arg + 1)) return -EFAULT; vc->display_fg->blank_mode = (data < 4) ? data : 0; - break;; + break; case TIOCL_SETKMSGREDIRECT: if (!capable(CAP_SYS_ADMIN)) { ret = -EPERM; @@ -1789,8 +1796,7 @@ vt->timer.function = blank_screen_t; mod_timer(&vt->timer, jiffies + vt->blank_interval); if (vt->pm_con) - vt->pm_con->data = vt; - vt->vc_cons[0] = vc_allocate(current_vc); + vt->pm_con->data = vt; vt->keyboard = NULL; INIT_WORK(&vt->vt_work, vt_callback, vt); @@ -1800,10 +1806,13 @@ register_console(&vt_console_driver); printable = 1; #endif - } + } + acquire_console_sem(); + vt->vc_cons[0] = vc_allocate(current_vc); gotoxy(vt->fg_console, vt->fg_console->vc_x, vt->fg_console->vc_y); vte_ed(vt->fg_console, 0); update_screen(vt->fg_console); + release_console_sem(); current_vc += vc_count; current_vt += 1; if (vt->vt_kmalloced) { |