]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/suse-2.6.27.25/patches.xen/762-xencons-hvc.patch
Updated xen patches taken from suse.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.xen / 762-xencons-hvc.patch
1 From: http://xenbits.xensource.com/linux-2.6.18-xen.hg?rev/a070228ac76e
2 # HG changeset 762 patch
3 # User Ian Campbell <ian.campbell@citrix.com>
4 # Date 1229002728 0
5 # Node ID a070228ac76e3f6cd2483e0cad03f1cccae7a0c8
6 # Parent 5e1269aa5c2933e0cb0272bf5867e1214174bfde
7 Subject: add hvc compatibility mode to xencons
8 Patch-mainline: obsolete
9
10 Makes switching back and forth with a pvops kernel easier. Taken from
11 http://lists.alioth.debian.org/pipermail/pkg-xen-devel/2008-October/002098.html
12 http://svn.debian.org/viewsvn/kernel?rev=12337&view=rev with thanks to
13 Bastian Blank.
14
15 Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
16 Acked-by: jbeulich@novell.com
17
18 --- head-2008-12-15.orig/drivers/xen/console/console.c 2008-12-15 11:13:20.000000000 +0100
19 +++ head-2008-12-15/drivers/xen/console/console.c 2008-12-15 11:13:47.000000000 +0100
20 @@ -66,13 +66,14 @@
21 * 'xencons=tty' [XC_TTY]: Console attached to '/dev/tty[0-9]+'.
22 * 'xencons=ttyS' [XC_SERIAL]: Console attached to '/dev/ttyS[0-9]+'.
23 * 'xencons=xvc' [XC_XVC]: Console attached to '/dev/xvc0'.
24 + * 'xencons=hvc' [XC_HVC]: Console attached to '/dev/hvc0'.
25 * default: XC_XVC
26 *
27 * NB. In mode XC_TTY, we create dummy consoles for tty2-63. This suppresses
28 * warnings from standard distro startup scripts.
29 */
30 static enum {
31 - XC_OFF, XC_TTY, XC_SERIAL, XC_XVC
32 + XC_OFF, XC_TTY, XC_SERIAL, XC_XVC, XC_HVC
33 } xc_mode = XC_XVC;
34 static int xc_num = -1;
35
36 @@ -80,6 +81,10 @@ static int xc_num = -1;
37 #define XEN_XVC_MAJOR 204
38 #define XEN_XVC_MINOR 191
39
40 +/* /dev/hvc0 device number */
41 +#define XEN_HVC_MAJOR 229
42 +#define XEN_HVC_MINOR 0
43 +
44 #ifdef CONFIG_MAGIC_SYSRQ
45 static unsigned long sysrq_requested;
46 extern int sysrq_enabled;
47 @@ -102,6 +107,9 @@ static int __init xencons_setup(char *st
48 } else if (!strncmp(str, "xvc", 3)) {
49 xc_mode = XC_XVC;
50 str += 3;
51 + } else if (!strncmp(str, "hvc", 3)) {
52 + xc_mode = XC_HVC;
53 + str += 3;
54 } else if (!strncmp(str, "off", 3)) {
55 xc_mode = XC_OFF;
56 str += 3;
57 @@ -210,6 +218,14 @@ static int __init xen_console_init(void)
58 xc_num = 0;
59 break;
60
61 + case XC_HVC:
62 + strcpy(kcons_info.name, "hvc");
63 + if (xc_num == -1)
64 + xc_num = 0;
65 + if (!is_initial_xendomain())
66 + add_preferred_console(kcons_info.name, xc_num, NULL);
67 + break;
68 +
69 case XC_SERIAL:
70 strcpy(kcons_info.name, "ttyS");
71 if (xc_num == -1)
72 @@ -685,6 +701,12 @@ static int __init xencons_init(void)
73 DRV(xencons_driver)->minor_start = XEN_XVC_MINOR;
74 DRV(xencons_driver)->name_base = xc_num;
75 break;
76 + case XC_HVC:
77 + DRV(xencons_driver)->name = "hvc";
78 + DRV(xencons_driver)->major = XEN_HVC_MAJOR;
79 + DRV(xencons_driver)->minor_start = XEN_HVC_MINOR;
80 + DRV(xencons_driver)->name_base = xc_num;
81 + break;
82 case XC_SERIAL:
83 DRV(xencons_driver)->name = "ttyS";
84 DRV(xencons_driver)->minor_start = 64 + xc_num;