]> git.proxmox.com Git - mirror_qemu.git/blobdiff - target-alpha/sys_helper.c
Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
[mirror_qemu.git] / target-alpha / sys_helper.c
index 434a63a97d7efb1668030ffaebf3916c228a3bac..bec1e178be779cfc9e63f5fe75b6d5a300d2f63f 100644 (file)
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "qemu/osdep.h"
 #include "cpu.h"
-#include "helper.h"
+#include "exec/exec-all.h"
+#include "exec/helper-proto.h"
 #include "sysemu/sysemu.h"
 #include "qemu/timer.h"
 
@@ -30,35 +32,29 @@ uint64_t helper_load_pcc(CPUAlphaState *env)
        In order to make OS-level time accounting work with the RPCC,
        present it with a well-timed clock fixed at 250MHz.  */
     return (((uint64_t)env->pcc_ofs << 32)
-            | (uint32_t)(qemu_get_clock_ns(vm_clock) >> 2));
+            | (uint32_t)(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) >> 2));
 #else
-    /* In user-mode, vm_clock doesn't exist.  Just pass through the host cpu
+    /* In user-mode, QEMU_CLOCK_VIRTUAL doesn't exist.  Just pass through the host cpu
        clock ticks.  Also, don't bother taking PCC_OFS into account.  */
-    return (uint32_t)cpu_get_real_ticks();
+    return (uint32_t)cpu_get_host_ticks();
 #endif
 }
 
 /* PALcode support special instructions */
 #ifndef CONFIG_USER_ONLY
-void helper_hw_ret(CPUAlphaState *env, uint64_t a)
+void helper_tbia(CPUAlphaState *env)
 {
-    env->pc = a & ~3;
-    env->intr_flag = 0;
-    env->lock_addr = -1;
-    if ((a & 1) == 0) {
-        env->pal_mode = 0;
-        swap_shadow_regs(env);
-    }
+    tlb_flush(CPU(alpha_env_get_cpu(env)), 1);
 }
 
-void helper_tbia(CPUAlphaState *env)
+void helper_tbis(CPUAlphaState *env, uint64_t p)
 {
-    tlb_flush(env, 1);
+    tlb_flush_page(CPU(alpha_env_get_cpu(env)), p);
 }
 
-void helper_tbis(CPUAlphaState *env, uint64_t p)
+void helper_tb_flush(CPUAlphaState *env)
 {
-    tlb_flush_page(env, p);
+    tb_flush(CPU(alpha_env_get_cpu(env)));
 }
 
 void helper_halt(uint64_t restart)
@@ -70,18 +66,26 @@ void helper_halt(uint64_t restart)
     }
 }
 
-uint64_t helper_get_time(void)
+uint64_t helper_get_vmtime(void)
 {
-    return qemu_get_clock_ns(rtc_clock);
+    return qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
+}
+
+uint64_t helper_get_walltime(void)
+{
+    return qemu_clock_get_ns(rtc_clock);
 }
 
 void helper_set_alarm(CPUAlphaState *env, uint64_t expire)
 {
+    AlphaCPU *cpu = alpha_env_get_cpu(env);
+
     if (expire) {
         env->alarm_expire = expire;
-        qemu_mod_timer(env->alarm_timer, expire);
+        timer_mod(cpu->alarm_timer, expire);
     } else {
-        qemu_del_timer(env->alarm_timer);
+        timer_del(cpu->alarm_timer);
     }
 }
+
 #endif /* CONFIG_USER_ONLY */