Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
cbc3a6a4
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
cbc3a6a4
编写于
6月 07, 2016
作者:
A
Artyom Tarasenko
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
target-sparc: implement UA2005 GL register
Signed-off-by:
N
Artyom Tarasenko
<
atar4qemu@gmail.com
>
上级
6e040755
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
58 addition
and
7 deletion
+58
-7
target/sparc/cpu.c
target/sparc/cpu.c
+10
-3
target/sparc/cpu.h
target/sparc/cpu.h
+2
-0
target/sparc/helper.h
target/sparc/helper.h
+1
-0
target/sparc/int64_helper.c
target/sparc/int64_helper.c
+6
-0
target/sparc/translate.c
target/sparc/translate.c
+1
-2
target/sparc/win_helper.c
target/sparc/win_helper.c
+38
-2
未找到文件。
target/sparc/cpu.c
浏览文件 @
cbc3a6a4
...
...
@@ -57,9 +57,13 @@ static void sparc_cpu_reset(CPUState *s)
env
->
psrps
=
1
;
#endif
#ifdef TARGET_SPARC64
env
->
pstate
=
PS_PRIV
|
PS_RED
|
PS_PEF
|
PS_AG
;
env
->
pstate
=
PS_PRIV
|
PS_RED
|
PS_PEF
;
if
(
!
cpu_has_hypervisor
(
env
))
{
env
->
pstate
|=
PS_AG
;
}
env
->
hpstate
=
cpu_has_hypervisor
(
env
)
?
HS_PRIV
:
0
;
env
->
tl
=
env
->
maxtl
;
env
->
gl
=
2
;
cpu_tsptr
(
env
)
->
tt
=
TT_POWER_ON_RESET
;
env
->
lsu
=
0
;
#else
...
...
@@ -744,14 +748,17 @@ void sparc_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,
cpu_print_cc
(
f
,
cpu_fprintf
,
cpu_get_ccr
(
env
)
<<
PSR_CARRY_SHIFT
);
cpu_fprintf
(
f
,
" xcc: "
);
cpu_print_cc
(
f
,
cpu_fprintf
,
cpu_get_ccr
(
env
)
<<
(
PSR_CARRY_SHIFT
-
4
));
cpu_fprintf
(
f
,
") asi: %02x tl: %d pil: %x
\n
"
,
env
->
asi
,
env
->
tl
,
env
->
psrpil
);
cpu_fprintf
(
f
,
") asi: %02x tl: %d pil: %x gl: %d
\n
"
,
env
->
asi
,
env
->
tl
,
env
->
psrpil
,
env
->
gl
);
cpu_fprintf
(
f
,
"tbr: "
TARGET_FMT_lx
" hpstate: "
TARGET_FMT_lx
" htba: "
TARGET_FMT_lx
"
\n
"
,
env
->
tbr
,
env
->
hpstate
,
env
->
htba
);
cpu_fprintf
(
f
,
"cansave: %d canrestore: %d otherwin: %d wstate: %d "
"cleanwin: %d cwp: %d
\n
"
,
env
->
cansave
,
env
->
canrestore
,
env
->
otherwin
,
env
->
wstate
,
env
->
cleanwin
,
env
->
nwindows
-
1
-
env
->
cwp
);
cpu_fprintf
(
f
,
"fsr: "
TARGET_FMT_lx
" y: "
TARGET_FMT_lx
" fprs: "
TARGET_FMT_lx
"
\n
"
,
env
->
fsr
,
env
->
y
,
env
->
fprs
);
#else
cpu_fprintf
(
f
,
"psr: %08x (icc: "
,
cpu_get_psr
(
env
));
cpu_print_cc
(
f
,
cpu_fprintf
,
cpu_get_psr
(
env
));
...
...
target/sparc/cpu.h
浏览文件 @
cbc3a6a4
...
...
@@ -515,6 +515,7 @@ struct CPUSPARCState {
uint64_t
bgregs
[
8
];
/* backup for normal global registers */
uint64_t
igregs
[
8
];
/* interrupt general registers */
uint64_t
mgregs
[
8
];
/* mmu general registers */
uint64_t
glregs
[
8
*
MAXTL_MAX
];
uint64_t
fprs
;
uint64_t
tick_cmpr
,
stick_cmpr
;
CPUTimer
*
tick
,
*
stick
;
...
...
@@ -615,6 +616,7 @@ void cpu_put_ccr(CPUSPARCState *env1, target_ulong val);
target_ulong
cpu_get_cwp64
(
CPUSPARCState
*
env1
);
void
cpu_put_cwp64
(
CPUSPARCState
*
env1
,
int
cwp
);
void
cpu_change_pstate
(
CPUSPARCState
*
env1
,
uint32_t
new_pstate
);
void
cpu_gl_switch_gregs
(
CPUSPARCState
*
env
,
uint32_t
new_gl
);
#endif
int
cpu_cwp_inc
(
CPUSPARCState
*
env1
,
int
cwp
);
int
cpu_cwp_dec
(
CPUSPARCState
*
env1
,
int
cwp
);
...
...
target/sparc/helper.h
浏览文件 @
cbc3a6a4
...
...
@@ -5,6 +5,7 @@ DEF_HELPER_1(rdpsr, tl, env)
DEF_HELPER_1
(
power_down
,
void
,
env
)
#else
DEF_HELPER_FLAGS_2
(
wrpil
,
TCG_CALL_NO_RWG
,
void
,
env
,
tl
)
DEF_HELPER_2
(
wrgl
,
void
,
env
,
tl
)
DEF_HELPER_2
(
wrpstate
,
void
,
env
,
tl
)
DEF_HELPER_1
(
done
,
void
,
env
)
DEF_HELPER_1
(
retry
,
void
,
env
)
...
...
target/sparc/int64_helper.c
浏览文件 @
cbc3a6a4
...
...
@@ -146,6 +146,12 @@ void sparc_cpu_do_interrupt(CPUState *cs)
}
}
if
(
env
->
def
->
features
&
CPU_FEATURE_GL
)
{
tsptr
->
tstate
|=
(
env
->
gl
&
7ULL
)
<<
40
;
cpu_gl_switch_gregs
(
env
,
env
->
gl
+
1
);
env
->
gl
++
;
}
switch
(
intno
)
{
case
TT_IVEC
:
if
(
!
cpu_has_hypervisor
(
env
))
{
...
...
target/sparc/translate.c
浏览文件 @
cbc3a6a4
...
...
@@ -4558,8 +4558,7 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn)
break
;
case
16
:
// UA2005 gl
CHECK_IU_FEATURE
(
dc
,
GL
);
tcg_gen_st32_tl
(
cpu_tmp0
,
cpu_env
,
offsetof
(
CPUSPARCState
,
gl
));
gen_helper_wrgl
(
cpu_env
,
cpu_tmp0
);
break
;
case
26
:
// UA2005 strand status
CHECK_IU_FEATURE
(
dc
,
HYPV
);
...
...
target/sparc/win_helper.c
浏览文件 @
cbc3a6a4
...
...
@@ -290,6 +290,10 @@ void helper_wrcwp(CPUSPARCState *env, target_ulong new_cwp)
static
inline
uint64_t
*
get_gregset
(
CPUSPARCState
*
env
,
uint32_t
pstate
)
{
if
(
env
->
def
->
features
&
CPU_FEATURE_GL
)
{
return
env
->
glregs
+
(
env
->
gl
&
7
)
*
8
;
}
switch
(
pstate
)
{
default:
trace_win_helper_gregset_error
(
pstate
);
...
...
@@ -305,14 +309,40 @@ static inline uint64_t *get_gregset(CPUSPARCState *env, uint32_t pstate)
}
}
static
inline
uint64_t
*
get_gl_gregset
(
CPUSPARCState
*
env
,
uint32_t
gl
)
{
return
env
->
glregs
+
(
gl
&
7
)
*
8
;
}
/* Switch global register bank */
void
cpu_gl_switch_gregs
(
CPUSPARCState
*
env
,
uint32_t
new_gl
)
{
uint64_t
*
src
,
*
dst
;
src
=
get_gl_gregset
(
env
,
new_gl
);
dst
=
get_gl_gregset
(
env
,
env
->
gl
);
if
(
src
!=
dst
)
{
memcpy32
(
dst
,
env
->
gregs
);
memcpy32
(
env
->
gregs
,
src
);
}
}
void
helper_wrgl
(
CPUSPARCState
*
env
,
target_ulong
new_gl
)
{
cpu_gl_switch_gregs
(
env
,
new_gl
&
7
);
env
->
gl
=
new_gl
&
7
;
}
void
cpu_change_pstate
(
CPUSPARCState
*
env
,
uint32_t
new_pstate
)
{
uint32_t
pstate_regs
,
new_pstate_regs
;
uint64_t
*
src
,
*
dst
;
if
(
env
->
def
->
features
&
CPU_FEATURE_GL
)
{
/* PS_AG is not implemented in this case */
new_pstate
&=
~
PS_AG
;
/* PS_AG, IG and MG are not implemented in this case */
new_pstate
&=
~
(
PS_AG
|
PS_IG
|
PS_MG
);
env
->
pstate
=
new_pstate
;
return
;
}
pstate_regs
=
env
->
pstate
&
0xc01
;
...
...
@@ -367,7 +397,10 @@ void helper_done(CPUSPARCState *env)
cpu_change_pstate
(
env
,
(
tsptr
->
tstate
>>
8
)
&
0xf3f
);
cpu_put_cwp64
(
env
,
tsptr
->
tstate
&
0xff
);
if
(
cpu_has_hypervisor
(
env
))
{
uint32_t
new_gl
=
(
tsptr
->
tstate
>>
40
)
&
7
;
env
->
hpstate
=
env
->
htstate
[
env
->
tl
];
cpu_gl_switch_gregs
(
env
,
new_gl
);
env
->
gl
=
new_gl
;
}
env
->
tl
--
;
...
...
@@ -391,7 +424,10 @@ void helper_retry(CPUSPARCState *env)
cpu_change_pstate
(
env
,
(
tsptr
->
tstate
>>
8
)
&
0xf3f
);
cpu_put_cwp64
(
env
,
tsptr
->
tstate
&
0xff
);
if
(
cpu_has_hypervisor
(
env
))
{
uint32_t
new_gl
=
(
tsptr
->
tstate
>>
40
)
&
7
;
env
->
hpstate
=
env
->
htstate
[
env
->
tl
];
cpu_gl_switch_gregs
(
env
,
new_gl
);
env
->
gl
=
new_gl
;
}
env
->
tl
--
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录