From: Mark McLoughlin Subject: [PATCH] xenconsole: fix xencons=tty[0-9]+ param Date: Fri, 30 Jun 2006 17:56:48 +0100 Message-ID: <1151686608.6184.67.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-zjdhMBDjRRUVf1Jce2zm" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --=-zjdhMBDjRRUVf1Jce2zm Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi, If you boot with e.g. xencons=tty3, then tty1/tty2 aren't valid devices. Attached patch makes it always create valid devices on tty1-tty63, but all but the one specified by xencons are dummy devices. Cheers, Mark. --=-zjdhMBDjRRUVf1Jce2zm Content-Disposition: attachment; filename=xenconsole.patch Content-Type: text/x-patch; name=xenconsole.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit --- ./drivers/xen/console/console.c.markmc 2006-06-28 13:11:58.000000000 +0100 +++ ./drivers/xen/console/console.c 2006-06-28 13:48:28.000000000 +0100 @@ -391,7 +391,7 @@ { unsigned long flags; - if (TTY_INDEX(tty) != 0) + if (TTY_INDEX(tty) != (xc_num - DRV(tty->driver)->minor_start)) return; spin_lock_irqsave(&xencons_lock, flags); @@ -402,7 +402,7 @@ static void xencons_throttle(struct tty_struct *tty) { - if (TTY_INDEX(tty) != 0) + if (TTY_INDEX(tty) != (xc_num - DRV(tty->driver)->minor_start)) return; if (I_IXOFF(tty)) @@ -411,7 +411,7 @@ static void xencons_unthrottle(struct tty_struct *tty) { - if (TTY_INDEX(tty) != 0) + if (TTY_INDEX(tty) != (xc_num - DRV(tty->driver)->minor_start)) return; if (I_IXOFF(tty)) { @@ -426,7 +426,7 @@ { unsigned long flags; - if (TTY_INDEX(tty) != 0) + if (TTY_INDEX(tty) != (xc_num - DRV(tty->driver)->minor_start)) return; spin_lock_irqsave(&xencons_lock, flags); @@ -451,7 +451,7 @@ int i; unsigned long flags; - if (TTY_INDEX(tty) != 0) + if (TTY_INDEX(tty) != (xc_num - DRV(tty->driver)->minor_start)) return count; spin_lock_irqsave(&xencons_lock, flags); @@ -472,7 +472,7 @@ { unsigned long flags; - if (TTY_INDEX(tty) != 0) + if (TTY_INDEX(tty) != (xc_num - DRV(tty->driver)->minor_start)) return; spin_lock_irqsave(&xencons_lock, flags); @@ -484,7 +484,7 @@ { unsigned long flags; - if (TTY_INDEX(tty) != 0) + if (TTY_INDEX(tty) != (xc_num - DRV(tty->driver)->minor_start)) return; spin_lock_irqsave(&xencons_lock, flags); @@ -496,7 +496,7 @@ { unsigned long orig_jiffies = jiffies; - if (TTY_INDEX(tty) != 0) + if (TTY_INDEX(tty) != (xc_num - DRV(tty->driver)->minor_start)) return; while (DRV(tty->driver)->chars_in_buffer(tty)) { @@ -515,7 +515,7 @@ { unsigned long flags; - if (TTY_INDEX(tty) != 0) + if (TTY_INDEX(tty) != (xc_num - DRV(tty->driver)->minor_start)) return 0; spin_lock_irqsave(&xencons_lock, flags); @@ -532,7 +532,7 @@ { unsigned long flags; - if (TTY_INDEX(tty) != 0) + if (TTY_INDEX(tty) != (xc_num - DRV(tty->driver)->minor_start)) return; if (tty->count == 1) { @@ -595,12 +595,12 @@ if (xc_mode == XC_SERIAL) { DRV(xencons_driver)->name = "ttyS"; - DRV(xencons_driver)->minor_start = 64 + xc_num; - DRV(xencons_driver)->name_base = 0 + xc_num; + DRV(xencons_driver)->minor_start = 64; + DRV(xencons_driver)->name_base = 0; } else { DRV(xencons_driver)->name = "tty"; - DRV(xencons_driver)->minor_start = xc_num; - DRV(xencons_driver)->name_base = xc_num; + DRV(xencons_driver)->minor_start = 1; + DRV(xencons_driver)->name_base = 1; } tty_set_operations(xencons_driver, &xencons_ops); --=-zjdhMBDjRRUVf1Jce2zm Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-zjdhMBDjRRUVf1Jce2zm--