]> git.proxmox.com Git - qemu.git/blobdiff - target-cris/helper.c
target-cris: Move TCG initialization to CRISCPU initfn
[qemu.git] / target-cris / helper.c
index 5bc6d810cb64d13b9eb1df6fa1db4002f105a11e..6e75e9819e7eac3b38df3f1559ab68aa5d415528 100644 (file)
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <stdio.h>
-#include <string.h>
-
-#include "config.h"
 #include "cpu.h"
 #include "mmu.h"
-#include "host-utils.h"
+#include "qemu/host-utils.h"
 
 
 //#define CRIS_HELPER_DEBUG
@@ -32,7 +28,7 @@
 
 #ifdef CRIS_HELPER_DEBUG
 #define D(x) x
-#define D_LOG(...) qemu_log(__VA__ARGS__)
+#define D_LOG(...) qemu_log(__VA_ARGS__)
 #else
 #define D(x)
 #define D_LOG(...) do { } while (0)
 
 #if defined(CONFIG_USER_ONLY)
 
-void do_interrupt (CPUState *env)
+void do_interrupt (CPUCRISState *env)
 {
        env->exception_index = -1;
        env->pregs[PR_ERP] = env->pc;
 }
 
-int cpu_cris_handle_mmu_fault(CPUState * env, target_ulong address, int rw,
+int cpu_cris_handle_mmu_fault(CPUCRISState * env, target_ulong address, int rw,
                               int mmu_idx)
 {
        env->exception_index = 0xaa;
@@ -58,7 +54,7 @@ int cpu_cris_handle_mmu_fault(CPUState * env, target_ulong address, int rw,
 #else /* !CONFIG_USER_ONLY */
 
 
-static void cris_shift_ccs(CPUState *env)
+static void cris_shift_ccs(CPUCRISState *env)
 {
        uint32_t ccs;
        /* Apply the ccs shift.  */
@@ -67,7 +63,7 @@ static void cris_shift_ccs(CPUState *env)
        env->pregs[PR_CCS] = ccs;
 }
 
-int cpu_cris_handle_mmu_fault (CPUState *env, target_ulong address, int rw,
+int cpu_cris_handle_mmu_fault (CPUCRISState *env, target_ulong address, int rw,
                                int mmu_idx)
 {
        struct cris_mmu_result res;
@@ -110,7 +106,7 @@ int cpu_cris_handle_mmu_fault (CPUState *env, target_ulong address, int rw,
        return r;
 }
 
-static void do_interruptv10(CPUState *env)
+static void do_interruptv10(CPUCRISState *env)
 {
        int ex_vec = -1;
 
@@ -125,14 +121,14 @@ static void do_interruptv10(CPUState *env)
                        /* These exceptions are genereated by the core itself.
                           ERP should point to the insn following the brk.  */
                        ex_vec = env->trap_vector;
-                       env->pregs[PR_ERP] = env->pc;
+                       env->pregs[PRV10_BRP] = env->pc;
                        break;
 
                case EXCP_NMI:
                        /* NMI is hardwired to vector zero.  */
                        ex_vec = 0;
-                       env->pregs[PR_CCS] &= ~M_FLAG;
-                       env->pregs[PR_NRP] = env->pc;
+                       env->pregs[PR_CCS] &= ~M_FLAG_V10;
+                       env->pregs[PRV10_BRP] = env->pc;
                        break;
 
                case EXCP_BUSFAULT:
@@ -155,7 +151,7 @@ static void do_interruptv10(CPUState *env)
        }
 
        /* Now that we are in kernel mode, load the handlers address.  */
-       env->pc = ldl_code(env->pregs[PR_EBP] + ex_vec * 4);
+        env->pc = cpu_ldl_code(env, env->pregs[PR_EBP] + ex_vec * 4);
        env->locked_irq = 1;
        env->pregs[PR_CCS] |= F_FLAG_V10; /* set F.  */
 
@@ -166,7 +162,7 @@ static void do_interruptv10(CPUState *env)
                      env->pregs[PR_ERP]);
 }
 
-void do_interrupt(CPUState *env)
+void do_interrupt(CPUCRISState *env)
 {
        int ex_vec = -1;
 
@@ -189,7 +185,7 @@ void do_interrupt(CPUState *env)
                case EXCP_NMI:
                        /* NMI is hardwired to vector zero.  */
                        ex_vec = 0;
-                       env->pregs[PR_CCS] &= ~M_FLAG;
+                       env->pregs[PR_CCS] &= ~M_FLAG_V32;
                        env->pregs[PR_NRP] = env->pc;
                        break;
 
@@ -237,7 +233,7 @@ void do_interrupt(CPUState *env)
        /* Now that we are in kernel mode, load the handlers address.
           This load may not fault, real hw leaves that behaviour as
           undefined.  */
-       env->pc = ldl_code(env->pregs[PR_EBP] + ex_vec * 4);
+        env->pc = cpu_ldl_code(env, env->pregs[PR_EBP] + ex_vec * 4);
 
        /* Clear the excption_index to avoid spurios hw_aborts for recursive
           bus faults.  */
@@ -250,7 +246,7 @@ void do_interrupt(CPUState *env)
                   env->pregs[PR_ERP]);
 }
 
-target_phys_addr_t cpu_get_phys_page_debug(CPUState * env, target_ulong addr)
+hwaddr cpu_get_phys_page_debug(CPUCRISState * env, target_ulong addr)
 {
        uint32_t phy = addr;
        struct cris_mmu_result res;