1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
|
From: jbeulich@novell.com
Subject: Allow Xen console to be independently configured
Patch-mainline: obsolete
---
drivers/xen/Kconfig | 6 +++
drivers/xen/console/Makefile | 3 +
drivers/xen/console/console.c | 35 ---------------------
drivers/xen/console/dom0.c | 70 ++++++++++++++++++++++++++++++++++++++++++
include/xen/xencons.h | 14 ++++++++
5 files changed, 92 insertions(+), 36 deletions(-)
--- a/drivers/xen/Kconfig 2007-08-27 14:01:26.000000000 -0400
+++ b/drivers/xen/Kconfig 2007-08-27 14:01:27.000000000 -0400
@@ -195,6 +195,12 @@ config XEN_KEYBOARD
domain. If you've said Y to CONFIG_XEN_FRAMEBUFFER, you probably
want to say Y here.
+config XEN_CONSOLE
+ bool "Xen virtual console"
+ default y
+ help
+ The Xen virtual console is ...
+
config XEN_SCRUB_PAGES
bool "Scrub memory before freeing it to Xen"
default y
--- a/drivers/xen/console/Makefile 2007-08-27 14:01:25.000000000 -0400
+++ b/drivers/xen/console/Makefile 2007-08-27 14:01:27.000000000 -0400
@@ -1,2 +1,3 @@
-obj-y := console.o xencons_ring.o
+obj-$(CONFIG_XEN_CONSOLE) := console.o xencons_ring.o
+obj-$(CONFIG_XEN_PRIVILEGED_GUEST) += dom0.o
--- a/drivers/xen/console/console.c 2007-08-27 14:01:26.000000000 -0400
+++ b/drivers/xen/console/console.c 2007-08-27 14:01:50.000000000 -0400
@@ -283,41 +283,6 @@ void xencons_force_flush(void)
}
-void dom0_init_screen_info(const struct dom0_vga_console_info *info)
-{
- switch (info->video_type) {
- case XEN_VGATYPE_TEXT_MODE_3:
- screen_info.orig_video_mode = 3;
- screen_info.orig_video_ega_bx = 3;
- screen_info.orig_video_isVGA = 1;
- screen_info.orig_video_lines = info->u.text_mode_3.rows;
- screen_info.orig_video_cols = info->u.text_mode_3.columns;
- screen_info.orig_x = info->u.text_mode_3.cursor_x;
- screen_info.orig_y = info->u.text_mode_3.cursor_y;
- screen_info.orig_video_points =
- info->u.text_mode_3.font_height;
- break;
- case XEN_VGATYPE_VESA_LFB:
- screen_info.orig_video_isVGA = VIDEO_TYPE_VLFB;
- screen_info.lfb_width = info->u.vesa_lfb.width;
- screen_info.lfb_height = info->u.vesa_lfb.height;
- screen_info.lfb_depth = info->u.vesa_lfb.bits_per_pixel;
- screen_info.lfb_base = info->u.vesa_lfb.lfb_base;
- screen_info.lfb_size = info->u.vesa_lfb.lfb_size;
- screen_info.lfb_linelength = info->u.vesa_lfb.bytes_per_line;
- screen_info.red_size = info->u.vesa_lfb.red_size;
- screen_info.red_pos = info->u.vesa_lfb.red_pos;
- screen_info.green_size = info->u.vesa_lfb.green_size;
- screen_info.green_pos = info->u.vesa_lfb.green_pos;
- screen_info.blue_size = info->u.vesa_lfb.blue_size;
- screen_info.blue_pos = info->u.vesa_lfb.blue_pos;
- screen_info.rsvd_size = info->u.vesa_lfb.rsvd_size;
- screen_info.rsvd_pos = info->u.vesa_lfb.rsvd_pos;
- break;
- }
-}
-
-
/******************** User-space console driver (/dev/console) ************/
#define DRV(_d) (_d)
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ b/drivers/xen/console/dom0.c 2007-08-27 14:01:27.000000000 -0400
@@ -0,0 +1,70 @@
+/******************************************************************************
+ * dom0.c
+ *
+ * Dom0 console parameter initialization.
+ *
+ * Copyright (c) 2002-2004, K A Fraser.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this source file (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy, modify,
+ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <linux/types.h>
+#include <linux/screen_info.h>
+#include <xen/interface/xen.h>
+#include <xen/xencons.h>
+
+void dom0_init_screen_info(const struct dom0_vga_console_info *info)
+{
+ switch (info->video_type) {
+ case XEN_VGATYPE_TEXT_MODE_3:
+ screen_info.orig_video_mode = 3;
+ screen_info.orig_video_ega_bx = 3;
+ screen_info.orig_video_isVGA = 1;
+ screen_info.orig_video_lines = info->u.text_mode_3.rows;
+ screen_info.orig_video_cols = info->u.text_mode_3.columns;
+ screen_info.orig_x = info->u.text_mode_3.cursor_x;
+ screen_info.orig_y = info->u.text_mode_3.cursor_y;
+ screen_info.orig_video_points =
+ info->u.text_mode_3.font_height;
+ break;
+ case XEN_VGATYPE_VESA_LFB:
+ screen_info.orig_video_isVGA = VIDEO_TYPE_VLFB;
+ screen_info.lfb_width = info->u.vesa_lfb.width;
+ screen_info.lfb_height = info->u.vesa_lfb.height;
+ screen_info.lfb_depth = info->u.vesa_lfb.bits_per_pixel;
+ screen_info.lfb_base = info->u.vesa_lfb.lfb_base;
+ screen_info.lfb_size = info->u.vesa_lfb.lfb_size;
+ screen_info.lfb_linelength = info->u.vesa_lfb.bytes_per_line;
+ screen_info.red_size = info->u.vesa_lfb.red_size;
+ screen_info.red_pos = info->u.vesa_lfb.red_pos;
+ screen_info.green_size = info->u.vesa_lfb.green_size;
+ screen_info.green_pos = info->u.vesa_lfb.green_pos;
+ screen_info.blue_size = info->u.vesa_lfb.blue_size;
+ screen_info.blue_pos = info->u.vesa_lfb.blue_pos;
+ screen_info.rsvd_size = info->u.vesa_lfb.rsvd_size;
+ screen_info.rsvd_pos = info->u.vesa_lfb.rsvd_pos;
+ break;
+ }
+}
--- a/include/xen/xencons.h 2007-08-27 14:01:25.000000000 -0400
+++ b/include/xen/xencons.h 2007-08-27 14:01:27.000000000 -0400
@@ -1,8 +1,14 @@
#ifndef __ASM_XENCONS_H__
#define __ASM_XENCONS_H__
+#ifdef CONFIG_XEN_PRIVILEGED_GUEST
struct dom0_vga_console_info;
void dom0_init_screen_info(const struct dom0_vga_console_info *info);
+#else
+#define dom0_init_screen_info(info) ((void)(info))
+#endif
+
+#ifdef CONFIG_XEN_CONSOLE
void xencons_force_flush(void);
void xencons_resume(void);
@@ -16,4 +22,12 @@ int xencons_ring_send(const char *data,
void xencons_early_setup(void);
+#else
+
+static inline void xencons_force_flush(void) {}
+static inline void xencons_resume(void) {}
+static inline void xencons_early_setup(void) {}
+
+#endif
+
#endif /* __ASM_XENCONS_H__ */
|