Always make PowerPC hypervisor mode memory accesses and instructions

available for full system emulation, then removing all #if TARGET_PPC64H
  from micro-ops and code translator.
Add new macros to dramatically simplify memory access tables definitions
  in target-ppc/translate.c.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3654 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
j_mayer 2007-11-16 14:11:28 +00:00
parent 2f6196984b
commit 7863667f35
6 changed files with 256 additions and 1034 deletions

View File

@ -305,10 +305,8 @@ struct ppc_spr_t {
#if !defined(CONFIG_USER_ONLY)
void (*oea_read)(void *opaque, int spr_num);
void (*oea_write)(void *opaque, int spr_num);
#if defined(TARGET_PPC64H)
void (*hea_read)(void *opaque, int spr_num);
void (*hea_write)(void *opaque, int spr_num);
#endif
#endif
const unsigned char *name;
};
@ -510,11 +508,7 @@ enum {
/*****************************************************************************/
/* The whole PowerPC CPU context */
#if defined(TARGET_PPC64H)
#define NB_MMU_MODES 3
#else
#define NB_MMU_MODES 2
#endif
struct CPUPPCState {
/* First are the most commonly used resources
@ -783,9 +777,7 @@ int ppc_dcr_write (ppc_dcr_t *dcr_env, int dcrn, target_ulong val);
/* MMU modes definitions */
#define MMU_MODE0_SUFFIX _user
#define MMU_MODE1_SUFFIX _kernel
#if defined(TARGET_PPC64H)
#define MMU_MODE2_SUFFIX _hypv
#endif
#define MMU_USER_IDX 0
static inline int cpu_mmu_index (CPUState *env)
{

View File

@ -1987,12 +1987,10 @@ void OPPROTO op_fneg (void)
#define MEMSUFFIX _kernel
#include "op_helper.h"
#include "op_mem.h"
#if defined(TARGET_PPC64H)
#define MEMSUFFIX _hypv
#include "op_helper.h"
#include "op_mem.h"
#endif
#endif
/* Special op to check and maybe clear reservation */
void OPPROTO op_check_reservation (void)
@ -2031,9 +2029,7 @@ void OPPROTO op_rfid (void)
do_rfid();
RETURN();
}
#endif
#if defined(TARGET_PPC64H)
void OPPROTO op_hrfid (void)
{
do_hrfid();

View File

@ -33,12 +33,10 @@
#define MEMSUFFIX _kernel
#include "op_helper.h"
#include "op_helper_mem.h"
#if defined(TARGET_PPC64H)
#define MEMSUFFIX _hypv
#include "op_helper.h"
#include "op_helper_mem.h"
#endif
#endif
//#define DEBUG_OP
//#define DEBUG_EXCEPTIONS
@ -1475,8 +1473,7 @@ void do_rfid (void)
__do_rfi(env->spr[SPR_SRR0], env->spr[SPR_SRR1],
~((target_ulong)0xFFFF0000), 0);
}
#endif
#if defined(TARGET_PPC64H)
void do_hrfid (void)
{
__do_rfi(env->spr[SPR_HSRR0], env->spr[SPR_HSRR1],

View File

@ -146,8 +146,6 @@ void do_store_msr (void);
void do_rfi (void);
#if defined(TARGET_PPC64)
void do_rfid (void);
#endif
#if defined(TARGET_PPC64H)
void do_hrfid (void);
#endif
void do_load_6xx_tlb (int is_code);

File diff suppressed because it is too large Load Diff

View File

@ -264,7 +264,8 @@ int cpu_restore_state(TranslationBlock *tb,
#else
#define CASE3(op)\
case INDEX_op_ ## op ## _user:\
case INDEX_op_ ## op ## _kernel
case INDEX_op_ ## op ## _kernel:\
case INDEX_op_ ## op ## _hypv
#endif
CASE3(stfd):