Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
90d37239
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看板
提交
90d37239
编写于
5月 14, 2009
作者:
P
Paul Brook
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
SSP bus framework
Signed-off-by:
N
Paul Brook
<
paul@codesourcery.com
>
上级
1de9610c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
95 addition
and
1 deletion
+95
-1
Makefile
Makefile
+1
-1
hw/ssi.c
hw/ssi.c
+52
-0
hw/ssi.h
hw/ssi.h
+41
-0
qemu-common.h
qemu-common.h
+1
-0
未找到文件。
Makefile
浏览文件 @
90d37239
...
...
@@ -101,7 +101,7 @@ OBJS+=bt-hci-csr.o
OBJS
+=
buffered_file.o migration.o migration-tcp.o net.o qemu-sockets.o
OBJS
+=
qemu-char.o aio.o net-checksum.o savevm.o cache-utils.o
OBJS
+=
msmouse.o ps2.o
OBJS
+=
qdev.o
OBJS
+=
qdev.o
ssi.o
ifdef
CONFIG_BRLAPI
OBJS
+=
baum.o
...
...
hw/ssi.c
0 → 100644
浏览文件 @
90d37239
/*
* QEMU Synchronous Serial Interface support
*
* Copyright (c) 2009 CodeSourcery.
* Written by Paul Brook
*
* This code is licenced under the GNU GPL v2.
*/
#include "ssi.h"
struct
SSIBus
{
SSISlave
*
slave
;
};
static
void
ssi_slave_init
(
DeviceState
*
dev
,
void
*
opaque
)
{
SSISlaveInfo
*
info
=
opaque
;
SSISlave
*
s
=
SSI_SLAVE_FROM_QDEV
(
dev
);
SSIBus
*
bus
=
qdev_get_bus
(
dev
);
bus
->
slave
=
s
;
s
->
info
=
info
;
info
->
init
(
s
);
}
void
ssi_register_slave
(
const
char
*
name
,
int
size
,
SSISlaveInfo
*
info
)
{
assert
(
size
>=
sizeof
(
SSISlave
));
qdev_register
(
name
,
size
,
ssi_slave_init
,
info
);
}
DeviceState
*
ssi_create_slave
(
SSIBus
*
bus
,
const
char
*
name
)
{
DeviceState
*
dev
;
dev
=
qdev_create
(
bus
,
name
);
qdev_init
(
dev
);
return
dev
;
}
SSIBus
*
ssi_create_bus
(
void
)
{
return
qemu_mallocz
(
sizeof
(
SSIBus
));
}
uint32_t
ssi_transfer
(
SSIBus
*
bus
,
uint32_t
val
)
{
if
(
!
bus
->
slave
)
{
return
0
;
}
return
bus
->
slave
->
info
->
transfer
(
bus
->
slave
,
val
);
}
hw/ssi.h
0 → 100644
浏览文件 @
90d37239
/* QEMU Synchronous Serial Interface support. */
/* In principle SSI is a point-point interface. As such the qemu
implementation has a single slave device on a "bus".
However it is fairly common for boards to have multiple slaves
connected to a single master, and select devices with an external
chip select. This is implemented in qemu by having an explicit mux device.
It is assumed that master and slave are both using the same transfer width.
*/
#ifndef QEMU_SSI_H
#define QEMU_SSI_H
#include "qdev.h"
typedef
struct
SSISlave
SSISlave
;
/* Slave devices. */
typedef
struct
{
void
(
*
init
)(
SSISlave
*
dev
);
uint32_t
(
*
transfer
)(
SSISlave
*
dev
,
uint32_t
val
);
}
SSISlaveInfo
;
struct
SSISlave
{
DeviceState
qdev
;
SSISlaveInfo
*
info
;
};
#define SSI_SLAVE_FROM_QDEV(dev) DO_UPCAST(SSISlave, qdev, dev)
#define FROM_SSI_SLAVE(type, dev) DO_UPCAST(type, ssidev, dev)
void
ssi_register_slave
(
const
char
*
name
,
int
size
,
SSISlaveInfo
*
info
);
DeviceState
*
ssi_create_slave
(
SSIBus
*
bus
,
const
char
*
name
);
/* Master interface. */
SSIBus
*
ssi_create_bus
(
void
);
uint32_t
ssi_transfer
(
SSIBus
*
bus
,
uint32_t
val
);
#endif
qemu-common.h
浏览文件 @
90d37239
...
...
@@ -183,6 +183,7 @@ typedef struct MouseTransformInfo MouseTransformInfo;
typedef
struct
uWireSlave
uWireSlave
;
typedef
struct
I2SCodec
I2SCodec
;
typedef
struct
DeviceState
DeviceState
;
typedef
struct
SSIBus
SSIBus
;
/* CPU save/load. */
void
cpu_save
(
QEMUFile
*
f
,
void
*
opaque
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录