Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
c0a93a9e
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看板
提交
c0a93a9e
编写于
12月 02, 2010
作者:
J
Juan Quintela
提交者:
Anthony Liguori
4月 22, 2011
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
vmstate: port cuda
Signed-off-by:
N
Juan Quintela
<
quintela@redhat.com
>
上级
4acd38ce
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
46 addition
and
70 deletion
+46
-70
hw/cuda.c
hw/cuda.c
+46
-70
未找到文件。
hw/cuda.c
浏览文件 @
c0a93a9e
...
...
@@ -644,80 +644,56 @@ static CPUReadMemoryFunc * const cuda_read[] = {
&
cuda_readl
,
};
static
void
cuda_save_timer
(
QEMUFile
*
f
,
CUDATimer
*
s
)
static
bool
cuda_timer_exist
(
void
*
opaque
,
int
version_id
)
{
qemu_put_be16s
(
f
,
&
s
->
latch
);
qemu_put_be16s
(
f
,
&
s
->
counter_value
);
qemu_put_sbe64s
(
f
,
&
s
->
load_time
);
qemu_put_sbe64s
(
f
,
&
s
->
next_irq_time
);
if
(
s
->
timer
)
qemu_put_timer
(
f
,
s
->
timer
);
}
static
void
cuda_save
(
QEMUFile
*
f
,
void
*
opaque
)
{
CUDAState
*
s
=
(
CUDAState
*
)
opaque
;
qemu_put_ubyte
(
f
,
s
->
b
);
qemu_put_ubyte
(
f
,
s
->
a
);
qemu_put_ubyte
(
f
,
s
->
dirb
);
qemu_put_ubyte
(
f
,
s
->
dira
);
qemu_put_ubyte
(
f
,
s
->
sr
);
qemu_put_ubyte
(
f
,
s
->
acr
);
qemu_put_ubyte
(
f
,
s
->
pcr
);
qemu_put_ubyte
(
f
,
s
->
ifr
);
qemu_put_ubyte
(
f
,
s
->
ier
);
qemu_put_ubyte
(
f
,
s
->
anh
);
qemu_put_sbe32s
(
f
,
&
s
->
data_in_size
);
qemu_put_sbe32s
(
f
,
&
s
->
data_in_index
);
qemu_put_sbe32s
(
f
,
&
s
->
data_out_index
);
qemu_put_ubyte
(
f
,
s
->
autopoll
);
qemu_put_buffer
(
f
,
s
->
data_in
,
sizeof
(
s
->
data_in
));
qemu_put_buffer
(
f
,
s
->
data_out
,
sizeof
(
s
->
data_out
));
qemu_put_be32s
(
f
,
&
s
->
tick_offset
);
cuda_save_timer
(
f
,
&
s
->
timers
[
0
]);
cuda_save_timer
(
f
,
&
s
->
timers
[
1
]);
}
CUDATimer
*
s
=
opaque
;
static
void
cuda_load_timer
(
QEMUFile
*
f
,
CUDATimer
*
s
)
{
qemu_get_be16s
(
f
,
&
s
->
latch
);
qemu_get_be16s
(
f
,
&
s
->
counter_value
);
qemu_get_sbe64s
(
f
,
&
s
->
load_time
);
qemu_get_sbe64s
(
f
,
&
s
->
next_irq_time
);
if
(
s
->
timer
)
qemu_get_timer
(
f
,
s
->
timer
);
return
s
->
timer
!=
NULL
;
}
static
int
cuda_load
(
QEMUFile
*
f
,
void
*
opaque
,
int
version_id
)
{
CUDAState
*
s
=
(
CUDAState
*
)
opaque
;
if
(
version_id
!=
1
)
return
-
EINVAL
;
s
->
b
=
qemu_get_ubyte
(
f
);
s
->
a
=
qemu_get_ubyte
(
f
);
s
->
dirb
=
qemu_get_ubyte
(
f
);
s
->
dira
=
qemu_get_ubyte
(
f
);
s
->
sr
=
qemu_get_ubyte
(
f
);
s
->
acr
=
qemu_get_ubyte
(
f
);
s
->
pcr
=
qemu_get_ubyte
(
f
);
s
->
ifr
=
qemu_get_ubyte
(
f
);
s
->
ier
=
qemu_get_ubyte
(
f
);
s
->
anh
=
qemu_get_ubyte
(
f
);
qemu_get_sbe32s
(
f
,
&
s
->
data_in_size
);
qemu_get_sbe32s
(
f
,
&
s
->
data_in_index
);
qemu_get_sbe32s
(
f
,
&
s
->
data_out_index
);
s
->
autopoll
=
qemu_get_ubyte
(
f
);
qemu_get_buffer
(
f
,
s
->
data_in
,
sizeof
(
s
->
data_in
));
qemu_get_buffer
(
f
,
s
->
data_out
,
sizeof
(
s
->
data_out
));
qemu_get_be32s
(
f
,
&
s
->
tick_offset
);
cuda_load_timer
(
f
,
&
s
->
timers
[
0
]);
cuda_load_timer
(
f
,
&
s
->
timers
[
1
]);
static
const
VMStateDescription
vmstate_cuda_timer
=
{
.
name
=
"cuda_timer"
,
.
version_id
=
0
,
.
minimum_version_id
=
0
,
.
minimum_version_id_old
=
0
,
.
fields
=
(
VMStateField
[])
{
VMSTATE_UINT16
(
latch
,
CUDATimer
),
VMSTATE_UINT16
(
counter_value
,
CUDATimer
),
VMSTATE_INT64
(
load_time
,
CUDATimer
),
VMSTATE_INT64
(
next_irq_time
,
CUDATimer
),
VMSTATE_TIMER_TEST
(
timer
,
CUDATimer
,
cuda_timer_exist
),
VMSTATE_END_OF_LIST
()
}
};
return
0
;
}
static
const
VMStateDescription
vmstate_cuda
=
{
.
name
=
"cuda"
,
.
version_id
=
1
,
.
minimum_version_id
=
1
,
.
minimum_version_id_old
=
1
,
.
fields
=
(
VMStateField
[])
{
VMSTATE_UINT8
(
a
,
CUDAState
),
VMSTATE_UINT8
(
b
,
CUDAState
),
VMSTATE_UINT8
(
dira
,
CUDAState
),
VMSTATE_UINT8
(
dirb
,
CUDAState
),
VMSTATE_UINT8
(
sr
,
CUDAState
),
VMSTATE_UINT8
(
acr
,
CUDAState
),
VMSTATE_UINT8
(
pcr
,
CUDAState
),
VMSTATE_UINT8
(
ifr
,
CUDAState
),
VMSTATE_UINT8
(
ier
,
CUDAState
),
VMSTATE_UINT8
(
anh
,
CUDAState
),
VMSTATE_INT32
(
data_in_size
,
CUDAState
),
VMSTATE_INT32
(
data_in_index
,
CUDAState
),
VMSTATE_INT32
(
data_out_index
,
CUDAState
),
VMSTATE_UINT8
(
autopoll
,
CUDAState
),
VMSTATE_BUFFER
(
data_in
,
CUDAState
),
VMSTATE_BUFFER
(
data_out
,
CUDAState
),
VMSTATE_UINT32
(
tick_offset
,
CUDAState
),
VMSTATE_STRUCT_ARRAY
(
timers
,
CUDAState
,
2
,
1
,
vmstate_cuda_timer
,
CUDATimer
),
VMSTATE_END_OF_LIST
()
}
};
static
void
cuda_reset
(
void
*
opaque
)
{
...
...
@@ -764,6 +740,6 @@ void cuda_init (int *cuda_mem_index, qemu_irq irq)
s
->
adb_poll_timer
=
qemu_new_timer_ns
(
vm_clock
,
cuda_adb_poll
,
s
);
*
cuda_mem_index
=
cpu_register_io_memory
(
cuda_read
,
cuda_write
,
s
,
DEVICE_NATIVE_ENDIAN
);
register_savevm
(
NULL
,
"cuda"
,
-
1
,
1
,
cuda_save
,
cuda_load
,
s
);
vmstate_register
(
NULL
,
-
1
,
&
vmstate_cuda
,
s
);
qemu_register_reset
(
cuda_reset
,
s
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录