Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
mirror_resources
Qemu
提交
f324e766
Q
Qemu
项目概览
mirror_resources
/
Qemu
12 个月 前同步成功
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
Qemu
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f324e766
编写于
5月 02, 2012
作者:
A
Andreas Färber
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cpu: Move stopped field to CPUState
Change its type to bool. Signed-off-by:
N
Andreas Färber
<
afaerber@suse.de
>
上级
b6444a42
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
22 addition
and
14 deletion
+22
-14
cpu-defs.h
cpu-defs.h
+0
-1
cpus.c
cpus.c
+18
-12
hw/ppce500_spin.c
hw/ppce500_spin.c
+2
-1
include/qemu/cpu.h
include/qemu/cpu.h
+2
-0
未找到文件。
cpu-defs.h
浏览文件 @
f324e766
...
...
@@ -205,7 +205,6 @@ typedef struct CPUWatchpoint {
/* user data */
\
void *opaque; \
\
uint32_t stopped;
/* Artificially stopped */
\
struct QemuCond *halt_cond; \
struct qemu_work_item *queued_work_first, *queued_work_last; \
const char *cpu_model_str; \
...
...
cpus.c
浏览文件 @
f324e766
...
...
@@ -69,7 +69,7 @@ static bool cpu_thread_is_idle(CPUArchState *env)
if
(
cpu
->
stop
||
env
->
queued_work_first
)
{
return
false
;
}
if
(
env
->
stopped
||
!
runstate_is_running
())
{
if
(
cpu
->
stopped
||
!
runstate_is_running
())
{
return
true
;
}
if
(
!
env
->
halted
||
qemu_cpu_has_work
(
env
)
||
...
...
@@ -432,7 +432,9 @@ void cpu_synchronize_all_post_init(void)
int
cpu_is_stopped
(
CPUArchState
*
env
)
{
return
!
runstate_is_running
()
||
env
->
stopped
;
CPUState
*
cpu
=
ENV_GET_CPU
(
env
);
return
!
runstate_is_running
()
||
cpu
->
stopped
;
}
static
void
do_vm_stop
(
RunState
state
)
...
...
@@ -455,7 +457,7 @@ static int cpu_can_run(CPUArchState *env)
if
(
cpu
->
stop
)
{
return
0
;
}
if
(
env
->
stopped
||
!
runstate_is_running
())
{
if
(
cpu
->
stopped
||
!
runstate_is_running
())
{
return
0
;
}
return
1
;
...
...
@@ -463,9 +465,11 @@ static int cpu_can_run(CPUArchState *env)
static
void
cpu_handle_guest_debug
(
CPUArchState
*
env
)
{
CPUState
*
cpu
=
ENV_GET_CPU
(
env
);
gdb_set_stop_cpu
(
env
);
qemu_system_debug_request
();
env
->
stopped
=
1
;
cpu
->
stopped
=
true
;
}
static
void
cpu_signal
(
int
sig
)
...
...
@@ -693,7 +697,7 @@ static void qemu_wait_io_event_common(CPUArchState *env)
if
(
cpu
->
stop
)
{
cpu
->
stop
=
false
;
env
->
stopped
=
1
;
cpu
->
stopped
=
true
;
qemu_cond_signal
(
&
qemu_pause_cond
);
}
flush_queued_work
(
env
);
...
...
@@ -829,7 +833,7 @@ static void *qemu_tcg_cpu_thread_fn(void *arg)
qemu_cond_signal
(
&
qemu_cpu_cond
);
/* wait for initial kick-off after machine start */
while
(
first_cpu
->
stopped
)
{
while
(
ENV_GET_CPU
(
first_cpu
)
->
stopped
)
{
qemu_cond_wait
(
tcg_halt_cond
,
&
qemu_global_mutex
);
/* process any pending work */
...
...
@@ -930,7 +934,8 @@ static int all_vcpus_paused(void)
CPUArchState
*
penv
=
first_cpu
;
while
(
penv
)
{
if
(
!
penv
->
stopped
)
{
CPUState
*
pcpu
=
ENV_GET_CPU
(
penv
);
if
(
!
pcpu
->
stopped
)
{
return
0
;
}
penv
=
penv
->
next_cpu
;
...
...
@@ -957,7 +962,7 @@ void pause_all_vcpus(void)
while
(
penv
)
{
CPUState
*
pcpu
=
ENV_GET_CPU
(
penv
);
pcpu
->
stop
=
0
;
p
env
->
stopped
=
1
;
p
cpu
->
stopped
=
true
;
penv
=
penv
->
next_cpu
;
}
return
;
...
...
@@ -982,7 +987,7 @@ void resume_all_vcpus(void)
while
(
penv
)
{
CPUState
*
pcpu
=
ENV_GET_CPU
(
penv
);
pcpu
->
stop
=
false
;
p
env
->
stopped
=
0
;
p
cpu
->
stopped
=
false
;
qemu_cpu_kick
(
penv
);
penv
=
penv
->
next_cpu
;
}
...
...
@@ -1045,10 +1050,11 @@ static void qemu_dummy_start_vcpu(CPUArchState *env)
void
qemu_init_vcpu
(
void
*
_env
)
{
CPUArchState
*
env
=
_env
;
CPUState
*
cpu
=
ENV_GET_CPU
(
env
);
env
->
nr_cores
=
smp_cores
;
env
->
nr_threads
=
smp_threads
;
env
->
stopped
=
1
;
cpu
->
stopped
=
true
;
if
(
kvm_enabled
())
{
qemu_kvm_start_vcpu
(
env
);
}
else
if
(
tcg_enabled
())
{
...
...
@@ -1063,7 +1069,7 @@ void cpu_stop_current(void)
if
(
cpu_single_env
)
{
CPUState
*
cpu_single_cpu
=
ENV_GET_CPU
(
cpu_single_env
);
cpu_single_cpu
->
stop
=
false
;
cpu_single_
env
->
stopped
=
1
;
cpu_single_
cpu
->
stopped
=
true
;
cpu_exit
(
cpu_single_env
);
qemu_cond_signal
(
&
qemu_pause_cond
);
}
...
...
@@ -1155,7 +1161,7 @@ static void tcg_exec_all(void)
cpu_handle_guest_debug
(
env
);
break
;
}
}
else
if
(
cpu
->
stop
||
env
->
stopped
)
{
}
else
if
(
cpu
->
stop
||
cpu
->
stopped
)
{
break
;
}
}
...
...
hw/ppce500_spin.c
浏览文件 @
f324e766
...
...
@@ -92,6 +92,7 @@ static void mmubooke_create_initial_mapping(CPUPPCState *env,
static
void
spin_kick
(
void
*
data
)
{
SpinKick
*
kick
=
data
;
CPUState
*
cpu
=
CPU
(
kick
->
cpu
);
CPUPPCState
*
env
=
&
kick
->
cpu
->
env
;
SpinInfo
*
curspin
=
kick
->
spin
;
hwaddr
map_size
=
64
*
1024
*
1024
;
...
...
@@ -113,7 +114,7 @@ static void spin_kick(void *data)
env
->
halted
=
0
;
env
->
exception_index
=
-
1
;
env
->
stopped
=
0
;
cpu
->
stopped
=
false
;
qemu_cpu_kick
(
env
);
}
...
...
include/qemu/cpu.h
浏览文件 @
f324e766
...
...
@@ -56,6 +56,7 @@ typedef struct CPUClass {
* CPUState:
* @created: Indicates whether the CPU thread has been successfully created.
* @stop: Indicates a pending stop request.
* @stopped: Indicates the CPU has been artificially stopped.
*
* State of one CPU core or thread.
*/
...
...
@@ -71,6 +72,7 @@ struct CPUState {
bool
thread_kicked
;
bool
created
;
bool
stop
;
bool
stopped
;
/* TODO Move common fields from CPUArchState here. */
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录