* [Qemu-devel] [PATCH v2 2/2] [SPARC] Fix TA0_Shutdown feature
@ 2011-05-27 16:25 Julien Grall
2011-05-27 17:21 ` Blue Swirl
0 siblings, 1 reply; 2+ messages in thread
From: Julien Grall @ 2011-05-27 16:25 UTC (permalink / raw)
To: qemu-devel; +Cc: Fabien Chouteau
Hello,
Since the last patch, I have added a special helper for trap 0. It
will be use when the TA0_Shutdown feature is enabled.
Signed-off-by: Grall Julien <julien.grall@gmail.com>
---
target-sparc/helper.h | 1 +
target-sparc/op_helper.c | 14 ++++++++++++++
target-sparc/translate.c | 6 ++----
3 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/target-sparc/helper.h b/target-sparc/helper.h
index 61ef03a..7f50c7a 100644
--- a/target-sparc/helper.h
+++ b/target-sparc/helper.h
@@ -86,6 +86,7 @@ DEF_HELPER_0(fcmpeq_fcc3, void)
#endif
DEF_HELPER_1(raise_exception, void, int)
DEF_HELPER_1(trap_always, void, int)
+DEF_HELPER_1(trap_0, void, int)
DEF_HELPER_0(shutdown, void)
#define F_HELPER_0_0(name) DEF_HELPER_0(f ## name, void)
#define F_HELPER_DQ_0_0(name) \
diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c
index 8f9d579..266080d 100644
--- a/target-sparc/op_helper.c
+++ b/target-sparc/op_helper.c
@@ -330,6 +330,19 @@ void HELPER(trap_always)(int tt)
do_interrupt(env);
}
+void HELPER(trap_0)(int tt)
+{
+#ifndef TARGET_SPARC64
+ if (env->psret == 0) {
+ helper_shutdown();
+ } else {
+ helper_trap_always(tt);
+ }
+#else
+ helper_trap_always(tt);
+#endif
+}
+
void helper_shutdown(void)
{
#if !defined(CONFIG_USER_ONLY)
diff --git a/target-sparc/translate.c b/target-sparc/translate.c
index 64035fc..13181ef 100644
--- a/target-sparc/translate.c
+++ b/target-sparc/translate.c
@@ -2037,10 +2037,8 @@ static void disas_sparc_insn(DisasContext * dc)
tcg_gen_trunc_tl_i32(cpu_tmp32, cpu_dst);
if (rs2 == 0 &&
- dc->def->features & CPU_FEATURE_TA0_SHUTDOWN) {
-
- gen_helper_shutdown();
-
+ (dc->def->features & CPU_FEATURE_TA0_SHUTDOWN)) {
+ gen_helper_trap_0(cpu_tmp32);
} else {
gen_helper_trap_always(cpu_tmp32);
}
--
1.7.4.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH v2 2/2] [SPARC] Fix TA0_Shutdown feature
2011-05-27 16:25 [Qemu-devel] [PATCH v2 2/2] [SPARC] Fix TA0_Shutdown feature Julien Grall
@ 2011-05-27 17:21 ` Blue Swirl
0 siblings, 0 replies; 2+ messages in thread
From: Blue Swirl @ 2011-05-27 17:21 UTC (permalink / raw)
To: Julien Grall; +Cc: qemu-devel, Fabien Chouteau
On Fri, May 27, 2011 at 7:25 PM, Julien Grall <julien.grall@gmail.com> wrote:
> Hello,
>
> Since the last patch, I have added a special helper for trap 0. It
> will be use when the TA0_Shutdown feature is enabled.
This patch looks OK now.
> Signed-off-by: Grall Julien <julien.grall@gmail.com>
> ---
> target-sparc/helper.h | 1 +
> target-sparc/op_helper.c | 14 ++++++++++++++
> target-sparc/translate.c | 6 ++----
> 3 files changed, 17 insertions(+), 4 deletions(-)
>
> diff --git a/target-sparc/helper.h b/target-sparc/helper.h
> index 61ef03a..7f50c7a 100644
> --- a/target-sparc/helper.h
> +++ b/target-sparc/helper.h
> @@ -86,6 +86,7 @@ DEF_HELPER_0(fcmpeq_fcc3, void)
> #endif
> DEF_HELPER_1(raise_exception, void, int)
> DEF_HELPER_1(trap_always, void, int)
> +DEF_HELPER_1(trap_0, void, int)
> DEF_HELPER_0(shutdown, void)
> #define F_HELPER_0_0(name) DEF_HELPER_0(f ## name, void)
> #define F_HELPER_DQ_0_0(name) \
> diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c
> index 8f9d579..266080d 100644
> --- a/target-sparc/op_helper.c
> +++ b/target-sparc/op_helper.c
> @@ -330,6 +330,19 @@ void HELPER(trap_always)(int tt)
> do_interrupt(env);
> }
>
> +void HELPER(trap_0)(int tt)
> +{
> +#ifndef TARGET_SPARC64
> + if (env->psret == 0) {
> + helper_shutdown();
> + } else {
> + helper_trap_always(tt);
> + }
> +#else
> + helper_trap_always(tt);
> +#endif
> +}
> +
> void helper_shutdown(void)
> {
> #if !defined(CONFIG_USER_ONLY)
> diff --git a/target-sparc/translate.c b/target-sparc/translate.c
> index 64035fc..13181ef 100644
> --- a/target-sparc/translate.c
> +++ b/target-sparc/translate.c
> @@ -2037,10 +2037,8 @@ static void disas_sparc_insn(DisasContext * dc)
> tcg_gen_trunc_tl_i32(cpu_tmp32, cpu_dst);
>
> if (rs2 == 0 &&
> - dc->def->features & CPU_FEATURE_TA0_SHUTDOWN) {
> -
> - gen_helper_shutdown();
> -
> + (dc->def->features & CPU_FEATURE_TA0_SHUTDOWN)) {
> + gen_helper_trap_0(cpu_tmp32);
> } else {
> gen_helper_trap_always(cpu_tmp32);
> }
> --
> 1.7.4.4
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-05-27 17:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-27 16:25 [Qemu-devel] [PATCH v2 2/2] [SPARC] Fix TA0_Shutdown feature Julien Grall
2011-05-27 17:21 ` Blue Swirl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).