aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2011-07-03 07:05:50 +0000
committerBlue Swirl <blauwirbel@gmail.com>2011-10-23 15:08:10 +0000
commit2336c1f1970a5c5cfd34a1785af646c960b6f43f (patch)
treec5e3aab3604e8d1151bfa15140ec32ec7851a5d0
parentab3b491f2131e12503d165a8ffaef5f3a488eafe (diff)
Sparc: move trivial functions from op_helper.c
These functions don't need access to CPUState or already pass it, so relocating them from op_helper.c to helper.c and int64_helper.c is trivial. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
-rw-r--r--target-sparc/helper.c41
-rw-r--r--target-sparc/int64_helper.c5
-rw-r--r--target-sparc/op_helper.c47
3 files changed, 46 insertions, 47 deletions
diff --git a/target-sparc/helper.c b/target-sparc/helper.c
index 1866f635f5..e9182ac602 100644
--- a/target-sparc/helper.c
+++ b/target-sparc/helper.c
@@ -18,6 +18,9 @@
*/
#include "cpu.h"
+#include "host-utils.h"
+#include "helper.h"
+#include "sysemu.h"
//#define DEBUG_MMU
@@ -866,3 +869,41 @@ target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr)
return phys_addr;
}
#endif
+
+/* misc op helpers */
+void helper_shutdown(void)
+{
+#if !defined(CONFIG_USER_ONLY)
+ qemu_system_shutdown_request();
+#endif
+}
+
+#ifdef TARGET_SPARC64
+target_ulong helper_popc(target_ulong val)
+{
+ return ctpop64(val);
+}
+
+void helper_tick_set_count(void *opaque, uint64_t count)
+{
+#if !defined(CONFIG_USER_ONLY)
+ cpu_tick_set_count(opaque, count);
+#endif
+}
+
+uint64_t helper_tick_get_count(void *opaque)
+{
+#if !defined(CONFIG_USER_ONLY)
+ return cpu_tick_get_count(opaque);
+#else
+ return 0;
+#endif
+}
+
+void helper_tick_set_limit(void *opaque, uint64_t limit)
+{
+#if !defined(CONFIG_USER_ONLY)
+ cpu_tick_set_limit(opaque, limit);
+#endif
+}
+#endif
diff --git a/target-sparc/int64_helper.c b/target-sparc/int64_helper.c
index c21dc9c5be..2bb1910ed9 100644
--- a/target-sparc/int64_helper.c
+++ b/target-sparc/int64_helper.c
@@ -157,3 +157,8 @@ void do_interrupt(CPUState *env)
env->npc = env->pc + 4;
env->exception_index = -1;
}
+
+trap_state *cpu_tsptr(CPUState* env)
+{
+ return &env->ts[env->tl & MAXTL_MASK];
+}
diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c
index 110227399b..9955499497 100644
--- a/target-sparc/op_helper.c
+++ b/target-sparc/op_helper.c
@@ -1,8 +1,6 @@
#include "cpu.h"
#include "dyngen-exec.h"
-#include "host-utils.h"
#include "helper.h"
-#include "sysemu.h"
#if !defined(CONFIG_USER_ONLY)
#include "softmmu_exec.h"
@@ -334,13 +332,6 @@ void HELPER(raise_exception)(int tt)
raise_exception(tt);
}
-void helper_shutdown(void)
-{
-#if !defined(CONFIG_USER_ONLY)
- qemu_system_shutdown_request();
-#endif
-}
-
void helper_check_align(target_ulong addr, uint32_t align)
{
if (addr & align) {
@@ -4003,11 +3994,6 @@ target_ulong helper_alignaddr(target_ulong addr, target_ulong offset)
return tmp & ~7ULL;
}
-target_ulong helper_popc(target_ulong val)
-{
- return ctpop64(val);
-}
-
static inline uint64_t *get_gregset(uint32_t pstate)
{
switch (pstate) {
@@ -4164,13 +4150,6 @@ void helper_write_softint(uint64_t value)
}
#endif
-#ifdef TARGET_SPARC64
-trap_state* cpu_tsptr(CPUState* env)
-{
- return &env->ts[env->tl & MAXTL_MASK];
-}
-#endif
-
#if !defined(CONFIG_USER_ONLY)
static void do_unaligned_access(target_ulong addr, int is_write, int is_user,
@@ -4320,32 +4299,6 @@ static void do_unassigned_access(target_phys_addr_t addr, int is_write,
}
#endif
-
-#ifdef TARGET_SPARC64
-void helper_tick_set_count(void *opaque, uint64_t count)
-{
-#if !defined(CONFIG_USER_ONLY)
- cpu_tick_set_count(opaque, count);
-#endif
-}
-
-uint64_t helper_tick_get_count(void *opaque)
-{
-#if !defined(CONFIG_USER_ONLY)
- return cpu_tick_get_count(opaque);
-#else
- return 0;
-#endif
-}
-
-void helper_tick_set_limit(void *opaque, uint64_t limit)
-{
-#if !defined(CONFIG_USER_ONLY)
- cpu_tick_set_limit(opaque, limit);
-#endif
-}
-#endif
-
#if !defined(CONFIG_USER_ONLY)
void cpu_unassigned_access(CPUState *env1, target_phys_addr_t addr,
int is_write, int is_exec, int is_asi, int size)