Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
9ebec28b
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看板
提交
9ebec28b
编写于
8月 31, 2009
作者:
B
Blue Swirl
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Sparc32: timer field is never NULL
Signed-off-by:
N
Blue Swirl
<
blauwirbel@gmail.com
>
上级
55a6e51f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
12 addition
and
30 deletion
+12
-30
hw/slavio_timer.c
hw/slavio_timer.c
+12
-30
未找到文件。
hw/slavio_timer.c
浏览文件 @
9ebec28b
...
...
@@ -110,11 +110,8 @@ static void slavio_timer_get_out(CPUTimerState *t)
}
else
{
limit
=
t
->
limit
;
}
if
(
t
->
timer
)
{
count
=
limit
-
PERIODS_TO_LIMIT
(
ptimer_get_count
(
t
->
timer
));
}
else
{
count
=
0
;
}
count
=
limit
-
PERIODS_TO_LIMIT
(
ptimer_get_count
(
t
->
timer
));
DPRINTF
(
"get_out: limit %"
PRIx64
" count %x%08x
\n
"
,
t
->
limit
,
t
->
counthigh
,
t
->
count
);
t
->
count
=
count
&
TIMER_COUNT_MASK32
;
...
...
@@ -219,9 +216,7 @@ static void slavio_timer_mem_writel(void *opaque, target_phys_addr_t addr,
count
=
((
uint64_t
)
t
->
counthigh
<<
32
)
|
t
->
count
;
DPRINTF
(
"processor %d user timer set to %016"
PRIx64
"
\n
"
,
timer_index
,
count
);
if
(
t
->
timer
)
{
ptimer_set_count
(
t
->
timer
,
LIMIT_TO_PERIODS
(
t
->
limit
-
count
));
}
ptimer_set_count
(
t
->
timer
,
LIMIT_TO_PERIODS
(
t
->
limit
-
count
));
}
else
{
// set limit, reset counter
qemu_irq_lower
(
t
->
irq
);
...
...
@@ -247,22 +242,17 @@ static void slavio_timer_mem_writel(void *opaque, target_phys_addr_t addr,
count
=
((
uint64_t
)
t
->
counthigh
)
<<
32
|
t
->
count
;
DPRINTF
(
"processor %d user timer set to %016"
PRIx64
"
\n
"
,
timer_index
,
count
);
if
(
t
->
timer
)
{
ptimer_set_count
(
t
->
timer
,
LIMIT_TO_PERIODS
(
t
->
limit
-
count
));
}
ptimer_set_count
(
t
->
timer
,
LIMIT_TO_PERIODS
(
t
->
limit
-
count
));
}
else
DPRINTF
(
"not user timer
\n
"
);
break
;
case
TIMER_COUNTER_NORST
:
// set limit without resetting counter
t
->
limit
=
val
&
TIMER_MAX_COUNT32
;
if
(
t
->
timer
)
{
if
(
t
->
limit
==
0
)
{
/* free-run */
ptimer_set_limit
(
t
->
timer
,
LIMIT_TO_PERIODS
(
TIMER_MAX_COUNT32
),
0
);
}
else
{
ptimer_set_limit
(
t
->
timer
,
LIMIT_TO_PERIODS
(
t
->
limit
),
0
);
}
if
(
t
->
limit
==
0
)
{
/* free-run */
ptimer_set_limit
(
t
->
timer
,
LIMIT_TO_PERIODS
(
TIMER_MAX_COUNT32
),
0
);
}
else
{
ptimer_set_limit
(
t
->
timer
,
LIMIT_TO_PERIODS
(
t
->
limit
),
0
);
}
break
;
case
TIMER_STATUS
:
...
...
@@ -271,16 +261,12 @@ static void slavio_timer_mem_writel(void *opaque, target_phys_addr_t addr,
if
((
val
&
1
)
&&
!
t
->
running
)
{
DPRINTF
(
"processor %d user timer started
\n
"
,
timer_index
);
if
(
t
->
timer
)
{
ptimer_run
(
t
->
timer
,
0
);
}
ptimer_run
(
t
->
timer
,
0
);
t
->
running
=
1
;
}
else
if
(
!
(
val
&
1
)
&&
t
->
running
)
{
DPRINTF
(
"processor %d user timer stopped
\n
"
,
timer_index
);
if
(
t
->
timer
)
{
ptimer_stop
(
t
->
timer
);
}
ptimer_stop
(
t
->
timer
);
t
->
running
=
0
;
}
}
...
...
@@ -361,9 +347,7 @@ static void slavio_timer_save(QEMUFile *f, void *opaque)
qemu_put_be32s
(
f
,
&
curr_timer
->
counthigh
);
qemu_put_be32s
(
f
,
&
curr_timer
->
reached
);
qemu_put_be32s
(
f
,
&
curr_timer
->
running
);
if
(
curr_timer
->
timer
)
{
qemu_put_ptimer
(
f
,
curr_timer
->
timer
);
}
qemu_put_ptimer
(
f
,
curr_timer
->
timer
);
}
}
...
...
@@ -383,9 +367,7 @@ static int slavio_timer_load(QEMUFile *f, void *opaque, int version_id)
qemu_get_be32s
(
f
,
&
curr_timer
->
counthigh
);
qemu_get_be32s
(
f
,
&
curr_timer
->
reached
);
qemu_get_be32s
(
f
,
&
curr_timer
->
running
);
if
(
curr_timer
->
timer
)
{
qemu_get_ptimer
(
f
,
curr_timer
->
timer
);
}
qemu_get_ptimer
(
f
,
curr_timer
->
timer
);
}
return
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录