Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
5ec3a23e
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看板
“d6e65d54f0fa980f891aa3166d85b6ffd7d541eb”上不存在“README.rst”
提交
5ec3a23e
编写于
12年前
作者:
A
Alexander Graf
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
serial: convert PIO to new memory api read/write
Signed-off-by:
N
Alexander Graf
<
agraf@suse.de
>
上级
1bebb0ad
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
17 addition
and
13 deletion
+17
-13
hw/serial.c
hw/serial.c
+17
-13
未找到文件。
hw/serial.c
浏览文件 @
5ec3a23e
...
...
@@ -26,6 +26,7 @@
#include "serial.h"
#include "qemu-char.h"
#include "qemu-timer.h"
#include "exec-memory.h"
//#define DEBUG_SERIAL
...
...
@@ -305,7 +306,8 @@ static void serial_xmit(void *opaque)
}
static
void
serial_ioport_write
(
void
*
opaque
,
uint32_t
addr
,
uint32_t
val
)
static
void
serial_ioport_write
(
void
*
opaque
,
hwaddr
addr
,
uint64_t
val
,
unsigned
size
)
{
SerialState
*
s
=
opaque
;
...
...
@@ -451,7 +453,7 @@ static void serial_ioport_write(void *opaque, uint32_t addr, uint32_t val)
}
}
static
uint
32_t
serial_ioport_read
(
void
*
opaque
,
uint32_t
addr
)
static
uint
64_t
serial_ioport_read
(
void
*
opaque
,
hwaddr
addr
,
unsigned
size
)
{
SerialState
*
s
=
opaque
;
uint32_t
ret
;
...
...
@@ -620,7 +622,7 @@ static int serial_post_load(void *opaque, int version_id)
s
->
fcr_vmstate
=
0
;
}
/* Initialize fcr via setter to perform essential side-effects */
serial_ioport_write
(
s
,
0x02
,
s
->
fcr_vmstate
);
serial_ioport_write
(
s
,
0x02
,
s
->
fcr_vmstate
,
1
);
serial_update_parameters
(
s
);
return
0
;
}
...
...
@@ -705,13 +707,14 @@ void serial_set_frequency(SerialState *s, uint32_t frequency)
serial_update_parameters
(
s
);
}
static
const
MemoryRegionPortio
serial_portio
[]
=
{
{
0
,
8
,
1
,
.
read
=
serial_ioport_read
,
.
write
=
serial_ioport_write
},
PORTIO_END_OF_LIST
()
};
const
MemoryRegionOps
serial_io_ops
=
{
.
old_portio
=
serial_portio
.
read
=
serial_ioport_read
,
.
write
=
serial_ioport_write
,
.
impl
=
{
.
min_access_size
=
1
,
.
max_access_size
=
1
,
},
.
endianness
=
DEVICE_LITTLE_ENDIAN
,
};
SerialState
*
serial_init
(
int
base
,
qemu_irq
irq
,
int
baudbase
,
...
...
@@ -728,8 +731,9 @@ SerialState *serial_init(int base, qemu_irq irq, int baudbase,
vmstate_register
(
NULL
,
base
,
&
vmstate_serial
,
s
);
register_ioport_write
(
base
,
8
,
1
,
serial_ioport_write
,
s
);
register_ioport_read
(
base
,
8
,
1
,
serial_ioport_read
,
s
);
memory_region_init_io
(
&
s
->
io
,
&
serial_io_ops
,
s
,
"serial"
,
8
);
memory_region_add_subregion
(
get_system_io
(),
base
,
&
s
->
io
);
return
s
;
}
...
...
@@ -738,7 +742,7 @@ static uint64_t serial_mm_read(void *opaque, hwaddr addr,
unsigned
size
)
{
SerialState
*
s
=
opaque
;
return
serial_ioport_read
(
s
,
addr
>>
s
->
it_shift
);
return
serial_ioport_read
(
s
,
addr
>>
s
->
it_shift
,
1
);
}
static
void
serial_mm_write
(
void
*
opaque
,
hwaddr
addr
,
...
...
@@ -746,7 +750,7 @@ static void serial_mm_write(void *opaque, hwaddr addr,
{
SerialState
*
s
=
opaque
;
value
&=
~
0u
>>
(
32
-
(
size
*
8
));
serial_ioport_write
(
s
,
addr
>>
s
->
it_shift
,
value
);
serial_ioport_write
(
s
,
addr
>>
s
->
it_shift
,
value
,
1
);
}
static
const
MemoryRegionOps
serial_mm_ops
[
3
]
=
{
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
新手
引导
客服
返回
顶部