mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-24 19:01:08 +00:00
cpu: Introduce CPUNegativeOffsetState
Nothing in there so far, but all of the plumbing done within the target ArchCPU state. Backports commit 5b146dc716cfd247f99556c04e6e46fbd67565a0 from qemu
This commit is contained in:
parent
a672b89e3b
commit
8f53f09a05
|
@ -408,4 +408,28 @@ static inline CPUState *env_cpu(CPUArchState *env)
|
|||
return &env_archcpu(env)->parent_obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* env_neg(env)
|
||||
* @env: The architecture environment
|
||||
*
|
||||
* Return the CPUNegativeOffsetState associated with the environment.
|
||||
*/
|
||||
static inline CPUNegativeOffsetState *env_neg(CPUArchState *env)
|
||||
{
|
||||
ArchCPU *arch_cpu = container_of(env, ArchCPU, env);
|
||||
return &arch_cpu->neg;
|
||||
}
|
||||
|
||||
/**
|
||||
* cpu_neg(cpu)
|
||||
* @cpu: The generic CPUState
|
||||
*
|
||||
* Return the CPUNegativeOffsetState associated with the cpu.
|
||||
*/
|
||||
static inline CPUNegativeOffsetState *cpu_neg(CPUState *cpu)
|
||||
{
|
||||
ArchCPU *arch_cpu = container_of(cpu, ArchCPU, parent_obj);
|
||||
return &arch_cpu->neg;
|
||||
}
|
||||
|
||||
#endif /* CPU_ALL_H */
|
||||
|
|
|
@ -214,4 +214,13 @@ typedef struct CPUTLBDesc {
|
|||
CPU_COMMON_TLB \
|
||||
uint64_t invalid_addr; \
|
||||
int invalid_error;
|
||||
|
||||
/*
|
||||
* This structure must be placed in ArchCPU immedately
|
||||
* before CPUArchState, as a field named "neg".
|
||||
*/
|
||||
typedef struct CPUNegativeOffsetState {
|
||||
/* Empty */
|
||||
} CPUNegativeOffsetState;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -724,6 +724,7 @@ struct ARMCPU {
|
|||
CPUState parent_obj;
|
||||
/*< public >*/
|
||||
|
||||
CPUNegativeOffsetState neg;
|
||||
CPUARMState env;
|
||||
|
||||
/* Coprocessor information */
|
||||
|
|
|
@ -1311,6 +1311,7 @@ struct X86CPU {
|
|||
CPUState parent_obj;
|
||||
/*< public >*/
|
||||
|
||||
CPUNegativeOffsetState neg;
|
||||
CPUX86State env;
|
||||
|
||||
bool hyperv_vapic;
|
||||
|
|
|
@ -164,6 +164,7 @@ struct M68kCPU {
|
|||
CPUState parent_obj;
|
||||
/*< public >*/
|
||||
|
||||
CPUNegativeOffsetState neg;
|
||||
CPUM68KState env;
|
||||
};
|
||||
|
||||
|
|
|
@ -1066,6 +1066,7 @@ struct MIPSCPU {
|
|||
CPUState parent_obj;
|
||||
/*< public >*/
|
||||
|
||||
CPUNegativeOffsetState neg;
|
||||
CPUMIPSState env;
|
||||
};
|
||||
|
||||
|
|
|
@ -215,6 +215,7 @@ typedef struct RISCVCPU {
|
|||
/*< private >*/
|
||||
CPUState parent_obj;
|
||||
/*< public >*/
|
||||
CPUNegativeOffsetState neg;
|
||||
CPURISCVState env;
|
||||
} RISCVCPU;
|
||||
|
||||
|
|
|
@ -525,6 +525,7 @@ struct SPARCCPU {
|
|||
CPUState parent_obj;
|
||||
/*< public >*/
|
||||
|
||||
CPUNegativeOffsetState neg;
|
||||
CPUSPARCState env;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue