Annotation of qemu/target-sparc/op_helper.c, revision 1.1.1.12

1.1.1.12! root        1: #include "cpu.h"
        !             2: #include "dyngen-exec.h"
1.1.1.6   root        3: #include "helper.h"
1.1       root        4: 
1.1.1.5   root        5: #if !defined(CONFIG_USER_ONLY)
                      6: static void do_unaligned_access(target_ulong addr, int is_write, int is_user,
                      7:                                 void *retaddr);
1.1       root        8: 
                      9: #define MMUSUFFIX _mmu
1.1.1.5   root       10: #define ALIGNED_ONLY
1.1       root       11: 
                     12: #define SHIFT 0
                     13: #include "softmmu_template.h"
                     14: 
                     15: #define SHIFT 1
                     16: #include "softmmu_template.h"
                     17: 
                     18: #define SHIFT 2
                     19: #include "softmmu_template.h"
                     20: 
                     21: #define SHIFT 3
                     22: #include "softmmu_template.h"
                     23: 
1.1.1.6   root       24: /* XXX: make it generic ? */
                     25: static void cpu_restore_state2(void *retaddr)
                     26: {
                     27:     TranslationBlock *tb;
                     28:     unsigned long pc;
                     29: 
                     30:     if (retaddr) {
                     31:         /* now we have a real cpu fault */
                     32:         pc = (unsigned long)retaddr;
                     33:         tb = tb_find_pc(pc);
                     34:         if (tb) {
                     35:             /* the PC is inside the translated code. It means that we have
                     36:                a virtual CPU fault */
1.1.1.11  root       37:             cpu_restore_state(tb, env, pc);
1.1.1.6   root       38:         }
                     39:     }
                     40: }
                     41: 
1.1.1.5   root       42: static void do_unaligned_access(target_ulong addr, int is_write, int is_user,
                     43:                                 void *retaddr)
                     44: {
                     45: #ifdef DEBUG_UNALIGNED
1.1.1.6   root       46:     printf("Unaligned access to 0x" TARGET_FMT_lx " from 0x" TARGET_FMT_lx
                     47:            "\n", addr, env->pc);
1.1.1.5   root       48: #endif
1.1.1.6   root       49:     cpu_restore_state2(retaddr);
1.1.1.12! root       50:     helper_raise_exception(env, TT_UNALIGNED);
1.1.1.5   root       51: }
1.1       root       52: 
                     53: /* try to fill the TLB and return an exception if error. If retaddr is
                     54:    NULL, it means that the function was called in C code (i.e. not
                     55:    from generated code or from helper.c) */
                     56: /* XXX: fix it to restore all registers */
1.1.1.12! root       57: void tlb_fill(CPUState *env1, target_ulong addr, int is_write, int mmu_idx,
        !            58:               void *retaddr)
1.1       root       59: {
                     60:     int ret;
                     61:     CPUState *saved_env;
                     62: 
                     63:     saved_env = env;
1.1.1.12! root       64:     env = env1;
1.1       root       65: 
1.1.1.12! root       66:     ret = cpu_sparc_handle_mmu_fault(env, addr, is_write, mmu_idx);
1.1       root       67:     if (ret) {
1.1.1.6   root       68:         cpu_restore_state2(retaddr);
1.1.1.11  root       69:         cpu_loop_exit(env);
1.1       root       70:     }
                     71:     env = saved_env;
                     72: }
                     73: 
1.1.1.9   root       74: #endif /* !CONFIG_USER_ONLY */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.