mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
linux-user: Don't overuse CPUState
In target-specific code use CPU*State. While at it, fix indentation on those lines. Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
+12
-12
@@ -157,7 +157,7 @@ typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG];
|
||||
*
|
||||
* See linux kernel: arch/x86/include/asm/elf.h
|
||||
*/
|
||||
static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env)
|
||||
static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUX86State *env)
|
||||
{
|
||||
(*regs)[0] = env->regs[15];
|
||||
(*regs)[1] = env->regs[14];
|
||||
@@ -229,7 +229,7 @@ typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG];
|
||||
*
|
||||
* See linux kernel: arch/x86/include/asm/elf.h
|
||||
*/
|
||||
static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env)
|
||||
static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUX86State *env)
|
||||
{
|
||||
(*regs)[0] = env->regs[R_EBX];
|
||||
(*regs)[1] = env->regs[R_ECX];
|
||||
@@ -288,7 +288,7 @@ static inline void init_thread(struct target_pt_regs *regs,
|
||||
#define ELF_NREG 18
|
||||
typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG];
|
||||
|
||||
static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env)
|
||||
static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUARMState *env)
|
||||
{
|
||||
(*regs)[0] = tswapl(env->regs[0]);
|
||||
(*regs)[1] = tswapl(env->regs[1]);
|
||||
@@ -307,7 +307,7 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env)
|
||||
(*regs)[14] = tswapl(env->regs[14]);
|
||||
(*regs)[15] = tswapl(env->regs[15]);
|
||||
|
||||
(*regs)[16] = tswapl(cpsr_read((CPUState *)env));
|
||||
(*regs)[16] = tswapl(cpsr_read((CPUARMState *)env));
|
||||
(*regs)[17] = tswapl(env->regs[0]); /* XXX */
|
||||
}
|
||||
|
||||
@@ -410,7 +410,7 @@ static inline void init_thread(struct target_pt_regs *regs,
|
||||
#define ELF_NREG 34
|
||||
typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG];
|
||||
|
||||
static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env)
|
||||
static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUUniCore32State *env)
|
||||
{
|
||||
(*regs)[0] = env->regs[0];
|
||||
(*regs)[1] = env->regs[1];
|
||||
@@ -445,7 +445,7 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env)
|
||||
(*regs)[30] = env->regs[30];
|
||||
(*regs)[31] = env->regs[31];
|
||||
|
||||
(*regs)[32] = cpu_asr_read((CPUState *)env);
|
||||
(*regs)[32] = cpu_asr_read((CPUUniCore32State *)env);
|
||||
(*regs)[33] = env->regs[0]; /* XXX */
|
||||
}
|
||||
|
||||
@@ -572,7 +572,7 @@ enum {
|
||||
|
||||
static uint32_t get_elf_hwcap(void)
|
||||
{
|
||||
CPUState *e = thread_env;
|
||||
CPUPPCState *e = thread_env;
|
||||
uint32_t features = 0;
|
||||
|
||||
/* We don't have to be terribly complete here; the high points are
|
||||
@@ -628,7 +628,7 @@ static inline void init_thread(struct target_pt_regs *_regs, struct image_info *
|
||||
#define ELF_NREG 48
|
||||
typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG];
|
||||
|
||||
static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env)
|
||||
static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUPPCState *env)
|
||||
{
|
||||
int i;
|
||||
target_ulong ccr = 0;
|
||||
@@ -697,7 +697,7 @@ enum {
|
||||
};
|
||||
|
||||
/* See linux kernel: arch/mips/kernel/process.c:elf_dump_regs. */
|
||||
static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env)
|
||||
static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUMIPSState *env)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -749,7 +749,7 @@ static inline void init_thread(struct target_pt_regs *regs,
|
||||
typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG];
|
||||
|
||||
/* See linux kernel: arch/mips/kernel/process.c:elf_dump_regs. */
|
||||
static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env)
|
||||
static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUMBState *env)
|
||||
{
|
||||
int i, pos = 0;
|
||||
|
||||
@@ -797,7 +797,7 @@ enum {
|
||||
};
|
||||
|
||||
static inline void elf_core_copy_regs(target_elf_gregset_t *regs,
|
||||
const CPUState *env)
|
||||
const CPUSH4State *env)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -862,7 +862,7 @@ static inline void init_thread(struct target_pt_regs *regs,
|
||||
#define ELF_NREG 20
|
||||
typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG];
|
||||
|
||||
static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env)
|
||||
static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUM68KState *env)
|
||||
{
|
||||
(*regs)[0] = tswapl(env->dregs[1]);
|
||||
(*regs)[1] = tswapl(env->dregs[2]);
|
||||
|
||||
@@ -18,4 +18,4 @@ struct target_pt_regs {
|
||||
|
||||
#define UNAME_MACHINE "m68k"
|
||||
|
||||
void do_m68k_simcall(CPUState *, int);
|
||||
void do_m68k_simcall(CPUM68KState *, int);
|
||||
|
||||
+14
-14
@@ -71,7 +71,7 @@ void gemu_log(const char *fmt, ...)
|
||||
}
|
||||
|
||||
#if defined(TARGET_I386)
|
||||
int cpu_get_pic_interrupt(CPUState *env)
|
||||
int cpu_get_pic_interrupt(CPUX86State *env)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
@@ -247,7 +247,7 @@ void cpu_list_unlock(void)
|
||||
/***********************************************************/
|
||||
/* CPUX86 core interface */
|
||||
|
||||
void cpu_smm_update(CPUState *env)
|
||||
void cpu_smm_update(CPUX86State *env)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -889,7 +889,7 @@ void cpu_loop(CPUARMState *env)
|
||||
|
||||
#ifdef TARGET_UNICORE32
|
||||
|
||||
void cpu_loop(CPUState *env)
|
||||
void cpu_loop(CPUUniCore32State *env)
|
||||
{
|
||||
int trapnr;
|
||||
unsigned int n, insn;
|
||||
@@ -1226,36 +1226,36 @@ void cpu_loop (CPUSPARCState *env)
|
||||
#endif
|
||||
|
||||
#ifdef TARGET_PPC
|
||||
static inline uint64_t cpu_ppc_get_tb (CPUState *env)
|
||||
static inline uint64_t cpu_ppc_get_tb(CPUPPCState *env)
|
||||
{
|
||||
/* TO FIX */
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64_t cpu_ppc_load_tbl (CPUState *env)
|
||||
uint64_t cpu_ppc_load_tbl(CPUPPCState *env)
|
||||
{
|
||||
return cpu_ppc_get_tb(env);
|
||||
}
|
||||
|
||||
uint32_t cpu_ppc_load_tbu (CPUState *env)
|
||||
uint32_t cpu_ppc_load_tbu(CPUPPCState *env)
|
||||
{
|
||||
return cpu_ppc_get_tb(env) >> 32;
|
||||
}
|
||||
|
||||
uint64_t cpu_ppc_load_atbl (CPUState *env)
|
||||
uint64_t cpu_ppc_load_atbl(CPUPPCState *env)
|
||||
{
|
||||
return cpu_ppc_get_tb(env);
|
||||
}
|
||||
|
||||
uint32_t cpu_ppc_load_atbu (CPUState *env)
|
||||
uint32_t cpu_ppc_load_atbu(CPUPPCState *env)
|
||||
{
|
||||
return cpu_ppc_get_tb(env) >> 32;
|
||||
}
|
||||
|
||||
uint32_t cpu_ppc601_load_rtcu (CPUState *env)
|
||||
uint32_t cpu_ppc601_load_rtcu(CPUPPCState *env)
|
||||
__attribute__ (( alias ("cpu_ppc_load_tbu") ));
|
||||
|
||||
uint32_t cpu_ppc601_load_rtcl (CPUState *env)
|
||||
uint32_t cpu_ppc601_load_rtcl(CPUPPCState *env)
|
||||
{
|
||||
return cpu_ppc_load_tbl(env) & 0x3FFFFF80;
|
||||
}
|
||||
@@ -2276,7 +2276,7 @@ done_syscall:
|
||||
#endif
|
||||
|
||||
#ifdef TARGET_SH4
|
||||
void cpu_loop (CPUState *env)
|
||||
void cpu_loop(CPUSH4State *env)
|
||||
{
|
||||
int trapnr, ret;
|
||||
target_siginfo_t info;
|
||||
@@ -2335,7 +2335,7 @@ void cpu_loop (CPUState *env)
|
||||
#endif
|
||||
|
||||
#ifdef TARGET_CRIS
|
||||
void cpu_loop (CPUState *env)
|
||||
void cpu_loop(CPUCRISState *env)
|
||||
{
|
||||
int trapnr, ret;
|
||||
target_siginfo_t info;
|
||||
@@ -2393,7 +2393,7 @@ void cpu_loop (CPUState *env)
|
||||
#endif
|
||||
|
||||
#ifdef TARGET_MICROBLAZE
|
||||
void cpu_loop (CPUState *env)
|
||||
void cpu_loop(CPUMBState *env)
|
||||
{
|
||||
int trapnr, ret;
|
||||
target_siginfo_t info;
|
||||
@@ -2630,7 +2630,7 @@ static void do_store_exclusive(CPUAlphaState *env, int reg, int quad)
|
||||
queue_signal(env, TARGET_SIGSEGV, &info);
|
||||
}
|
||||
|
||||
void cpu_loop (CPUState *env)
|
||||
void cpu_loop(CPUAlphaState *env)
|
||||
{
|
||||
int trapnr;
|
||||
target_siginfo_t info;
|
||||
|
||||
+104
-97
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user