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

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

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

revision 1.26 by bellard, Mon Jul 4 22:17:05 2005 UTC revision 1.27 by bellard, Sun Oct 30 21:23:38 2005 UTC
# Line 36  Line 36 
36  /*****************************************************************************/  /*****************************************************************************/
37  /* PowerPC MMU emulation */  /* PowerPC MMU emulation */
38    
39    #if defined(CONFIG_USER_ONLY)
40    int cpu_ppc_handle_mmu_fault (CPUState *env, uint32_t address, int rw,
41                                  int is_user, int is_softmmu)
42    {
43        int exception, error_code;
44        
45        if (rw == 2) {
46            exception = EXCP_ISI;
47            error_code = 0;
48        } else {
49            exception = EXCP_DSI;
50            error_code = 0;
51            if (rw)
52                error_code |= 0x02000000;
53            env->spr[SPR_DAR] = address;
54            env->spr[SPR_DSISR] = error_code;
55        }
56        env->exception_index = exception;
57        env->error_code = error_code;
58        return 1;
59    }
60    target_ulong cpu_get_phys_page_debug(CPUState *env, target_ulong addr)
61    {
62        return addr;
63    }
64    #else
65  /* Perform BAT hit & translation */  /* Perform BAT hit & translation */
66  static int get_bat (CPUState *env, uint32_t *real, int *prot,  static int get_bat (CPUState *env, uint32_t *real, int *prot,
67                      uint32_t virtual, int rw, int type)                      uint32_t virtual, int rw, int type)
# Line 355  static int get_segment (CPUState *env, u Line 381  static int get_segment (CPUState *env, u
381      return ret;      return ret;
382  }  }
383    
384  int get_physical_address (CPUState *env, uint32_t *physical, int *prot,  static int get_physical_address (CPUState *env, uint32_t *physical, int *prot,
385                            uint32_t address, int rw, int access_type)                                   uint32_t address, int rw, int access_type)
386  {  {
387      int ret;      int ret;
388  #if 0  #if 0
# Line 387  int get_physical_address (CPUState *env, Line 413  int get_physical_address (CPUState *env,
413      return ret;      return ret;
414  }  }
415    
 #if defined(CONFIG_USER_ONLY)  
 target_ulong cpu_get_phys_page_debug(CPUState *env, target_ulong addr)  
 {  
     return addr;  
 }  
 #else  
416  target_ulong cpu_get_phys_page_debug(CPUState *env, target_ulong addr)  target_ulong cpu_get_phys_page_debug(CPUState *env, target_ulong addr)
417  {  {
418      uint32_t phys_addr;      uint32_t phys_addr;
# Line 402  target_ulong cpu_get_phys_page_debug(CPU Line 422  target_ulong cpu_get_phys_page_debug(CPU
422          return -1;          return -1;
423      return phys_addr;      return phys_addr;
424  }  }
 #endif  
425    
426  /* Perform address translation */  /* Perform address translation */
427  int cpu_ppc_handle_mmu_fault (CPUState *env, uint32_t address, int rw,  int cpu_ppc_handle_mmu_fault (CPUState *env, uint32_t address, int rw,
# Line 523  int cpu_ppc_handle_mmu_fault (CPUState * Line 542  int cpu_ppc_handle_mmu_fault (CPUState *
542      }      }
543      return ret;      return ret;
544  }  }
545    #endif
546    
547  /*****************************************************************************/  /*****************************************************************************/
548  /* BATs management */  /* BATs management */

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27

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