Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
4fdeee7c
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看板
提交
4fdeee7c
编写于
5月 02, 2012
作者:
A
Andreas Färber
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cpu: Move stop field to CPUState
Change its type to bool. Signed-off-by:
N
Andreas Färber
<
afaerber@suse.de
>
上级
61a46217
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
20 addition
and
10 deletion
+20
-10
cpu-defs.h
cpu-defs.h
+0
-1
cpus.c
cpus.c
+18
-9
include/qemu/cpu.h
include/qemu/cpu.h
+2
-0
未找到文件。
cpu-defs.h
浏览文件 @
4fdeee7c
...
...
@@ -205,7 +205,6 @@ typedef struct CPUWatchpoint {
/* user data */
\
void *opaque; \
\
uint32_t stop;
/* Stop request */
\
uint32_t stopped;
/* Artificially stopped */
\
struct QemuCond *halt_cond; \
struct qemu_work_item *queued_work_first, *queued_work_last; \
...
...
cpus.c
浏览文件 @
4fdeee7c
...
...
@@ -64,7 +64,9 @@ static CPUArchState *next_cpu;
static
bool
cpu_thread_is_idle
(
CPUArchState
*
env
)
{
if
(
env
->
stop
||
env
->
queued_work_first
)
{
CPUState
*
cpu
=
ENV_GET_CPU
(
env
);
if
(
cpu
->
stop
||
env
->
queued_work_first
)
{
return
false
;
}
if
(
env
->
stopped
||
!
runstate_is_running
())
{
...
...
@@ -448,7 +450,9 @@ static void do_vm_stop(RunState state)
static
int
cpu_can_run
(
CPUArchState
*
env
)
{
if
(
env
->
stop
)
{
CPUState
*
cpu
=
ENV_GET_CPU
(
env
);
if
(
cpu
->
stop
)
{
return
0
;
}
if
(
env
->
stopped
||
!
runstate_is_running
())
{
...
...
@@ -687,8 +691,8 @@ static void qemu_wait_io_event_common(CPUArchState *env)
{
CPUState
*
cpu
=
ENV_GET_CPU
(
env
);
if
(
env
->
stop
)
{
env
->
stop
=
0
;
if
(
cpu
->
stop
)
{
cpu
->
stop
=
false
;
env
->
stopped
=
1
;
qemu_cond_signal
(
&
qemu_pause_cond
);
}
...
...
@@ -941,7 +945,8 @@ void pause_all_vcpus(void)
qemu_clock_enable
(
vm_clock
,
false
);
while
(
penv
)
{
penv
->
stop
=
1
;
CPUState
*
pcpu
=
ENV_GET_CPU
(
penv
);
pcpu
->
stop
=
true
;
qemu_cpu_kick
(
penv
);
penv
=
penv
->
next_cpu
;
}
...
...
@@ -950,7 +955,8 @@ void pause_all_vcpus(void)
cpu_stop_current
();
if
(
!
kvm_enabled
())
{
while
(
penv
)
{
penv
->
stop
=
0
;
CPUState
*
pcpu
=
ENV_GET_CPU
(
penv
);
pcpu
->
stop
=
0
;
penv
->
stopped
=
1
;
penv
=
penv
->
next_cpu
;
}
...
...
@@ -974,7 +980,8 @@ void resume_all_vcpus(void)
qemu_clock_enable
(
vm_clock
,
true
);
while
(
penv
)
{
penv
->
stop
=
0
;
CPUState
*
pcpu
=
ENV_GET_CPU
(
penv
);
pcpu
->
stop
=
false
;
penv
->
stopped
=
0
;
qemu_cpu_kick
(
penv
);
penv
=
penv
->
next_cpu
;
...
...
@@ -1054,7 +1061,8 @@ void qemu_init_vcpu(void *_env)
void
cpu_stop_current
(
void
)
{
if
(
cpu_single_env
)
{
cpu_single_env
->
stop
=
0
;
CPUState
*
cpu_single_cpu
=
ENV_GET_CPU
(
cpu_single_env
);
cpu_single_cpu
->
stop
=
false
;
cpu_single_env
->
stopped
=
1
;
cpu_exit
(
cpu_single_env
);
qemu_cond_signal
(
&
qemu_pause_cond
);
...
...
@@ -1136,6 +1144,7 @@ static void tcg_exec_all(void)
}
for
(;
next_cpu
!=
NULL
&&
!
exit_request
;
next_cpu
=
next_cpu
->
next_cpu
)
{
CPUArchState
*
env
=
next_cpu
;
CPUState
*
cpu
=
ENV_GET_CPU
(
env
);
qemu_clock_enable
(
vm_clock
,
(
env
->
singlestep_enabled
&
SSTEP_NOTIMER
)
==
0
);
...
...
@@ -1146,7 +1155,7 @@ static void tcg_exec_all(void)
cpu_handle_guest_debug
(
env
);
break
;
}
}
else
if
(
env
->
stop
||
env
->
stopped
)
{
}
else
if
(
cpu
->
stop
||
env
->
stopped
)
{
break
;
}
}
...
...
include/qemu/cpu.h
浏览文件 @
4fdeee7c
...
...
@@ -55,6 +55,7 @@ typedef struct CPUClass {
/**
* CPUState:
* @created: Indicates whether the CPU thread has been successfully created.
* @stop: Indicates a pending stop request.
*
* State of one CPU core or thread.
*/
...
...
@@ -69,6 +70,7 @@ struct CPUState {
#endif
bool
thread_kicked
;
bool
created
;
bool
stop
;
/* TODO Move common fields from CPUArchState here. */
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录