Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
cc01cc8e
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看板
提交
cc01cc8e
编写于
3月 27, 2010
作者:
A
Aurelien Jarno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tcg-mips: add guest base support
Signed-off-by:
N
Aurelien Jarno
<
aurelien@aurel32.net
>
上级
489722cf
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
42 addition
and
29 deletion
+42
-29
configure
configure
+3
-0
tcg/mips/tcg-target.c
tcg/mips/tcg-target.c
+36
-29
tcg/mips/tcg-target.h
tcg/mips/tcg-target.h
+3
-0
未找到文件。
configure
浏览文件 @
cc01cc8e
...
...
@@ -707,6 +707,9 @@ case "$cpu" in
ppc
*
)
host_guest_base
=
"yes"
;;
mips
*
)
host_guest_base
=
"yes"
;;
esac
[
-z
"
$guest_base
"
]
&&
guest_base
=
"
$host_guest_base
"
...
...
tcg/mips/tcg-target.c
浏览文件 @
cc01cc8e
...
...
@@ -222,8 +222,8 @@ static int target_parse_constraint(TCGArgConstraint *ct, const char **pct_str)
case
'S'
:
/* qemu_st constraint */
ct
->
ct
|=
TCG_CT_REG
;
tcg_regset_set
(
ct
->
u
.
regs
,
0xffffffff
);
#if defined(CONFIG_SOFTMMU)
tcg_regset_reset_reg
(
ct
->
u
.
regs
,
TCG_REG_A0
);
#if defined(CONFIG_SOFTMMU)
# if TARGET_LONG_BITS == 64
tcg_regset_reset_reg
(
ct
->
u
.
regs
,
TCG_REG_A1
);
# endif
...
...
@@ -858,54 +858,55 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args,
tcg_out_opc_imm
(
s
,
OPC_LW
,
TCG_REG_A0
,
TCG_REG_A0
,
offsetof
(
CPUState
,
tlb_table
[
mem_index
][
0
].
addend
)
+
addr_meml
);
tcg_out_opc_reg
(
s
,
OPC_ADDU
,
TCG_REG_V0
,
TCG_REG_A0
,
addr_regl
);
addr_reg1
=
TCG_REG_V0
;
#else
if
(
GUEST_BASE
==
(
int16_t
)
GUEST_BASE
)
{
tcg_out_opc_imm
(
s
,
OPC_ADDIU
,
TCG_REG_V0
,
addr_reg1
,
GUEST_BASE
);
}
else
{
tcg_out_movi
(
s
,
TCG_TYPE_PTR
,
TCG_REG_V0
,
GUEST_BASE
);
tcg_out_opc_reg
(
s
,
OPC_ADDU
,
TCG_REG_V0
,
TCG_REG_V0
,
addr_reg1
);
}
#endif
switch
(
opc
)
{
case
0
:
tcg_out_opc_imm
(
s
,
OPC_LBU
,
data_reg1
,
addr_reg1
,
0
);
tcg_out_opc_imm
(
s
,
OPC_LBU
,
data_reg1
,
TCG_REG_V0
,
0
);
break
;
case
0
|
4
:
tcg_out_opc_imm
(
s
,
OPC_LB
,
data_reg1
,
addr_reg1
,
0
);
tcg_out_opc_imm
(
s
,
OPC_LB
,
data_reg1
,
TCG_REG_V0
,
0
);
break
;
case
1
:
if
(
TCG_NEED_BSWAP
)
{
tcg_out_opc_imm
(
s
,
OPC_LHU
,
TCG_REG_T0
,
addr_reg1
,
0
);
tcg_out_opc_imm
(
s
,
OPC_LHU
,
TCG_REG_T0
,
TCG_REG_V0
,
0
);
tcg_out_bswap16
(
s
,
data_reg1
,
TCG_REG_T0
);
}
else
{
tcg_out_opc_imm
(
s
,
OPC_LHU
,
data_reg1
,
addr_reg1
,
0
);
tcg_out_opc_imm
(
s
,
OPC_LHU
,
data_reg1
,
TCG_REG_V0
,
0
);
}
break
;
case
1
|
4
:
if
(
TCG_NEED_BSWAP
)
{
tcg_out_opc_imm
(
s
,
OPC_LHU
,
TCG_REG_T0
,
addr_reg1
,
0
);
tcg_out_opc_imm
(
s
,
OPC_LHU
,
TCG_REG_T0
,
TCG_REG_V0
,
0
);
tcg_out_bswap16s
(
s
,
data_reg1
,
TCG_REG_T0
);
}
else
{
tcg_out_opc_imm
(
s
,
OPC_LH
,
data_reg1
,
addr_reg1
,
0
);
tcg_out_opc_imm
(
s
,
OPC_LH
,
data_reg1
,
TCG_REG_V0
,
0
);
}
break
;
case
2
:
if
(
TCG_NEED_BSWAP
)
{
tcg_out_opc_imm
(
s
,
OPC_LW
,
TCG_REG_T0
,
addr_reg1
,
0
);
tcg_out_opc_imm
(
s
,
OPC_LW
,
TCG_REG_T0
,
TCG_REG_V0
,
0
);
tcg_out_bswap32
(
s
,
data_reg1
,
TCG_REG_T0
);
}
else
{
tcg_out_opc_imm
(
s
,
OPC_LW
,
data_reg1
,
addr_reg1
,
0
);
tcg_out_opc_imm
(
s
,
OPC_LW
,
data_reg1
,
TCG_REG_V0
,
0
);
}
break
;
case
3
:
#if !defined(CONFIG_SOFTMMU)
tcg_out_mov
(
s
,
TCG_REG_V0
,
addr_reg1
);
addr_reg1
=
TCG_REG_V0
;
#endif
if
(
TCG_NEED_BSWAP
)
{
tcg_out_opc_imm
(
s
,
OPC_LW
,
TCG_REG_T0
,
addr_reg1
,
4
);
tcg_out_opc_imm
(
s
,
OPC_LW
,
TCG_REG_T0
,
TCG_REG_V0
,
4
);
tcg_out_bswap32
(
s
,
data_reg1
,
TCG_REG_T0
);
tcg_out_opc_imm
(
s
,
OPC_LW
,
TCG_REG_T0
,
addr_reg1
,
0
);
tcg_out_opc_imm
(
s
,
OPC_LW
,
TCG_REG_T0
,
TCG_REG_V0
,
0
);
tcg_out_bswap32
(
s
,
data_reg2
,
TCG_REG_T0
);
}
else
{
tcg_out_opc_imm
(
s
,
OPC_LW
,
data_reg1
,
addr_reg1
,
0
);
tcg_out_opc_imm
(
s
,
OPC_LW
,
data_reg2
,
addr_reg1
,
4
);
tcg_out_opc_imm
(
s
,
OPC_LW
,
data_reg1
,
TCG_REG_V0
,
0
);
tcg_out_opc_imm
(
s
,
OPC_LW
,
data_reg2
,
TCG_REG_V0
,
4
);
}
break
;
default:
...
...
@@ -1044,39 +1045,45 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args,
tcg_out_opc_imm
(
s
,
OPC_LW
,
TCG_REG_A0
,
TCG_REG_A0
,
offsetof
(
CPUState
,
tlb_table
[
mem_index
][
0
].
addend
)
+
addr_meml
);
tcg_out_opc_reg
(
s
,
OPC_ADDU
,
TCG_REG_A0
,
TCG_REG_A0
,
addr_regl
);
#else
if
(
GUEST_BASE
==
(
int16_t
)
GUEST_BASE
)
{
tcg_out_opc_imm
(
s
,
OPC_ADDIU
,
TCG_REG_A0
,
addr_reg1
,
GUEST_BASE
);
}
else
{
tcg_out_movi
(
s
,
TCG_TYPE_PTR
,
TCG_REG_A0
,
GUEST_BASE
);
tcg_out_opc_reg
(
s
,
OPC_ADDU
,
TCG_REG_A0
,
TCG_REG_A0
,
addr_reg1
);
}
addr_reg1
=
TCG_REG_A0
;
#endif
switch
(
opc
)
{
case
0
:
tcg_out_opc_imm
(
s
,
OPC_SB
,
data_reg1
,
addr_reg1
,
0
);
tcg_out_opc_imm
(
s
,
OPC_SB
,
data_reg1
,
TCG_REG_A0
,
0
);
break
;
case
1
:
if
(
TCG_NEED_BSWAP
)
{
tcg_out_bswap16
(
s
,
TCG_REG_T0
,
data_reg1
);
tcg_out_opc_imm
(
s
,
OPC_SH
,
TCG_REG_T0
,
addr_reg1
,
0
);
tcg_out_opc_imm
(
s
,
OPC_SH
,
TCG_REG_T0
,
TCG_REG_A0
,
0
);
}
else
{
tcg_out_opc_imm
(
s
,
OPC_SH
,
data_reg1
,
addr_reg1
,
0
);
tcg_out_opc_imm
(
s
,
OPC_SH
,
data_reg1
,
TCG_REG_A0
,
0
);
}
break
;
case
2
:
if
(
TCG_NEED_BSWAP
)
{
tcg_out_bswap32
(
s
,
TCG_REG_T0
,
data_reg1
);
tcg_out_opc_imm
(
s
,
OPC_SW
,
TCG_REG_T0
,
addr_reg1
,
0
);
tcg_out_opc_imm
(
s
,
OPC_SW
,
TCG_REG_T0
,
TCG_REG_A0
,
0
);
}
else
{
tcg_out_opc_imm
(
s
,
OPC_SW
,
data_reg1
,
addr_reg1
,
0
);
tcg_out_opc_imm
(
s
,
OPC_SW
,
data_reg1
,
TCG_REG_A0
,
0
);
}
break
;
case
3
:
if
(
TCG_NEED_BSWAP
)
{
tcg_out_bswap32
(
s
,
TCG_REG_T0
,
data_reg2
);
tcg_out_opc_imm
(
s
,
OPC_SW
,
TCG_REG_T0
,
addr_reg1
,
0
);
tcg_out_opc_imm
(
s
,
OPC_SW
,
TCG_REG_T0
,
TCG_REG_A0
,
0
);
tcg_out_bswap32
(
s
,
TCG_REG_T0
,
data_reg1
);
tcg_out_opc_imm
(
s
,
OPC_SW
,
TCG_REG_T0
,
addr_reg1
,
4
);
tcg_out_opc_imm
(
s
,
OPC_SW
,
TCG_REG_T0
,
TCG_REG_A0
,
4
);
}
else
{
tcg_out_opc_imm
(
s
,
OPC_SW
,
data_reg1
,
addr_reg1
,
0
);
tcg_out_opc_imm
(
s
,
OPC_SW
,
data_reg2
,
addr_reg1
,
4
);
tcg_out_opc_imm
(
s
,
OPC_SW
,
data_reg1
,
TCG_REG_A0
,
0
);
tcg_out_opc_imm
(
s
,
OPC_SW
,
data_reg2
,
TCG_REG_A0
,
4
);
}
break
;
default:
...
...
tcg/mips/tcg-target.h
浏览文件 @
cc01cc8e
...
...
@@ -99,6 +99,9 @@ enum {
/* Note: must be synced with dyngen-exec.h */
#define TCG_AREG0 TCG_REG_FP
/* guest base is supported */
#define TCG_TARGET_HAS_GUEST_BASE
#include <sys/cachectl.h>
static
inline
void
flush_icache_range
(
unsigned
long
start
,
unsigned
long
stop
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录