From: Steven Smith Subject: Re: [PATCH] Paravirt framebuffer use xvc as console [4/5] Date: Mon, 4 Sep 2006 10:01:11 +0100 Message-ID: <20060904090111.GB4812@cam.ac.uk> References: <1157227130.11059.44.camel@aglarond.local> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0349967721==" Return-path: In-Reply-To: <1157227130.11059.44.camel@aglarond.local> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jeremy Katz Cc: xen-devel , Markus Armbruster , sos22@srcf.ucam.org, Amos Waterland List-Id: xen-devel@lists.xenproject.org --===============0349967721== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/NkBOFFp2J2Af1nK" Content-Disposition: inline --/NkBOFFp2J2Af1nK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > This is the patch from Amos Waterland for the xenconsole to > use /dev/xvc0 instead of taking over ttys. I've fixed a few places > which needed to check for XVC mode in addition to serial mode. Also, > until LANANA responds with an official minor, I've adjusted it to use > char 250/187 (in the experimental range) as opposed to 204/187. >=20 > (Should be identical to this patch from last time) Does this have anything to do with the virtual framebuffer work, or does it stand alone? > diff -r 2b360c6b44fa -r c859588adc5e linux-2.6-xen-sparse/drivers/xen/con= sole/console.c > --- a/linux-2.6-xen-sparse/drivers/xen/console/console.c Sat Sep 02 15:23= :32 2006 -0400 > +++ b/linux-2.6-xen-sparse/drivers/xen/console/console.c Sat Sep 02 15:31= :29 2006 -0400 > @@ -57,19 +57,27 @@ > #include > #include > #include > +#include > =20 > /* > * Modes: > * 'xencons=3Doff' [XC_OFF]: Console is disabled. > * 'xencons=3Dtty' [XC_TTY]: Console attached to '/dev/tty[0-9]+'. > * 'xencons=3DttyS' [XC_SERIAL]: Console attached to '/dev/ttyS[0-9]+'. > + * 'xencons=3Dxvc' [XC_XVC]: Console attached to '/dev/xvc[0-9]+'. > * [XC_DEFAULT]: DOM0 -> XC_SERIAL ; all others -> XC_TT= Y. > *=20 > * NB. In mode XC_TTY, we create dummy consoles for tty2-63. This suppre= sses > * warnings from standard distro startup scripts. > */ > -static enum { XC_OFF, XC_DEFAULT, XC_TTY, XC_SERIAL } xc_mode =3D XC_DEF= AULT; > +static enum { XC_OFF, XC_DEFAULT, XC_TTY, XC_SERIAL, XC_XVC }=20 > + xc_mode =3D XC_DEFAULT; > static int xc_num =3D -1; > + > +/* If we are in XC_XVC mode (a virtual console at /dev/xvcX), we need to > + * comply with Lanana and use a minor under the low density serial major. > + */ > +#define XEN_XVC_MINOR 187 > =20 > #ifdef CONFIG_MAGIC_SYSRQ > static unsigned long sysrq_requested; > @@ -85,6 +93,8 @@ static int __init xencons_setup(char *st > xc_mode =3D XC_SERIAL; > else if (!strncmp(str, "tty", 3)) > xc_mode =3D XC_TTY; > + else if (!strncmp(str, "xvc", 3)) > + xc_mode =3D XC_XVC; > else if (!strncmp(str, "off", 3)) > xc_mode =3D XC_OFF; > =20 > @@ -95,6 +105,11 @@ static int __init xencons_setup(char *st > xc_num =3D n; > break; > case XC_TTY: > + n =3D simple_strtol(str+3, &q, 10); > + if (q > (str + 3)) > + xc_num =3D n; > + break; > + case XC_XVC: There's some code duplication here. > n =3D simple_strtol(str+3, &q, 10); > if (q > (str + 3)) > xc_num =3D n; > @@ -194,11 +209,17 @@ static int __init xen_console_init(void) > kcons_info.write =3D kcons_write_dom0; > } else { > if (xc_mode =3D=3D XC_DEFAULT) > - xc_mode =3D XC_TTY; > + xc_mode =3D XC_XVC; Not convinced we want to change the default until a little while after the rest of the patch gets merged. > kcons_info.write =3D kcons_write; > } > =20 > switch (xc_mode) { > + case XC_XVC: > + strcpy(kcons_info.name, "xvc"); > + if (xc_num =3D=3D -1) > + xc_num =3D 0; > + break; > + > case XC_SERIAL: > strcpy(kcons_info.name, "ttyS"); > if (xc_num =3D=3D -1) > @@ -265,7 +286,7 @@ void xencons_force_flush(void) > /******************** User-space console driver (/dev/console) *********= ***/ > =20 > #define DRV(_d) (_d) > -#define DUMMY_TTY(_tty) ((xc_mode !=3D XC_SERIAL) && \ > +#define DUMMY_TTY(_tty) ((xc_mode !=3D XC_SERIAL) && (xc_mode !=3D XC_XV= C) && \ > ((_tty)->index !=3D (xc_num - 1))) > =20 > static struct termios *xencons_termios[MAX_NR_CONSOLES]; > @@ -584,7 +605,8 @@ static int __init xencons_init(void) > =20 > xencons_ring_init(); > =20 > - xencons_driver =3D alloc_tty_driver((xc_mode =3D=3D XC_SERIAL) ? > + xencons_driver =3D alloc_tty_driver(((xc_mode =3D=3D XC_SERIAL) ||=20 > + (xc_mode =3D=3D XC_XVC)) ? > 1 : MAX_NR_CONSOLES); > if (xencons_driver =3D=3D NULL) > return -ENOMEM; > @@ -604,6 +626,11 @@ static int __init xencons_init(void) > DRV(xencons_driver)->name =3D "ttyS"; > DRV(xencons_driver)->minor_start =3D 64 + xc_num; > DRV(xencons_driver)->name_base =3D 0 + xc_num; > + } else if (xc_mode =3D=3D XC_XVC) { > + DRV(xencons_driver)->name =3D "xvc"; > + DRV(xencons_driver)->major =3D 250; > + DRV(xencons_driver)->minor_start =3D XEN_XVC_MINOR; > + DRV(xencons_driver)->name_base =3D xc_num; > } else { > DRV(xencons_driver)->name =3D "tty"; > DRV(xencons_driver)->minor_start =3D 1; Steven. --/NkBOFFp2J2Af1nK Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQFE++tXO4S8/gLNrjcRAv1jAKCM6I0XRDZ8k6eFl1qSCaF/uHia5ACfWRlQ v3l5CF/yxFIJbWjrk6vVTwg= =uJbo -----END PGP SIGNATURE----- --/NkBOFFp2J2Af1nK-- --===============0349967721== 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 --===============0349967721==--