Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
76ffb0b4
Q
qemu
项目概览
openeuler
/
qemu
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
qemu
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
76ffb0b4
编写于
9月 28, 2012
作者:
G
Gerd Hoffmann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
console: s/TextConsole/QemuConsole/
Signed-off-by:
N
Gerd Hoffmann
<
kraxel@redhat.com
>
上级
bf2fde70
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
37 addition
and
38 deletion
+37
-38
console.c
console.c
+36
-36
qemu-common.h
qemu-common.h
+1
-2
未找到文件。
console.c
浏览文件 @
76ffb0b4
...
@@ -114,20 +114,20 @@ typedef enum {
...
@@ -114,20 +114,20 @@ typedef enum {
TEXT_CONSOLE_FIXED_SIZE
TEXT_CONSOLE_FIXED_SIZE
}
console_type_t
;
}
console_type_t
;
/* ??? This is mis-named.
struct
QemuConsole
{
It is used for both text and graphical consoles. */
struct
TextConsole
{
int
index
;
int
index
;
console_type_t
console_type
;
console_type_t
console_type
;
DisplayState
*
ds
;
DisplayState
*
ds
;
/* Graphic console state. */
/* Graphic console state. */
vga_hw_update_ptr
hw_update
;
vga_hw_update_ptr
hw_update
;
vga_hw_invalidate_ptr
hw_invalidate
;
vga_hw_invalidate_ptr
hw_invalidate
;
vga_hw_screen_dump_ptr
hw_screen_dump
;
vga_hw_screen_dump_ptr
hw_screen_dump
;
vga_hw_text_update_ptr
hw_text_update
;
vga_hw_text_update_ptr
hw_text_update
;
void
*
hw
;
void
*
hw
;
int
g_width
,
g_height
;
int
g_width
,
g_height
;
/* Text console state */
int
width
;
int
width
;
int
height
;
int
height
;
int
total_height
;
int
total_height
;
...
@@ -161,8 +161,8 @@ struct TextConsole {
...
@@ -161,8 +161,8 @@ struct TextConsole {
};
};
static
DisplayState
*
display_state
;
static
DisplayState
*
display_state
;
static
Text
Console
*
active_console
;
static
Qemu
Console
*
active_console
;
static
Text
Console
*
consoles
[
MAX_CONSOLES
];
static
Qemu
Console
*
consoles
[
MAX_CONSOLES
];
static
int
nb_consoles
=
0
;
static
int
nb_consoles
=
0
;
void
vga_hw_update
(
void
)
void
vga_hw_update
(
void
)
...
@@ -179,7 +179,7 @@ void vga_hw_invalidate(void)
...
@@ -179,7 +179,7 @@ void vga_hw_invalidate(void)
void
qmp_screendump
(
const
char
*
filename
,
Error
**
errp
)
void
qmp_screendump
(
const
char
*
filename
,
Error
**
errp
)
{
{
Text
Console
*
previous_active_console
;
Qemu
Console
*
previous_active_console
;
bool
cswitch
;
bool
cswitch
;
previous_active_console
=
active_console
;
previous_active_console
=
active_console
;
...
@@ -521,7 +521,7 @@ static void vga_putcharxy(DisplayState *ds, int x, int y, int ch,
...
@@ -521,7 +521,7 @@ static void vga_putcharxy(DisplayState *ds, int x, int y, int ch,
}
}
}
}
static
void
text_console_resize
(
Text
Console
*
s
)
static
void
text_console_resize
(
Qemu
Console
*
s
)
{
{
TextCell
*
cells
,
*
c
,
*
c1
;
TextCell
*
cells
,
*
c
,
*
c1
;
int
w1
,
x
,
y
,
last_width
;
int
w1
,
x
,
y
,
last_width
;
...
@@ -553,7 +553,7 @@ static void text_console_resize(TextConsole *s)
...
@@ -553,7 +553,7 @@ static void text_console_resize(TextConsole *s)
s
->
cells
=
cells
;
s
->
cells
=
cells
;
}
}
static
inline
void
text_update_xy
(
Text
Console
*
s
,
int
x
,
int
y
)
static
inline
void
text_update_xy
(
Qemu
Console
*
s
,
int
x
,
int
y
)
{
{
s
->
text_x
[
0
]
=
MIN
(
s
->
text_x
[
0
],
x
);
s
->
text_x
[
0
]
=
MIN
(
s
->
text_x
[
0
],
x
);
s
->
text_x
[
1
]
=
MAX
(
s
->
text_x
[
1
],
x
);
s
->
text_x
[
1
]
=
MAX
(
s
->
text_x
[
1
],
x
);
...
@@ -561,7 +561,7 @@ static inline void text_update_xy(TextConsole *s, int x, int y)
...
@@ -561,7 +561,7 @@ static inline void text_update_xy(TextConsole *s, int x, int y)
s
->
text_y
[
1
]
=
MAX
(
s
->
text_y
[
1
],
y
);
s
->
text_y
[
1
]
=
MAX
(
s
->
text_y
[
1
],
y
);
}
}
static
void
invalidate_xy
(
Text
Console
*
s
,
int
x
,
int
y
)
static
void
invalidate_xy
(
Qemu
Console
*
s
,
int
x
,
int
y
)
{
{
if
(
s
->
update_x0
>
x
*
FONT_WIDTH
)
if
(
s
->
update_x0
>
x
*
FONT_WIDTH
)
s
->
update_x0
=
x
*
FONT_WIDTH
;
s
->
update_x0
=
x
*
FONT_WIDTH
;
...
@@ -573,7 +573,7 @@ static void invalidate_xy(TextConsole *s, int x, int y)
...
@@ -573,7 +573,7 @@ static void invalidate_xy(TextConsole *s, int x, int y)
s
->
update_y1
=
(
y
+
1
)
*
FONT_HEIGHT
;
s
->
update_y1
=
(
y
+
1
)
*
FONT_HEIGHT
;
}
}
static
void
update_xy
(
Text
Console
*
s
,
int
x
,
int
y
)
static
void
update_xy
(
Qemu
Console
*
s
,
int
x
,
int
y
)
{
{
TextCell
*
c
;
TextCell
*
c
;
int
y1
,
y2
;
int
y1
,
y2
;
...
@@ -597,7 +597,7 @@ static void update_xy(TextConsole *s, int x, int y)
...
@@ -597,7 +597,7 @@ static void update_xy(TextConsole *s, int x, int y)
}
}
}
}
static
void
console_show_cursor
(
Text
Console
*
s
,
int
show
)
static
void
console_show_cursor
(
Qemu
Console
*
s
,
int
show
)
{
{
TextCell
*
c
;
TextCell
*
c
;
int
y
,
y1
;
int
y
,
y1
;
...
@@ -631,7 +631,7 @@ static void console_show_cursor(TextConsole *s, int show)
...
@@ -631,7 +631,7 @@ static void console_show_cursor(TextConsole *s, int show)
}
}
}
}
static
void
console_refresh
(
Text
Console
*
s
)
static
void
console_refresh
(
Qemu
Console
*
s
)
{
{
TextCell
*
c
;
TextCell
*
c
;
int
x
,
y
,
y1
;
int
x
,
y
,
y1
;
...
@@ -666,7 +666,7 @@ static void console_refresh(TextConsole *s)
...
@@ -666,7 +666,7 @@ static void console_refresh(TextConsole *s)
static
void
console_scroll
(
int
ydelta
)
static
void
console_scroll
(
int
ydelta
)
{
{
Text
Console
*
s
;
Qemu
Console
*
s
;
int
i
,
y1
;
int
i
,
y1
;
s
=
active_console
;
s
=
active_console
;
...
@@ -698,7 +698,7 @@ static void console_scroll(int ydelta)
...
@@ -698,7 +698,7 @@ static void console_scroll(int ydelta)
console_refresh
(
s
);
console_refresh
(
s
);
}
}
static
void
console_put_lf
(
Text
Console
*
s
)
static
void
console_put_lf
(
Qemu
Console
*
s
)
{
{
TextCell
*
c
;
TextCell
*
c
;
int
x
,
y1
;
int
x
,
y1
;
...
@@ -749,7 +749,7 @@ static void console_put_lf(TextConsole *s)
...
@@ -749,7 +749,7 @@ static void console_put_lf(TextConsole *s)
* NOTE: I know this code is not very efficient (checking every color for it
* NOTE: I know this code is not very efficient (checking every color for it
* self) but it is more readable and better maintainable.
* self) but it is more readable and better maintainable.
*/
*/
static
void
console_handle_escape
(
Text
Console
*
s
)
static
void
console_handle_escape
(
Qemu
Console
*
s
)
{
{
int
i
;
int
i
;
...
@@ -842,7 +842,7 @@ static void console_handle_escape(TextConsole *s)
...
@@ -842,7 +842,7 @@ static void console_handle_escape(TextConsole *s)
}
}
}
}
static
void
console_clear_xy
(
Text
Console
*
s
,
int
x
,
int
y
)
static
void
console_clear_xy
(
Qemu
Console
*
s
,
int
x
,
int
y
)
{
{
int
y1
=
(
s
->
y_base
+
y
)
%
s
->
total_height
;
int
y1
=
(
s
->
y_base
+
y
)
%
s
->
total_height
;
TextCell
*
c
=
&
s
->
cells
[
y1
*
s
->
width
+
x
];
TextCell
*
c
=
&
s
->
cells
[
y1
*
s
->
width
+
x
];
...
@@ -852,7 +852,7 @@ static void console_clear_xy(TextConsole *s, int x, int y)
...
@@ -852,7 +852,7 @@ static void console_clear_xy(TextConsole *s, int x, int y)
}
}
/* set cursor, checking bounds */
/* set cursor, checking bounds */
static
void
set_cursor
(
Text
Console
*
s
,
int
x
,
int
y
)
static
void
set_cursor
(
Qemu
Console
*
s
,
int
x
,
int
y
)
{
{
if
(
x
<
0
)
{
if
(
x
<
0
)
{
x
=
0
;
x
=
0
;
...
@@ -871,7 +871,7 @@ static void set_cursor(TextConsole *s, int x, int y)
...
@@ -871,7 +871,7 @@ static void set_cursor(TextConsole *s, int x, int y)
s
->
y
=
y
;
s
->
y
=
y
;
}
}
static
void
console_putchar
(
Text
Console
*
s
,
int
ch
)
static
void
console_putchar
(
Qemu
Console
*
s
,
int
ch
)
{
{
TextCell
*
c
;
TextCell
*
c
;
int
y1
,
i
;
int
y1
,
i
;
...
@@ -1078,7 +1078,7 @@ static void console_putchar(TextConsole *s, int ch)
...
@@ -1078,7 +1078,7 @@ static void console_putchar(TextConsole *s, int ch)
void
console_select
(
unsigned
int
index
)
void
console_select
(
unsigned
int
index
)
{
{
Text
Console
*
s
;
Qemu
Console
*
s
;
if
(
index
>=
MAX_CONSOLES
)
if
(
index
>=
MAX_CONSOLES
)
return
;
return
;
...
@@ -1111,7 +1111,7 @@ void console_select(unsigned int index)
...
@@ -1111,7 +1111,7 @@ void console_select(unsigned int index)
static
int
console_puts
(
CharDriverState
*
chr
,
const
uint8_t
*
buf
,
int
len
)
static
int
console_puts
(
CharDriverState
*
chr
,
const
uint8_t
*
buf
,
int
len
)
{
{
Text
Console
*
s
=
chr
->
opaque
;
Qemu
Console
*
s
=
chr
->
opaque
;
int
i
;
int
i
;
s
->
update_x0
=
s
->
width
*
FONT_WIDTH
;
s
->
update_x0
=
s
->
width
*
FONT_WIDTH
;
...
@@ -1133,7 +1133,7 @@ static int console_puts(CharDriverState *chr, const uint8_t *buf, int len)
...
@@ -1133,7 +1133,7 @@ static int console_puts(CharDriverState *chr, const uint8_t *buf, int len)
static
void
kbd_send_chars
(
void
*
opaque
)
static
void
kbd_send_chars
(
void
*
opaque
)
{
{
Text
Console
*
s
=
opaque
;
Qemu
Console
*
s
=
opaque
;
int
len
;
int
len
;
uint8_t
buf
[
16
];
uint8_t
buf
[
16
];
...
@@ -1156,7 +1156,7 @@ static void kbd_send_chars(void *opaque)
...
@@ -1156,7 +1156,7 @@ static void kbd_send_chars(void *opaque)
/* called when an ascii key is pressed */
/* called when an ascii key is pressed */
void
kbd_put_keysym
(
int
keysym
)
void
kbd_put_keysym
(
int
keysym
)
{
{
Text
Console
*
s
;
Qemu
Console
*
s
;
uint8_t
buf
[
16
],
*
q
;
uint8_t
buf
[
16
],
*
q
;
int
c
;
int
c
;
...
@@ -1211,7 +1211,7 @@ void kbd_put_keysym(int keysym)
...
@@ -1211,7 +1211,7 @@ void kbd_put_keysym(int keysym)
static
void
text_console_invalidate
(
void
*
opaque
)
static
void
text_console_invalidate
(
void
*
opaque
)
{
{
TextConsole
*
s
=
(
Text
Console
*
)
opaque
;
QemuConsole
*
s
=
(
Qemu
Console
*
)
opaque
;
if
(
!
ds_get_bits_per_pixel
(
s
->
ds
)
&&
s
->
console_type
==
TEXT_CONSOLE
)
{
if
(
!
ds_get_bits_per_pixel
(
s
->
ds
)
&&
s
->
console_type
==
TEXT_CONSOLE
)
{
s
->
g_width
=
ds_get_width
(
s
->
ds
);
s
->
g_width
=
ds_get_width
(
s
->
ds
);
s
->
g_height
=
ds_get_height
(
s
->
ds
);
s
->
g_height
=
ds_get_height
(
s
->
ds
);
...
@@ -1222,7 +1222,7 @@ static void text_console_invalidate(void *opaque)
...
@@ -1222,7 +1222,7 @@ static void text_console_invalidate(void *opaque)
static
void
text_console_update
(
void
*
opaque
,
console_ch_t
*
chardata
)
static
void
text_console_update
(
void
*
opaque
,
console_ch_t
*
chardata
)
{
{
TextConsole
*
s
=
(
Text
Console
*
)
opaque
;
QemuConsole
*
s
=
(
Qemu
Console
*
)
opaque
;
int
i
,
j
,
src
;
int
i
,
j
,
src
;
if
(
s
->
text_x
[
0
]
<=
s
->
text_x
[
1
])
{
if
(
s
->
text_x
[
0
]
<=
s
->
text_x
[
1
])
{
...
@@ -1247,10 +1247,10 @@ static void text_console_update(void *opaque, console_ch_t *chardata)
...
@@ -1247,10 +1247,10 @@ static void text_console_update(void *opaque, console_ch_t *chardata)
}
}
}
}
static
Text
Console
*
get_graphic_console
(
DisplayState
*
ds
)
static
Qemu
Console
*
get_graphic_console
(
DisplayState
*
ds
)
{
{
int
i
;
int
i
;
Text
Console
*
s
;
Qemu
Console
*
s
;
for
(
i
=
0
;
i
<
nb_consoles
;
i
++
)
{
for
(
i
=
0
;
i
<
nb_consoles
;
i
++
)
{
s
=
consoles
[
i
];
s
=
consoles
[
i
];
if
(
s
->
console_type
==
GRAPHIC_CONSOLE
&&
s
->
ds
==
ds
)
if
(
s
->
console_type
==
GRAPHIC_CONSOLE
&&
s
->
ds
==
ds
)
...
@@ -1259,14 +1259,14 @@ static TextConsole *get_graphic_console(DisplayState *ds)
...
@@ -1259,14 +1259,14 @@ static TextConsole *get_graphic_console(DisplayState *ds)
return
NULL
;
return
NULL
;
}
}
static
Text
Console
*
new_console
(
DisplayState
*
ds
,
console_type_t
console_type
)
static
Qemu
Console
*
new_console
(
DisplayState
*
ds
,
console_type_t
console_type
)
{
{
Text
Console
*
s
;
Qemu
Console
*
s
;
int
i
;
int
i
;
if
(
nb_consoles
>=
MAX_CONSOLES
)
if
(
nb_consoles
>=
MAX_CONSOLES
)
return
NULL
;
return
NULL
;
s
=
g_malloc0
(
sizeof
(
Text
Console
));
s
=
g_malloc0
(
sizeof
(
Qemu
Console
));
if
(
!
active_console
||
((
active_console
->
console_type
!=
GRAPHIC_CONSOLE
)
&&
if
(
!
active_console
||
((
active_console
->
console_type
!=
GRAPHIC_CONSOLE
)
&&
(
console_type
==
GRAPHIC_CONSOLE
)))
{
(
console_type
==
GRAPHIC_CONSOLE
)))
{
active_console
=
s
;
active_console
=
s
;
...
@@ -1417,7 +1417,7 @@ DisplayState *graphic_console_init(vga_hw_update_ptr update,
...
@@ -1417,7 +1417,7 @@ DisplayState *graphic_console_init(vga_hw_update_ptr update,
vga_hw_text_update_ptr
text_update
,
vga_hw_text_update_ptr
text_update
,
void
*
opaque
)
void
*
opaque
)
{
{
Text
Console
*
s
;
Qemu
Console
*
s
;
DisplayState
*
ds
;
DisplayState
*
ds
;
ds
=
(
DisplayState
*
)
g_malloc0
(
sizeof
(
DisplayState
));
ds
=
(
DisplayState
*
)
g_malloc0
(
sizeof
(
DisplayState
));
...
@@ -1463,14 +1463,14 @@ void console_color_init(DisplayState *ds)
...
@@ -1463,14 +1463,14 @@ void console_color_init(DisplayState *ds)
static
void
text_console_set_echo
(
CharDriverState
*
chr
,
bool
echo
)
static
void
text_console_set_echo
(
CharDriverState
*
chr
,
bool
echo
)
{
{
Text
Console
*
s
=
chr
->
opaque
;
Qemu
Console
*
s
=
chr
->
opaque
;
s
->
echo
=
echo
;
s
->
echo
=
echo
;
}
}
static
void
text_console_update_cursor
(
void
*
opaque
)
static
void
text_console_update_cursor
(
void
*
opaque
)
{
{
Text
Console
*
s
=
opaque
;
Qemu
Console
*
s
=
opaque
;
s
->
cursor_visible_phase
=
!
s
->
cursor_visible_phase
;
s
->
cursor_visible_phase
=
!
s
->
cursor_visible_phase
;
vga_hw_invalidate
();
vga_hw_invalidate
();
...
@@ -1480,7 +1480,7 @@ static void text_console_update_cursor(void *opaque)
...
@@ -1480,7 +1480,7 @@ static void text_console_update_cursor(void *opaque)
static
void
text_console_do_init
(
CharDriverState
*
chr
,
DisplayState
*
ds
)
static
void
text_console_do_init
(
CharDriverState
*
chr
,
DisplayState
*
ds
)
{
{
Text
Console
*
s
;
Qemu
Console
*
s
;
static
int
color_inited
;
static
int
color_inited
;
s
=
chr
->
opaque
;
s
=
chr
->
opaque
;
...
@@ -1543,7 +1543,7 @@ static void text_console_do_init(CharDriverState *chr, DisplayState *ds)
...
@@ -1543,7 +1543,7 @@ static void text_console_do_init(CharDriverState *chr, DisplayState *ds)
CharDriverState
*
text_console_init
(
QemuOpts
*
opts
)
CharDriverState
*
text_console_init
(
QemuOpts
*
opts
)
{
{
CharDriverState
*
chr
;
CharDriverState
*
chr
;
Text
Console
*
s
;
Qemu
Console
*
s
;
unsigned
width
;
unsigned
width
;
unsigned
height
;
unsigned
height
;
...
@@ -1589,7 +1589,7 @@ void text_consoles_set_display(DisplayState *ds)
...
@@ -1589,7 +1589,7 @@ void text_consoles_set_display(DisplayState *ds)
void
qemu_console_resize
(
DisplayState
*
ds
,
int
width
,
int
height
)
void
qemu_console_resize
(
DisplayState
*
ds
,
int
width
,
int
height
)
{
{
Text
Console
*
s
=
get_graphic_console
(
ds
);
Qemu
Console
*
s
=
get_graphic_console
(
ds
);
if
(
!
s
)
return
;
if
(
!
s
)
return
;
s
->
g_width
=
width
;
s
->
g_width
=
width
;
...
...
qemu-common.h
浏览文件 @
76ffb0b4
...
@@ -264,8 +264,7 @@ typedef struct DisplayChangeListener DisplayChangeListener;
...
@@ -264,8 +264,7 @@ typedef struct DisplayChangeListener DisplayChangeListener;
typedef
struct
DisplaySurface
DisplaySurface
;
typedef
struct
DisplaySurface
DisplaySurface
;
typedef
struct
DisplayAllocator
DisplayAllocator
;
typedef
struct
DisplayAllocator
DisplayAllocator
;
typedef
struct
PixelFormat
PixelFormat
;
typedef
struct
PixelFormat
PixelFormat
;
typedef
struct
TextConsole
TextConsole
;
typedef
struct
QemuConsole
QemuConsole
;
typedef
TextConsole
QEMUConsole
;
typedef
struct
CharDriverState
CharDriverState
;
typedef
struct
CharDriverState
CharDriverState
;
typedef
struct
MACAddr
MACAddr
;
typedef
struct
MACAddr
MACAddr
;
typedef
struct
NetClientState
NetClientState
;
typedef
struct
NetClientState
NetClientState
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录