mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 12:23:53 -06:00
cpu: Replace ENV_GET_CPU with env_cpu
Now that we have both ArchCPU and CPUArchState, we can define this generically instead of via macro in each target's cpu.h. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
2161a612b4
commit
29a0af618d
59 changed files with 175 additions and 197 deletions
|
@ -5484,7 +5484,7 @@ static void *clone_func(void *arg)
|
|||
rcu_register_thread();
|
||||
tcg_register_thread();
|
||||
env = info->env;
|
||||
cpu = ENV_GET_CPU(env);
|
||||
cpu = env_cpu(env);
|
||||
thread_cpu = cpu;
|
||||
ts = (TaskState *)cpu->opaque;
|
||||
info->tid = sys_gettid();
|
||||
|
@ -5514,7 +5514,7 @@ static int do_fork(CPUArchState *env, unsigned int flags, abi_ulong newsp,
|
|||
abi_ulong parent_tidptr, target_ulong newtls,
|
||||
abi_ulong child_tidptr)
|
||||
{
|
||||
CPUState *cpu = ENV_GET_CPU(env);
|
||||
CPUState *cpu = env_cpu(env);
|
||||
int ret;
|
||||
TaskState *ts;
|
||||
CPUState *new_cpu;
|
||||
|
@ -5547,7 +5547,7 @@ static int do_fork(CPUArchState *env, unsigned int flags, abi_ulong newsp,
|
|||
new_env = cpu_copy(env);
|
||||
/* Init regs that differ from the parent. */
|
||||
cpu_clone_regs(new_env, newsp);
|
||||
new_cpu = ENV_GET_CPU(new_env);
|
||||
new_cpu = env_cpu(new_env);
|
||||
new_cpu->opaque = ts;
|
||||
ts->bprm = parent_ts->bprm;
|
||||
ts->info = parent_ts->info;
|
||||
|
@ -6654,7 +6654,7 @@ int host_to_target_waitstatus(int status)
|
|||
|
||||
static int open_self_cmdline(void *cpu_env, int fd)
|
||||
{
|
||||
CPUState *cpu = ENV_GET_CPU((CPUArchState *)cpu_env);
|
||||
CPUState *cpu = env_cpu((CPUArchState *)cpu_env);
|
||||
struct linux_binprm *bprm = ((TaskState *)cpu->opaque)->bprm;
|
||||
int i;
|
||||
|
||||
|
@ -6671,7 +6671,7 @@ static int open_self_cmdline(void *cpu_env, int fd)
|
|||
|
||||
static int open_self_maps(void *cpu_env, int fd)
|
||||
{
|
||||
CPUState *cpu = ENV_GET_CPU((CPUArchState *)cpu_env);
|
||||
CPUState *cpu = env_cpu((CPUArchState *)cpu_env);
|
||||
TaskState *ts = cpu->opaque;
|
||||
FILE *fp;
|
||||
char *line = NULL;
|
||||
|
@ -6720,7 +6720,7 @@ static int open_self_maps(void *cpu_env, int fd)
|
|||
|
||||
static int open_self_stat(void *cpu_env, int fd)
|
||||
{
|
||||
CPUState *cpu = ENV_GET_CPU((CPUArchState *)cpu_env);
|
||||
CPUState *cpu = env_cpu((CPUArchState *)cpu_env);
|
||||
TaskState *ts = cpu->opaque;
|
||||
abi_ulong start_stack = ts->info->start_stack;
|
||||
int i;
|
||||
|
@ -6757,7 +6757,7 @@ static int open_self_stat(void *cpu_env, int fd)
|
|||
|
||||
static int open_self_auxv(void *cpu_env, int fd)
|
||||
{
|
||||
CPUState *cpu = ENV_GET_CPU((CPUArchState *)cpu_env);
|
||||
CPUState *cpu = env_cpu((CPUArchState *)cpu_env);
|
||||
TaskState *ts = cpu->opaque;
|
||||
abi_ulong auxv = ts->info->saved_auxv;
|
||||
abi_ulong len = ts->info->auxv_len;
|
||||
|
@ -7042,7 +7042,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
|
|||
abi_long arg5, abi_long arg6, abi_long arg7,
|
||||
abi_long arg8)
|
||||
{
|
||||
CPUState *cpu = ENV_GET_CPU(cpu_env);
|
||||
CPUState *cpu = env_cpu(cpu_env);
|
||||
abi_long ret;
|
||||
#if defined(TARGET_NR_stat) || defined(TARGET_NR_stat64) \
|
||||
|| defined(TARGET_NR_lstat) || defined(TARGET_NR_lstat64) \
|
||||
|
@ -11706,7 +11706,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
|
|||
abi_long arg5, abi_long arg6, abi_long arg7,
|
||||
abi_long arg8)
|
||||
{
|
||||
CPUState *cpu = ENV_GET_CPU(cpu_env);
|
||||
CPUState *cpu = env_cpu(cpu_env);
|
||||
abi_long ret;
|
||||
|
||||
#ifdef DEBUG_ERESTARTSYS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue