mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
target/ppc/cpu.h: Clean up comments in the struct CPUPPCState definition
The cpu env struct is quite complex but comments supposed to explain it in its definition just make it harder to read. Reformat and reword some comments to make it clearer and more readable. Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> Message-Id: <8707144ab1ccf9c5c89a39c2d7a0b02307ca25d4.1581888834.git.balaton@eik.bme.hu> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
b561615db2
commit
ad5db2e732
1 changed files with 54 additions and 91 deletions
145
target/ppc/cpu.h
145
target/ppc/cpu.h
|
@ -960,116 +960,88 @@ struct ppc_radix_page_info {
|
||||||
#define PPC_CPU_INDIRECT_OPCODES_LEN 0x20
|
#define PPC_CPU_INDIRECT_OPCODES_LEN 0x20
|
||||||
|
|
||||||
struct CPUPPCState {
|
struct CPUPPCState {
|
||||||
/*
|
/* Most commonly used resources during translated code execution first */
|
||||||
* First are the most commonly used resources during translated
|
target_ulong gpr[32]; /* general purpose registers */
|
||||||
* code execution
|
target_ulong gprh[32]; /* storage for GPR MSB, used by the SPE extension */
|
||||||
*/
|
|
||||||
/* general purpose registers */
|
|
||||||
target_ulong gpr[32];
|
|
||||||
/* Storage for GPR MSB, used by the SPE extension */
|
|
||||||
target_ulong gprh[32];
|
|
||||||
/* LR */
|
|
||||||
target_ulong lr;
|
target_ulong lr;
|
||||||
/* CTR */
|
|
||||||
target_ulong ctr;
|
target_ulong ctr;
|
||||||
/* condition register */
|
uint32_t crf[8]; /* condition register */
|
||||||
uint32_t crf[8];
|
|
||||||
#if defined(TARGET_PPC64)
|
#if defined(TARGET_PPC64)
|
||||||
/* CFAR */
|
|
||||||
target_ulong cfar;
|
target_ulong cfar;
|
||||||
#endif
|
#endif
|
||||||
/* XER (with SO, OV, CA split out) */
|
target_ulong xer; /* XER (with SO, OV, CA split out) */
|
||||||
target_ulong xer;
|
|
||||||
target_ulong so;
|
target_ulong so;
|
||||||
target_ulong ov;
|
target_ulong ov;
|
||||||
target_ulong ca;
|
target_ulong ca;
|
||||||
target_ulong ov32;
|
target_ulong ov32;
|
||||||
target_ulong ca32;
|
target_ulong ca32;
|
||||||
/* Reservation address */
|
|
||||||
target_ulong reserve_addr;
|
target_ulong reserve_addr; /* Reservation address */
|
||||||
/* Reservation value */
|
target_ulong reserve_val; /* Reservation value */
|
||||||
target_ulong reserve_val;
|
|
||||||
target_ulong reserve_val2;
|
target_ulong reserve_val2;
|
||||||
|
|
||||||
/* Those ones are used in supervisor mode only */
|
/* These are used in supervisor mode only */
|
||||||
/* machine state register */
|
target_ulong msr; /* machine state register */
|
||||||
target_ulong msr;
|
target_ulong tgpr[4]; /* temporary general purpose registers, */
|
||||||
/* temporary general purpose registers */
|
/* used to speed-up TLB assist handlers */
|
||||||
target_ulong tgpr[4]; /* Used to speed-up TLB assist handlers */
|
|
||||||
|
|
||||||
/* Next instruction pointer */
|
target_ulong nip; /* next instruction pointer */
|
||||||
target_ulong nip;
|
uint64_t retxh; /* high part of 128-bit helper return */
|
||||||
|
|
||||||
/* High part of 128-bit helper return. */
|
|
||||||
uint64_t retxh;
|
|
||||||
|
|
||||||
/* when a memory exception occurs, the access type is stored here */
|
/* when a memory exception occurs, the access type is stored here */
|
||||||
int access_type;
|
int access_type;
|
||||||
|
|
||||||
/* MMU context - only relevant for full system emulation */
|
|
||||||
#if !defined(CONFIG_USER_ONLY)
|
#if !defined(CONFIG_USER_ONLY)
|
||||||
|
/* MMU context, only relevant for full system emulation */
|
||||||
#if defined(TARGET_PPC64)
|
#if defined(TARGET_PPC64)
|
||||||
/* PowerPC 64 SLB area */
|
ppc_slb_t slb[MAX_SLB_ENTRIES]; /* PowerPC 64 SLB area */
|
||||||
ppc_slb_t slb[MAX_SLB_ENTRIES];
|
|
||||||
/* tcg TLB needs flush (deferred slb inval instruction typically) */
|
|
||||||
#endif
|
#endif
|
||||||
/* segment registers */
|
target_ulong sr[32]; /* segment registers */
|
||||||
target_ulong sr[32];
|
uint32_t nb_BATs; /* number of BATs */
|
||||||
/* BATs */
|
|
||||||
uint32_t nb_BATs;
|
|
||||||
target_ulong DBAT[2][8];
|
target_ulong DBAT[2][8];
|
||||||
target_ulong IBAT[2][8];
|
target_ulong IBAT[2][8];
|
||||||
/* PowerPC TLB registers (for 4xx, e500 and 60x software driven TLBs) */
|
/* PowerPC TLB registers (for 4xx, e500 and 60x software driven TLBs) */
|
||||||
int32_t nb_tlb; /* Total number of TLB */
|
int32_t nb_tlb; /* Total number of TLB */
|
||||||
int tlb_per_way; /* Speed-up helper: used to avoid divisions at run time */
|
int tlb_per_way; /* Speed-up helper: used to avoid divisions at run time */
|
||||||
int nb_ways; /* Number of ways in the TLB set */
|
int nb_ways; /* Number of ways in the TLB set */
|
||||||
int last_way; /* Last used way used to allocate TLB in a LRU way */
|
int last_way; /* Last used way used to allocate TLB in a LRU way */
|
||||||
int id_tlbs; /* If 1, MMU has separated TLBs for instructions & data */
|
int id_tlbs; /* If 1, MMU has separated TLBs for instructions & data */
|
||||||
int nb_pids; /* Number of available PID registers */
|
int nb_pids; /* Number of available PID registers */
|
||||||
int tlb_type; /* Type of TLB we're dealing with */
|
int tlb_type; /* Type of TLB we're dealing with */
|
||||||
ppc_tlb_t tlb; /* TLB is optional. Allocate them only if needed */
|
ppc_tlb_t tlb; /* TLB is optional. Allocate them only if needed */
|
||||||
/* 403 dedicated access protection registers */
|
target_ulong pb[4]; /* 403 dedicated access protection registers */
|
||||||
target_ulong pb[4];
|
bool tlb_dirty; /* Set to non-zero when modifying TLB */
|
||||||
bool tlb_dirty; /* Set to non-zero when modifying TLB */
|
bool kvm_sw_tlb; /* non-zero if KVM SW TLB API is active */
|
||||||
bool kvm_sw_tlb; /* non-zero if KVM SW TLB API is active */
|
|
||||||
uint32_t tlb_need_flush; /* Delayed flush needed */
|
uint32_t tlb_need_flush; /* Delayed flush needed */
|
||||||
#define TLB_NEED_LOCAL_FLUSH 0x1
|
#define TLB_NEED_LOCAL_FLUSH 0x1
|
||||||
#define TLB_NEED_GLOBAL_FLUSH 0x2
|
#define TLB_NEED_GLOBAL_FLUSH 0x2
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Other registers */
|
/* Other registers */
|
||||||
/* Special purpose registers */
|
target_ulong spr[1024]; /* special purpose registers */
|
||||||
target_ulong spr[1024];
|
|
||||||
ppc_spr_t spr_cb[1024];
|
ppc_spr_t spr_cb[1024];
|
||||||
/* Vector status and control register, minus VSCR_SAT. */
|
/* Vector status and control register, minus VSCR_SAT */
|
||||||
uint32_t vscr;
|
uint32_t vscr;
|
||||||
/* VSX registers (including FP and AVR) */
|
/* VSX registers (including FP and AVR) */
|
||||||
ppc_vsr_t vsr[64] QEMU_ALIGNED(16);
|
ppc_vsr_t vsr[64] QEMU_ALIGNED(16);
|
||||||
/* Non-zero if and only if VSCR_SAT should be set. */
|
/* Non-zero if and only if VSCR_SAT should be set */
|
||||||
ppc_vsr_t vscr_sat QEMU_ALIGNED(16);
|
ppc_vsr_t vscr_sat QEMU_ALIGNED(16);
|
||||||
/* SPE registers */
|
/* SPE registers */
|
||||||
uint64_t spe_acc;
|
uint64_t spe_acc;
|
||||||
uint32_t spe_fscr;
|
uint32_t spe_fscr;
|
||||||
/*
|
/* SPE and Altivec share status as they'll never be used simultaneously */
|
||||||
* SPE and Altivec can share a status since they will never be
|
|
||||||
* used simultaneously
|
|
||||||
*/
|
|
||||||
float_status vec_status;
|
float_status vec_status;
|
||||||
/* Floating point execution context */
|
float_status fp_status; /* Floating point execution context */
|
||||||
float_status fp_status;
|
target_ulong fpscr; /* Floating point status and control register */
|
||||||
/* floating point status and control register */
|
|
||||||
target_ulong fpscr;
|
|
||||||
|
|
||||||
/* Internal devices resources */
|
/* Internal devices resources */
|
||||||
/* Time base and decrementer */
|
ppc_tb_t *tb_env; /* Time base and decrementer */
|
||||||
ppc_tb_t *tb_env;
|
ppc_dcr_t *dcr_env; /* Device control registers */
|
||||||
/* Device control registers */
|
|
||||||
ppc_dcr_t *dcr_env;
|
|
||||||
|
|
||||||
int dcache_line_size;
|
int dcache_line_size;
|
||||||
int icache_line_size;
|
int icache_line_size;
|
||||||
|
|
||||||
/* Those resources are used during exception processing */
|
/* These resources are used during exception processing */
|
||||||
/* CPU model definition */
|
/* CPU model definition */
|
||||||
target_ulong msr_mask;
|
target_ulong msr_mask;
|
||||||
powerpc_mmu_t mmu_model;
|
powerpc_mmu_t mmu_model;
|
||||||
|
@ -1088,58 +1060,49 @@ struct CPUPPCState {
|
||||||
uint32_t pending_interrupts;
|
uint32_t pending_interrupts;
|
||||||
#if !defined(CONFIG_USER_ONLY)
|
#if !defined(CONFIG_USER_ONLY)
|
||||||
/*
|
/*
|
||||||
* This is the IRQ controller, which is implementation dependent
|
* This is the IRQ controller, which is implementation dependent and only
|
||||||
* and only relevant when emulating a complete machine. Note that
|
* relevant when emulating a complete machine. Note that this isn't used
|
||||||
* this isn't used by recent Book3s compatible CPUs (POWER7 and
|
* by recent Book3s compatible CPUs (POWER7 and newer).
|
||||||
* newer).
|
|
||||||
*/
|
*/
|
||||||
uint32_t irq_input_state;
|
uint32_t irq_input_state;
|
||||||
void **irq_inputs;
|
void **irq_inputs;
|
||||||
/* Exception vectors */
|
|
||||||
target_ulong excp_vectors[POWERPC_EXCP_NB];
|
target_ulong excp_vectors[POWERPC_EXCP_NB]; /* Exception vectors */
|
||||||
target_ulong excp_prefix;
|
target_ulong excp_prefix;
|
||||||
target_ulong ivor_mask;
|
target_ulong ivor_mask;
|
||||||
target_ulong ivpr_mask;
|
target_ulong ivpr_mask;
|
||||||
target_ulong hreset_vector;
|
target_ulong hreset_vector;
|
||||||
hwaddr mpic_iack;
|
hwaddr mpic_iack;
|
||||||
/* true when the external proxy facility mode is enabled */
|
bool mpic_proxy; /* true if the external proxy facility mode is enabled */
|
||||||
bool mpic_proxy;
|
bool has_hv_mode; /* set when the processor has an HV mode, thus HV priv */
|
||||||
|
/* instructions and SPRs are diallowed if MSR:HV is 0 */
|
||||||
/*
|
/*
|
||||||
* set when the processor has an HV mode, thus HV priv
|
* On P7/P8/P9, set when in PM state so we need to handle resume in a
|
||||||
* instructions and SPRs are diallowed if MSR:HV is 0
|
* special way (such as routing some resume causes to 0x100, i.e. sreset).
|
||||||
*/
|
|
||||||
bool has_hv_mode;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* On P7/P8/P9, set when in PM state, we need to handle resume in
|
|
||||||
* a special way (such as routing some resume causes to 0x100, ie,
|
|
||||||
* sreset), so flag this here.
|
|
||||||
*/
|
*/
|
||||||
bool resume_as_sreset;
|
bool resume_as_sreset;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Those resources are used only in QEMU core */
|
/* These resources are used only in QEMU core */
|
||||||
target_ulong hflags; /* hflags is a MSR & HFLAGS_MASK */
|
target_ulong hflags; /* hflags is MSR & HFLAGS_MASK */
|
||||||
target_ulong hflags_nmsr; /* specific hflags, not coming from MSR */
|
target_ulong hflags_nmsr; /* specific hflags, not coming from MSR */
|
||||||
int immu_idx; /* precomputed MMU index to speed up insn access */
|
int immu_idx; /* precomputed MMU index to speed up insn accesses */
|
||||||
int dmmu_idx; /* precomputed MMU index to speed up data accesses */
|
int dmmu_idx; /* precomputed MMU index to speed up data accesses */
|
||||||
|
|
||||||
/* Power management */
|
/* Power management */
|
||||||
int (*check_pow)(CPUPPCState *env);
|
int (*check_pow)(CPUPPCState *env);
|
||||||
|
|
||||||
#if !defined(CONFIG_USER_ONLY)
|
#if !defined(CONFIG_USER_ONLY)
|
||||||
void *load_info; /* Holds boot loading state. */
|
void *load_info; /* holds boot loading state */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* booke timers */
|
/* booke timers */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Specifies bit locations of the Time Base used to signal a fixed
|
* Specifies bit locations of the Time Base used to signal a fixed timer
|
||||||
* timer exception on a transition from 0 to 1. (watchdog or
|
* exception on a transition from 0 to 1 (watchdog or fixed-interval timer)
|
||||||
* fixed-interval timer)
|
|
||||||
*
|
*
|
||||||
* 0 selects the least significant bit.
|
* 0 selects the least significant bit, 63 selects the most significant bit
|
||||||
* 63 selects the most significant bit.
|
|
||||||
*/
|
*/
|
||||||
uint8_t fit_period[4];
|
uint8_t fit_period[4];
|
||||||
uint8_t wdt_period[4];
|
uint8_t wdt_period[4];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue