mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
target-ppc: pass DisasContext to SPR generator functions
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru> Reviewed-by: Alexander Graf <agraf@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
+7
-6
@@ -320,6 +320,7 @@ typedef struct opc_handler_t opc_handler_t;
|
||||
/*****************************************************************************/
|
||||
/* Types used to describe some PowerPC registers */
|
||||
typedef struct CPUPPCState CPUPPCState;
|
||||
typedef struct DisasContext DisasContext;
|
||||
typedef struct ppc_tb_t ppc_tb_t;
|
||||
typedef struct ppc_spr_t ppc_spr_t;
|
||||
typedef struct ppc_dcr_t ppc_dcr_t;
|
||||
@@ -328,13 +329,13 @@ typedef union ppc_tlb_t ppc_tlb_t;
|
||||
|
||||
/* SPR access micro-ops generations callbacks */
|
||||
struct ppc_spr_t {
|
||||
void (*uea_read)(void *opaque, int gpr_num, int spr_num);
|
||||
void (*uea_write)(void *opaque, int spr_num, int gpr_num);
|
||||
void (*uea_read)(DisasContext *ctx, int gpr_num, int spr_num);
|
||||
void (*uea_write)(DisasContext *ctx, int spr_num, int gpr_num);
|
||||
#if !defined(CONFIG_USER_ONLY)
|
||||
void (*oea_read)(void *opaque, int gpr_num, int spr_num);
|
||||
void (*oea_write)(void *opaque, int spr_num, int gpr_num);
|
||||
void (*hea_read)(void *opaque, int gpr_num, int spr_num);
|
||||
void (*hea_write)(void *opaque, int spr_num, int gpr_num);
|
||||
void (*oea_read)(DisasContext *ctx, int gpr_num, int spr_num);
|
||||
void (*oea_write)(DisasContext *ctx, int spr_num, int gpr_num);
|
||||
void (*hea_read)(DisasContext *ctx, int gpr_num, int spr_num);
|
||||
void (*hea_write)(DisasContext *ctx, int spr_num, int gpr_num);
|
||||
#endif
|
||||
const char *name;
|
||||
target_ulong default_value;
|
||||
|
||||
@@ -183,7 +183,7 @@ void ppc_translate_init(void)
|
||||
}
|
||||
|
||||
/* internal defines */
|
||||
typedef struct DisasContext {
|
||||
struct DisasContext {
|
||||
struct TranslationBlock *tb;
|
||||
target_ulong nip;
|
||||
uint32_t opcode;
|
||||
@@ -207,7 +207,7 @@ typedef struct DisasContext {
|
||||
int singlestep_enabled;
|
||||
uint64_t insns_flags;
|
||||
uint64_t insns_flags2;
|
||||
} DisasContext;
|
||||
};
|
||||
|
||||
/* Return true iff byteswap is needed in a scalar memop */
|
||||
static inline bool need_byteswap(const DisasContext *ctx)
|
||||
@@ -4206,7 +4206,7 @@ static void gen_mfmsr(DisasContext *ctx)
|
||||
#endif
|
||||
}
|
||||
|
||||
static void spr_noaccess(void *opaque, int gprn, int sprn)
|
||||
static void spr_noaccess(DisasContext *ctx, int gprn, int sprn)
|
||||
{
|
||||
#if 0
|
||||
sprn = ((sprn >> 5) & 0x1F) | ((sprn & 0x1F) << 5);
|
||||
@@ -4218,7 +4218,7 @@ static void spr_noaccess(void *opaque, int gprn, int sprn)
|
||||
/* mfspr */
|
||||
static inline void gen_op_mfspr(DisasContext *ctx)
|
||||
{
|
||||
void (*read_cb)(void *opaque, int gprn, int sprn);
|
||||
void (*read_cb)(DisasContext *ctx, int gprn, int sprn);
|
||||
uint32_t sprn = SPR(ctx->opcode);
|
||||
|
||||
#if !defined(CONFIG_USER_ONLY)
|
||||
@@ -4369,7 +4369,7 @@ static void gen_mtmsr(DisasContext *ctx)
|
||||
/* mtspr */
|
||||
static void gen_mtspr(DisasContext *ctx)
|
||||
{
|
||||
void (*write_cb)(void *opaque, int sprn, int gprn);
|
||||
void (*write_cb)(DisasContext *ctx, int sprn, int gprn);
|
||||
uint32_t sprn = SPR(ctx->opcode);
|
||||
|
||||
#if !defined(CONFIG_USER_ONLY)
|
||||
|
||||
+121
-126
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user