Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
d540bfe0
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看板
提交
d540bfe0
编写于
12年前
作者:
A
Alexander Graf
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
pckbd: convert PIO to new memory api read/write
Signed-off-by:
N
Alexander Graf
<
agraf@suse.de
>
上级
93ef4192
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
27 addition
and
21 deletion
+27
-21
hw/pckbd.c
hw/pckbd.c
+27
-21
未找到文件。
hw/pckbd.c
浏览文件 @
d540bfe0
...
...
@@ -194,7 +194,8 @@ static void kbd_update_aux_irq(void *opaque, int level)
kbd_update_irq
(
s
);
}
static
uint32_t
kbd_read_status
(
void
*
opaque
,
uint32_t
addr
)
static
uint64_t
kbd_read_status
(
void
*
opaque
,
hwaddr
addr
,
unsigned
size
)
{
KBDState
*
s
=
opaque
;
int
val
;
...
...
@@ -223,7 +224,8 @@ static void outport_write(KBDState *s, uint32_t val)
}
}
static
void
kbd_write_command
(
void
*
opaque
,
uint32_t
addr
,
uint32_t
val
)
static
void
kbd_write_command
(
void
*
opaque
,
hwaddr
addr
,
uint64_t
val
,
unsigned
size
)
{
KBDState
*
s
=
opaque
;
...
...
@@ -303,12 +305,13 @@ static void kbd_write_command(void *opaque, uint32_t addr, uint32_t val)
/* ignore that */
break
;
default:
fprintf
(
stderr
,
"qemu: unsupported keyboard cmd=0x%02x
\n
"
,
val
);
fprintf
(
stderr
,
"qemu: unsupported keyboard cmd=0x%02x
\n
"
,
(
int
)
val
);
break
;
}
}
static
uint32_t
kbd_read_data
(
void
*
opaque
,
uint32_t
addr
)
static
uint64_t
kbd_read_data
(
void
*
opaque
,
hwaddr
addr
,
unsigned
size
)
{
KBDState
*
s
=
opaque
;
uint32_t
val
;
...
...
@@ -322,7 +325,8 @@ static uint32_t kbd_read_data(void *opaque, uint32_t addr)
return
val
;
}
static
void
kbd_write_data
(
void
*
opaque
,
uint32_t
addr
,
uint32_t
val
)
static
void
kbd_write_data
(
void
*
opaque
,
hwaddr
addr
,
uint64_t
val
,
unsigned
size
)
{
KBDState
*
s
=
opaque
;
...
...
@@ -385,9 +389,9 @@ static uint32_t kbd_mm_readb (void *opaque, hwaddr addr)
KBDState
*
s
=
opaque
;
if
(
addr
&
s
->
mask
)
return
kbd_read_status
(
s
,
0
)
&
0xff
;
return
kbd_read_status
(
s
,
0
,
1
)
&
0xff
;
else
return
kbd_read_data
(
s
,
0
)
&
0xff
;
return
kbd_read_data
(
s
,
0
,
1
)
&
0xff
;
}
static
void
kbd_mm_writeb
(
void
*
opaque
,
hwaddr
addr
,
uint32_t
value
)
...
...
@@ -395,9 +399,9 @@ static void kbd_mm_writeb (void *opaque, hwaddr addr, uint32_t value)
KBDState
*
s
=
opaque
;
if
(
addr
&
s
->
mask
)
kbd_write_command
(
s
,
0
,
value
&
0xff
);
kbd_write_command
(
s
,
0
,
value
&
0xff
,
1
);
else
kbd_write_data
(
s
,
0
,
value
&
0xff
);
kbd_write_data
(
s
,
0
,
value
&
0xff
,
1
);
}
static
const
MemoryRegionOps
i8042_mmio_ops
=
{
...
...
@@ -459,22 +463,24 @@ static const VMStateDescription vmstate_kbd_isa = {
}
};
static
const
MemoryRegionPortio
i8042_data_portio
[]
=
{
{
0
,
1
,
1
,
.
read
=
kbd_read_data
,
.
write
=
kbd_write_data
},
PORTIO_END_OF_LIST
()
};
static
const
MemoryRegionPortio
i8042_cmd_portio
[]
=
{
{
0
,
1
,
1
,
.
read
=
kbd_read_status
,
.
write
=
kbd_write_command
},
PORTIO_END_OF_LIST
()
};
static
const
MemoryRegionOps
i8042_data_ops
=
{
.
old_portio
=
i8042_data_portio
.
read
=
kbd_read_data
,
.
write
=
kbd_write_data
,
.
impl
=
{
.
min_access_size
=
1
,
.
max_access_size
=
1
,
},
.
endianness
=
DEVICE_LITTLE_ENDIAN
,
};
static
const
MemoryRegionOps
i8042_cmd_ops
=
{
.
old_portio
=
i8042_cmd_portio
.
read
=
kbd_read_status
,
.
write
=
kbd_write_command
,
.
impl
=
{
.
min_access_size
=
1
,
.
max_access_size
=
1
,
},
.
endianness
=
DEVICE_LITTLE_ENDIAN
,
};
static
int
i8042_initfn
(
ISADevice
*
dev
)
...
...
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
新手
引导
客服
返回
顶部