/[qemu]/qemu/target-mips/helper.c
ViewVC logotype

Diff of /qemu/target-mips/helper.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by bellard, Sat Jul 2 15:35:03 2005 UTC revision 1.7 by bellard, Mon Jul 4 22:17:32 2005 UTC
# Line 17  Line 17 
17   * License along with this library; if not, write to the Free Software   * License along with this library; if not, write to the Free Software
18   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19   */   */
20  #include "exec.h"  #include <stdarg.h>
21    #include <stdlib.h>
22    #include <stdio.h>
23    #include <string.h>
24    #include <inttypes.h>
25    #include <signal.h>
26    #include <assert.h>
27    
28    #include "cpu.h"
29    #include "exec-all.h"
30    
31  /* MIPS32 4K MMU emulation */  /* MIPS32 4K MMU emulation */
32  #ifdef MIPS_USES_R4K_TLB  #ifdef MIPS_USES_R4K_TLB
# Line 142  target_ulong cpu_get_phys_page_debug(CPU Line 151  target_ulong cpu_get_phys_page_debug(CPU
151          return -1;          return -1;
152      return phys_addr;      return phys_addr;
153  }  }
 #endif  
   
 #if !defined(CONFIG_USER_ONLY)  
   
 #define MMUSUFFIX _mmu  
 #define GETPC() (__builtin_return_address(0))  
   
 #define SHIFT 0  
 #include "softmmu_template.h"  
   
 #define SHIFT 1  
 #include "softmmu_template.h"  
   
 #define SHIFT 2  
 #include "softmmu_template.h"  
   
 #define SHIFT 3  
 #include "softmmu_template.h"  
   
 void tlb_fill (target_ulong addr, int is_write, int is_user, void *retaddr)  
 {  
     TranslationBlock *tb;  
     CPUState *saved_env;  
     unsigned long pc;  
     int ret;  
   
     /* XXX: hack to restore env in all cases, even if not called from  
        generated code */  
     saved_env = env;  
     env = cpu_single_env;  
     ret = cpu_mips_handle_mmu_fault(env, addr, is_write, is_user, 1);  
     if (ret) {  
         if (retaddr) {  
             /* now we have a real cpu fault */  
             pc = (unsigned long)retaddr;  
             tb = tb_find_pc(pc);  
             if (tb) {  
                 /* the PC is inside the translated code. It means that we have  
                    a virtual CPU fault */  
                 cpu_restore_state(tb, env, pc, NULL);  
             }  
         }  
         do_raise_exception_err(env->exception_index, env->error_code);  
     }  
     env = saved_env;  
 }  
154    
155  void cpu_mips_init_mmu (CPUState *env)  void cpu_mips_init_mmu (CPUState *env)
156  {  {
157  }  }
   
158  #endif /* !defined(CONFIG_USER_ONLY) */  #endif /* !defined(CONFIG_USER_ONLY) */
159    
160  int cpu_mips_handle_mmu_fault (CPUState *env, target_ulong address, int rw,  int cpu_mips_handle_mmu_fault (CPUState *env, target_ulong address, int rw,

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26