Annotation of /trunk/kernel26-xen/patches-2.6.25-r1/1038-2.6.25-xen-configurable-console.patch
Parent Directory | Revision Log
Revision 609 -
(hide annotations)
(download)
Fri May 23 17:35:37 2008 UTC (16 years, 4 months ago) by niro
File size: 9239 byte(s)
Fri May 23 17:35:37 2008 UTC (16 years, 4 months ago) by niro
File size: 9239 byte(s)
-using opensuse xen patchset, updated kernel configs
1 | niro | 609 | From: jbeulich@novell.com |
2 | Subject: Allow Xen console to be independently configured | ||
3 | Patch-mainline: obsolete | ||
4 | |||
5 | Index: head-2008-02-26/drivers/xen/Kconfig | ||
6 | =================================================================== | ||
7 | --- head-2008-02-26.orig/drivers/xen/Kconfig 2008-02-26 17:30:23.000000000 +0100 | ||
8 | +++ head-2008-02-26/drivers/xen/Kconfig 2008-03-03 14:45:27.000000000 +0100 | ||
9 | @@ -221,6 +221,12 @@ config XEN_KEYBOARD | ||
10 | domain. If you've said Y to CONFIG_XEN_FRAMEBUFFER, you probably | ||
11 | want to say Y here. | ||
12 | |||
13 | +config XEN_CONSOLE | ||
14 | + bool "Xen virtual console" | ||
15 | + default y | ||
16 | + help | ||
17 | + The Xen virtual console is ... | ||
18 | + | ||
19 | config XEN_SCRUB_PAGES | ||
20 | bool "Scrub memory before freeing it to Xen" | ||
21 | default y | ||
22 | Index: head-2008-02-26/drivers/xen/console/Makefile | ||
23 | =================================================================== | ||
24 | --- head-2008-02-26.orig/drivers/xen/console/Makefile 2007-06-12 13:13:44.000000000 +0200 | ||
25 | +++ head-2008-02-26/drivers/xen/console/Makefile 2008-03-03 14:45:27.000000000 +0100 | ||
26 | @@ -1,2 +1,3 @@ | ||
27 | |||
28 | -obj-y := console.o xencons_ring.o | ||
29 | +obj-$(CONFIG_XEN_CONSOLE) := console.o xencons_ring.o | ||
30 | +obj-$(CONFIG_XEN_PRIVILEGED_GUEST) += dom0.o | ||
31 | Index: head-2008-02-26/drivers/xen/console/console.c | ||
32 | =================================================================== | ||
33 | --- head-2008-02-26.orig/drivers/xen/console/console.c 2008-02-26 17:38:18.000000000 +0100 | ||
34 | +++ head-2008-02-26/drivers/xen/console/console.c 2008-03-03 14:45:27.000000000 +0100 | ||
35 | @@ -271,63 +271,6 @@ void xencons_force_flush(void) | ||
36 | } | ||
37 | |||
38 | |||
39 | -void __init dom0_init_screen_info(const struct dom0_vga_console_info *info, size_t size) | ||
40 | -{ | ||
41 | - /* This is drawn from a dump from vgacon:startup in | ||
42 | - * standard Linux. */ | ||
43 | - screen_info.orig_video_mode = 3; | ||
44 | - screen_info.orig_video_isVGA = 1; | ||
45 | - screen_info.orig_video_lines = 25; | ||
46 | - screen_info.orig_video_cols = 80; | ||
47 | - screen_info.orig_video_ega_bx = 3; | ||
48 | - screen_info.orig_video_points = 16; | ||
49 | - screen_info.orig_y = screen_info.orig_video_lines - 1; | ||
50 | - | ||
51 | - switch (info->video_type) { | ||
52 | - case XEN_VGATYPE_TEXT_MODE_3: | ||
53 | - if (size < offsetof(struct dom0_vga_console_info, u.text_mode_3) | ||
54 | - + sizeof(info->u.text_mode_3)) | ||
55 | - break; | ||
56 | - screen_info.orig_video_lines = info->u.text_mode_3.rows; | ||
57 | - screen_info.orig_video_cols = info->u.text_mode_3.columns; | ||
58 | - screen_info.orig_x = info->u.text_mode_3.cursor_x; | ||
59 | - screen_info.orig_y = info->u.text_mode_3.cursor_y; | ||
60 | - screen_info.orig_video_points = | ||
61 | - info->u.text_mode_3.font_height; | ||
62 | - break; | ||
63 | - | ||
64 | - case XEN_VGATYPE_VESA_LFB: | ||
65 | - if (size < offsetof(struct dom0_vga_console_info, | ||
66 | - u.vesa_lfb.gbl_caps)) | ||
67 | - break; | ||
68 | - screen_info.orig_video_isVGA = VIDEO_TYPE_VLFB; | ||
69 | - screen_info.lfb_width = info->u.vesa_lfb.width; | ||
70 | - screen_info.lfb_height = info->u.vesa_lfb.height; | ||
71 | - screen_info.lfb_depth = info->u.vesa_lfb.bits_per_pixel; | ||
72 | - screen_info.lfb_base = info->u.vesa_lfb.lfb_base; | ||
73 | - screen_info.lfb_size = info->u.vesa_lfb.lfb_size; | ||
74 | - screen_info.lfb_linelength = info->u.vesa_lfb.bytes_per_line; | ||
75 | - screen_info.red_size = info->u.vesa_lfb.red_size; | ||
76 | - screen_info.red_pos = info->u.vesa_lfb.red_pos; | ||
77 | - screen_info.green_size = info->u.vesa_lfb.green_size; | ||
78 | - screen_info.green_pos = info->u.vesa_lfb.green_pos; | ||
79 | - screen_info.blue_size = info->u.vesa_lfb.blue_size; | ||
80 | - screen_info.blue_pos = info->u.vesa_lfb.blue_pos; | ||
81 | - screen_info.rsvd_size = info->u.vesa_lfb.rsvd_size; | ||
82 | - screen_info.rsvd_pos = info->u.vesa_lfb.rsvd_pos; | ||
83 | - if (size >= offsetof(struct dom0_vga_console_info, | ||
84 | - u.vesa_lfb.gbl_caps) | ||
85 | - + sizeof(info->u.vesa_lfb.gbl_caps)) | ||
86 | - screen_info.capabilities = info->u.vesa_lfb.gbl_caps; | ||
87 | - if (size >= offsetof(struct dom0_vga_console_info, | ||
88 | - u.vesa_lfb.mode_attrs) | ||
89 | - + sizeof(info->u.vesa_lfb.mode_attrs)) | ||
90 | - screen_info.vesa_attributes = info->u.vesa_lfb.mode_attrs; | ||
91 | - break; | ||
92 | - } | ||
93 | -} | ||
94 | - | ||
95 | - | ||
96 | /******************** User-space console driver (/dev/console) ************/ | ||
97 | |||
98 | #define DRV(_d) (_d) | ||
99 | Index: head-2008-02-26/drivers/xen/console/dom0.c | ||
100 | =================================================================== | ||
101 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
102 | +++ head-2008-02-26/drivers/xen/console/dom0.c 2008-03-03 14:45:27.000000000 +0100 | ||
103 | @@ -0,0 +1,93 @@ | ||
104 | +/****************************************************************************** | ||
105 | + * dom0.c | ||
106 | + * | ||
107 | + * Dom0 console parameter initialization. | ||
108 | + * | ||
109 | + * Copyright (c) 2002-2004, K A Fraser. | ||
110 | + * | ||
111 | + * This program is free software; you can redistribute it and/or | ||
112 | + * modify it under the terms of the GNU General Public License version 2 | ||
113 | + * as published by the Free Software Foundation; or, when distributed | ||
114 | + * separately from the Linux kernel or incorporated into other | ||
115 | + * software packages, subject to the following license: | ||
116 | + * | ||
117 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
118 | + * of this source file (the "Software"), to deal in the Software without | ||
119 | + * restriction, including without limitation the rights to use, copy, modify, | ||
120 | + * merge, publish, distribute, sublicense, and/or sell copies of the Software, | ||
121 | + * and to permit persons to whom the Software is furnished to do so, subject to | ||
122 | + * the following conditions: | ||
123 | + * | ||
124 | + * The above copyright notice and this permission notice shall be included in | ||
125 | + * all copies or substantial portions of the Software. | ||
126 | + * | ||
127 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
128 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
129 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
130 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
131 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
132 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
133 | + * IN THE SOFTWARE. | ||
134 | + */ | ||
135 | + | ||
136 | +#include <linux/types.h> | ||
137 | +#include <linux/screen_info.h> | ||
138 | +#include <linux/init.h> | ||
139 | +#include <xen/interface/xen.h> | ||
140 | +#include <xen/xencons.h> | ||
141 | + | ||
142 | +void __init dom0_init_screen_info(const struct dom0_vga_console_info *info, size_t size) | ||
143 | +{ | ||
144 | + /* This is drawn from a dump from vgacon:startup in | ||
145 | + * standard Linux. */ | ||
146 | + screen_info.orig_video_mode = 3; | ||
147 | + screen_info.orig_video_isVGA = 1; | ||
148 | + screen_info.orig_video_lines = 25; | ||
149 | + screen_info.orig_video_cols = 80; | ||
150 | + screen_info.orig_video_ega_bx = 3; | ||
151 | + screen_info.orig_video_points = 16; | ||
152 | + screen_info.orig_y = screen_info.orig_video_lines - 1; | ||
153 | + | ||
154 | + switch (info->video_type) { | ||
155 | + case XEN_VGATYPE_TEXT_MODE_3: | ||
156 | + if (size < offsetof(struct dom0_vga_console_info, u.text_mode_3) | ||
157 | + + sizeof(info->u.text_mode_3)) | ||
158 | + break; | ||
159 | + screen_info.orig_video_lines = info->u.text_mode_3.rows; | ||
160 | + screen_info.orig_video_cols = info->u.text_mode_3.columns; | ||
161 | + screen_info.orig_x = info->u.text_mode_3.cursor_x; | ||
162 | + screen_info.orig_y = info->u.text_mode_3.cursor_y; | ||
163 | + screen_info.orig_video_points = | ||
164 | + info->u.text_mode_3.font_height; | ||
165 | + break; | ||
166 | + | ||
167 | + case XEN_VGATYPE_VESA_LFB: | ||
168 | + if (size < offsetof(struct dom0_vga_console_info, | ||
169 | + u.vesa_lfb.gbl_caps)) | ||
170 | + break; | ||
171 | + screen_info.orig_video_isVGA = VIDEO_TYPE_VLFB; | ||
172 | + screen_info.lfb_width = info->u.vesa_lfb.width; | ||
173 | + screen_info.lfb_height = info->u.vesa_lfb.height; | ||
174 | + screen_info.lfb_depth = info->u.vesa_lfb.bits_per_pixel; | ||
175 | + screen_info.lfb_base = info->u.vesa_lfb.lfb_base; | ||
176 | + screen_info.lfb_size = info->u.vesa_lfb.lfb_size; | ||
177 | + screen_info.lfb_linelength = info->u.vesa_lfb.bytes_per_line; | ||
178 | + screen_info.red_size = info->u.vesa_lfb.red_size; | ||
179 | + screen_info.red_pos = info->u.vesa_lfb.red_pos; | ||
180 | + screen_info.green_size = info->u.vesa_lfb.green_size; | ||
181 | + screen_info.green_pos = info->u.vesa_lfb.green_pos; | ||
182 | + screen_info.blue_size = info->u.vesa_lfb.blue_size; | ||
183 | + screen_info.blue_pos = info->u.vesa_lfb.blue_pos; | ||
184 | + screen_info.rsvd_size = info->u.vesa_lfb.rsvd_size; | ||
185 | + screen_info.rsvd_pos = info->u.vesa_lfb.rsvd_pos; | ||
186 | + if (size >= offsetof(struct dom0_vga_console_info, | ||
187 | + u.vesa_lfb.gbl_caps) | ||
188 | + + sizeof(info->u.vesa_lfb.gbl_caps)) | ||
189 | + screen_info.capabilities = info->u.vesa_lfb.gbl_caps; | ||
190 | + if (size >= offsetof(struct dom0_vga_console_info, | ||
191 | + u.vesa_lfb.mode_attrs) | ||
192 | + + sizeof(info->u.vesa_lfb.mode_attrs)) | ||
193 | + screen_info.vesa_attributes = info->u.vesa_lfb.mode_attrs; | ||
194 | + break; | ||
195 | + } | ||
196 | +} | ||
197 | Index: head-2008-02-26/include/xen/xencons.h | ||
198 | =================================================================== | ||
199 | --- head-2008-02-26.orig/include/xen/xencons.h 2008-02-26 17:30:23.000000000 +0100 | ||
200 | +++ head-2008-02-26/include/xen/xencons.h 2008-03-03 14:45:27.000000000 +0100 | ||
201 | @@ -1,9 +1,14 @@ | ||
202 | #ifndef __ASM_XENCONS_H__ | ||
203 | #define __ASM_XENCONS_H__ | ||
204 | |||
205 | +#ifdef CONFIG_XEN_PRIVILEGED_GUEST | ||
206 | struct dom0_vga_console_info; | ||
207 | void dom0_init_screen_info(const struct dom0_vga_console_info *, size_t); | ||
208 | +#else | ||
209 | +#define dom0_init_screen_info(info) ((void)(info)) | ||
210 | +#endif | ||
211 | |||
212 | +#ifdef CONFIG_XEN_CONSOLE | ||
213 | void xencons_force_flush(void); | ||
214 | void xencons_resume(void); | ||
215 | |||
216 | @@ -13,5 +18,9 @@ void xencons_tx(void); | ||
217 | |||
218 | int xencons_ring_init(void); | ||
219 | int xencons_ring_send(const char *data, unsigned len); | ||
220 | +#else | ||
221 | +static inline void xencons_force_flush(void) {} | ||
222 | +static inline void xencons_resume(void) {} | ||
223 | +#endif | ||
224 | |||
225 | #endif /* __ASM_XENCONS_H__ */ |