linux-user: Rename TARGET_QEMU_ESIGRETURN to QEMU_ESIGRETURN

This value is fully internal to qemu, and so is not a TARGET define.

Reviewed-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Richard Henderson 2021-11-17 05:14:52 -08:00
parent ea8ee3ee93
commit 57a0c9384c
35 changed files with 70 additions and 70 deletions

View File

@ -101,7 +101,7 @@ void cpu_loop(CPUARMState *env)
0, 0);
if (ret == -QEMU_ERESTARTSYS) {
env->pc -= 4;
} else if (ret != -TARGET_QEMU_ESIGRETURN) {
} else if (ret != -QEMU_ESIGRETURN) {
env->xregs[0] = ret;
}
break;

View File

@ -556,12 +556,12 @@ long do_rt_sigreturn(CPUARMState *env)
target_restore_altstack(&frame->uc.tuc_stack, env);
unlock_user_struct(frame, frame_addr, 0);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
badframe:
unlock_user_struct(frame, frame_addr, 0);
force_sig(TARGET_SIGSEGV);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
}
long do_sigreturn(CPUARMState *env)

View File

@ -102,7 +102,7 @@ void cpu_loop(CPUAlphaState *env)
env->pc -= 4;
break;
}
if (sysret == -TARGET_QEMU_ESIGRETURN) {
if (sysret == -QEMU_ESIGRETURN) {
break;
}
/* Syscall writes 0 to V0 to bypass error check, similar

View File

@ -225,11 +225,11 @@ long do_sigreturn(CPUAlphaState *env)
restore_sigcontext(env, sc);
unlock_user_struct(sc, sc_addr, 0);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
badframe:
force_sig(TARGET_SIGSEGV);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
}
long do_rt_sigreturn(CPUAlphaState *env)
@ -249,13 +249,13 @@ long do_rt_sigreturn(CPUAlphaState *env)
target_restore_altstack(&frame->uc.tuc_stack, env);
unlock_user_struct(frame, frame_addr, 0);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
badframe:
unlock_user_struct(frame, frame_addr, 0);
force_sig(TARGET_SIGSEGV);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
}
void setup_sigtramp(abi_ulong sigtramp_page)

View File

@ -409,7 +409,7 @@ void cpu_loop(CPUARMState *env)
0, 0);
if (ret == -QEMU_ERESTARTSYS) {
env->regs[15] -= env->thumb ? 2 : 4;
} else if (ret != -TARGET_QEMU_ESIGRETURN) {
} else if (ret != -QEMU_ESIGRETURN) {
env->regs[0] = ret;
}
}

View File

@ -511,12 +511,12 @@ long do_sigreturn(CPUARMState *env)
}
unlock_user_struct(frame, frame_addr, 0);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
badframe:
unlock_user_struct(frame, frame_addr, 0);
force_sig(TARGET_SIGSEGV);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
}
long do_rt_sigreturn(CPUARMState *env)
@ -546,12 +546,12 @@ long do_rt_sigreturn(CPUARMState *env)
}
unlock_user_struct(frame, frame_addr, 0);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
badframe:
unlock_user_struct(frame, frame_addr, 0);
force_sig(TARGET_SIGSEGV);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
}
/*

View File

@ -52,7 +52,7 @@ void cpu_loop(CPUCRISState *env)
0, 0);
if (ret == -QEMU_ERESTARTSYS) {
env->pc -= 2;
} else if (ret != -TARGET_QEMU_ESIGRETURN) {
} else if (ret != -QEMU_ESIGRETURN) {
env->regs[10] = ret;
}
break;

View File

@ -177,10 +177,10 @@ long do_sigreturn(CPUCRISState *env)
restore_sigcontext(&frame->sc, env);
unlock_user_struct(frame, frame_addr, 0);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
badframe:
force_sig(TARGET_SIGSEGV);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
}
long do_rt_sigreturn(CPUCRISState *env)

View File

@ -162,6 +162,6 @@
* ERESTART_NOINTR (which is kernel internal) to guarantee that we won't
* clash with a valid guest errno now or in the future.
*/
#define TARGET_QEMU_ESIGRETURN 513 /* Return from signal */
#define QEMU_ESIGRETURN 513 /* Return from signal */
#endif

View File

@ -57,7 +57,7 @@ void cpu_loop(CPUHexagonState *env)
0, 0);
if (ret == -QEMU_ERESTARTSYS) {
env->gpr[HEX_REG_PC] -= 4;
} else if (ret != -TARGET_QEMU_ESIGRETURN) {
} else if (ret != -QEMU_ESIGRETURN) {
env->gpr[0] = ret;
}
break;

View File

@ -268,7 +268,7 @@ long do_rt_sigreturn(CPUHexagonState *env)
target_restore_altstack(&frame->uc.uc_stack, env);
unlock_user_struct(frame, frame_addr, 0);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
badframe:
unlock_user_struct(frame, frame_addr, 0);

View File

@ -134,7 +134,7 @@ void cpu_loop(CPUHPPAState *env)
env->iaoq_b = env->gr[31] + 4;
break;
case -QEMU_ERESTARTSYS:
case -TARGET_QEMU_ESIGRETURN:
case -QEMU_ESIGRETURN:
break;
}
break;

View File

@ -191,9 +191,9 @@ long do_rt_sigreturn(CPUArchState *env)
target_restore_altstack(&frame->uc.tuc_stack, env);
unlock_user_struct(frame, frame_addr, 0);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
badframe:
force_sig(TARGET_SIGSEGV);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
}

View File

@ -181,7 +181,7 @@ static void emulate_vsyscall(CPUX86State *env)
env->regs[R_EDX], env->regs[10], env->regs[8],
env->regs[9], 0, 0);
g_assert(ret != -QEMU_ERESTARTSYS);
g_assert(ret != -TARGET_QEMU_ESIGRETURN);
g_assert(ret != -QEMU_ESIGRETURN);
if (ret == -TARGET_EFAULT) {
goto sigsegv;
}
@ -225,7 +225,7 @@ void cpu_loop(CPUX86State *env)
0, 0);
if (ret == -QEMU_ERESTARTSYS) {
env->eip -= 2;
} else if (ret != -TARGET_QEMU_ESIGRETURN) {
} else if (ret != -QEMU_ESIGRETURN) {
env->regs[R_EAX] = ret;
}
break;
@ -243,7 +243,7 @@ void cpu_loop(CPUX86State *env)
0, 0);
if (ret == -QEMU_ERESTARTSYS) {
env->eip -= 2;
} else if (ret != -TARGET_QEMU_ESIGRETURN) {
} else if (ret != -QEMU_ESIGRETURN) {
env->regs[R_EAX] = ret;
}
break;

View File

@ -559,12 +559,12 @@ long do_sigreturn(CPUX86State *env)
if (restore_sigcontext(env, &frame->sc))
goto badframe;
unlock_user_struct(frame, frame_addr, 0);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
badframe:
unlock_user_struct(frame, frame_addr, 0);
force_sig(TARGET_SIGSEGV);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
}
#endif
@ -588,12 +588,12 @@ long do_rt_sigreturn(CPUX86State *env)
target_restore_altstack(&frame->uc.tuc_stack, env);
unlock_user_struct(frame, frame_addr, 0);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
badframe:
unlock_user_struct(frame, frame_addr, 0);
force_sig(TARGET_SIGSEGV);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
}
#ifndef TARGET_X86_64

View File

@ -82,7 +82,7 @@ void cpu_loop(CPUM68KState *env)
0, 0);
if (ret == -QEMU_ERESTARTSYS) {
env->pc -= 2;
} else if (ret != -TARGET_QEMU_ESIGRETURN) {
} else if (ret != -QEMU_ESIGRETURN) {
env->dregs[0] = ret;
}
}

View File

@ -353,11 +353,11 @@ long do_sigreturn(CPUM68KState *env)
restore_sigcontext(env, &frame->sc);
unlock_user_struct(frame, frame_addr, 0);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
badframe:
force_sig(TARGET_SIGSEGV);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
}
long do_rt_sigreturn(CPUM68KState *env)
@ -381,12 +381,12 @@ long do_rt_sigreturn(CPUM68KState *env)
target_restore_altstack(&frame->uc.tuc_stack, env);
unlock_user_struct(frame, frame_addr, 0);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
badframe:
unlock_user_struct(frame, frame_addr, 0);
force_sig(TARGET_SIGSEGV);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
}
void setup_sigtramp(abi_ulong sigtramp_page)

View File

@ -56,7 +56,7 @@ void cpu_loop(CPUMBState *env)
if (ret == -QEMU_ERESTARTSYS) {
/* Wind back to before the syscall. */
env->pc -= 4;
} else if (ret != -TARGET_QEMU_ESIGRETURN) {
} else if (ret != -QEMU_ESIGRETURN) {
env->regs[3] = ret;
}
/* All syscall exits result in guest r14 being equal to the

View File

@ -207,12 +207,12 @@ long do_rt_sigreturn(CPUMBState *env)
target_restore_altstack(&frame->uc.tuc_stack, env);
unlock_user_struct(frame, frame_addr, 0);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
badframe:
unlock_user_struct(frame, frame_addr, 0);
force_sig(TARGET_SIGSEGV);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
}
void setup_sigtramp(abi_ulong sigtramp_page)

View File

@ -145,7 +145,7 @@ done_syscall:
env->active_tc.PC -= 4;
break;
}
if (ret == -TARGET_QEMU_ESIGRETURN) {
if (ret == -QEMU_ESIGRETURN) {
/* Returning from a successful sigreturn syscall.
Avoid clobbering register state. */
break;

View File

@ -281,11 +281,11 @@ long do_sigreturn(CPUMIPSState *regs)
/* I am not sure this is right, but it seems to work
* maybe a problem with nested signals ? */
regs->CP0_EPC = 0;
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
badframe:
force_sig(TARGET_SIGSEGV);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
}
# endif /* O32 */
@ -371,11 +371,11 @@ long do_rt_sigreturn(CPUMIPSState *env)
/* I am not sure this is right, but it seems to work
* maybe a problem with nested signals ? */
env->CP0_EPC = 0;
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
badframe:
force_sig(TARGET_SIGSEGV);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
}
void setup_sigtramp(abi_ulong sigtramp_page)

View File

@ -50,7 +50,7 @@ void cpu_loop(CPUOpenRISCState *env)
cpu_get_gpr(env, 8), 0, 0);
if (ret == -QEMU_ERESTARTSYS) {
env->pc -= 4;
} else if (ret != -TARGET_QEMU_ESIGRETURN) {
} else if (ret != -QEMU_ESIGRETURN) {
cpu_set_gpr(env, 11, ret);
}
break;

View File

@ -432,7 +432,7 @@ void cpu_loop(CPUPPCState *env)
env->nip -= 4;
break;
}
if (ret == (target_ulong)(-TARGET_QEMU_ESIGRETURN)) {
if (ret == (target_ulong)(-QEMU_ESIGRETURN)) {
/* Returning from a successful sigreturn syscall.
Avoid corrupting register state. */
break;

View File

@ -591,13 +591,13 @@ long do_sigreturn(CPUPPCState *env)
unlock_user_struct(sr, sr_addr, 1);
unlock_user_struct(sc, sc_addr, 1);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
sigsegv:
unlock_user_struct(sr, sr_addr, 1);
unlock_user_struct(sc, sc_addr, 1);
force_sig(TARGET_SIGSEGV);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
}
#endif /* !defined(TARGET_PPC64) */
@ -646,12 +646,12 @@ long do_rt_sigreturn(CPUPPCState *env)
target_restore_altstack(&rt_sf->uc.tuc_stack, env);
unlock_user_struct(rt_sf, rt_sf_addr, 1);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
sigsegv:
unlock_user_struct(rt_sf, rt_sf_addr, 1);
force_sig(TARGET_SIGSEGV);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
}
/* This syscall implements {get,set,swap}context for userland. */
@ -704,7 +704,7 @@ abi_long do_swapcontext(CPUArchState *env, abi_ulong uold_ctx,
/* We cannot return to a partially updated context. */
force_sig(TARGET_SIGSEGV);
}
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
}
return 0;

View File

@ -71,7 +71,7 @@ void cpu_loop(CPURISCVState *env)
}
if (ret == -QEMU_ERESTARTSYS) {
env->pc -= 4;
} else if (ret != -TARGET_QEMU_ESIGRETURN) {
} else if (ret != -QEMU_ESIGRETURN) {
env->gpr[xA0] = ret;
}
if (cs->singlestep_enabled) {

View File

@ -188,7 +188,7 @@ long do_rt_sigreturn(CPURISCVState *env)
target_restore_altstack(&frame->uc.uc_stack, env);
unlock_user_struct(frame, frame_addr, 0);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
badframe:
unlock_user_struct(frame, frame_addr, 0);

View File

@ -85,7 +85,7 @@ void cpu_loop(CPUS390XState *env)
env->regs[6], env->regs[7], 0, 0);
if (ret == -QEMU_ERESTARTSYS) {
env->psw.addr -= env->int_svc_ilen;
} else if (ret != -TARGET_QEMU_ESIGRETURN) {
} else if (ret != -QEMU_ESIGRETURN) {
env->regs[2] = ret;
}
break;

View File

@ -359,7 +359,7 @@ long do_sigreturn(CPUS390XState *env)
trace_user_do_sigreturn(env, frame_addr);
if (!lock_user_struct(VERIFY_READ, frame, frame_addr, 1)) {
force_sig(TARGET_SIGSEGV);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
}
/* Make sure that we're initializing all of target_set. */
@ -373,7 +373,7 @@ long do_sigreturn(CPUS390XState *env)
restore_sigregs_ext(env, &frame->sregs_ext);
unlock_user_struct(frame, frame_addr, 0);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
}
long do_rt_sigreturn(CPUS390XState *env)
@ -385,7 +385,7 @@ long do_rt_sigreturn(CPUS390XState *env)
trace_user_do_rt_sigreturn(env, frame_addr);
if (!lock_user_struct(VERIFY_READ, frame, frame_addr, 1)) {
force_sig(TARGET_SIGSEGV);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
}
target_to_host_sigset(&set, &frame->uc.tuc_sigmask);
@ -397,7 +397,7 @@ long do_rt_sigreturn(CPUS390XState *env)
target_restore_altstack(&frame->uc.tuc_stack, env);
unlock_user_struct(frame, frame_addr, 0);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
}
void setup_sigtramp(abi_ulong sigtramp_page)

View File

@ -52,7 +52,7 @@ void cpu_loop(CPUSH4State *env)
0, 0);
if (ret == -QEMU_ERESTARTSYS) {
env->pc -= 2;
} else if (ret != -TARGET_QEMU_ESIGRETURN) {
} else if (ret != -QEMU_ESIGRETURN) {
env->gregs[0] = ret;
}
break;

View File

@ -286,12 +286,12 @@ long do_sigreturn(CPUSH4State *regs)
restore_sigcontext(regs, &frame->sc);
unlock_user_struct(frame, frame_addr, 0);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
badframe:
unlock_user_struct(frame, frame_addr, 0);
force_sig(TARGET_SIGSEGV);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
}
long do_rt_sigreturn(CPUSH4State *regs)
@ -313,12 +313,12 @@ long do_rt_sigreturn(CPUSH4State *regs)
target_restore_altstack(&frame->uc.tuc_stack, regs);
unlock_user_struct(frame, frame_addr, 0);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
badframe:
unlock_user_struct(frame, frame_addr, 0);
force_sig(TARGET_SIGSEGV);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
}
void setup_sigtramp(abi_ulong sigtramp_page)

View File

@ -181,7 +181,7 @@ void cpu_loop (CPUSPARCState *env)
env->regwptr[2], env->regwptr[3],
env->regwptr[4], env->regwptr[5],
0, 0);
if (ret == -QEMU_ERESTARTSYS || ret == -TARGET_QEMU_ESIGRETURN) {
if (ret == -QEMU_ERESTARTSYS || ret == -QEMU_ESIGRETURN) {
break;
}
if ((abi_ulong)ret >= (abi_ulong)(-515)) {

View File

@ -431,12 +431,12 @@ long do_sigreturn(CPUSPARCState *env)
set_sigmask(&host_set);
unlock_user_struct(sf, sf_addr, 0);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
segv_and_exit:
unlock_user_struct(sf, sf_addr, 0);
force_sig(TARGET_SIGSEGV);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
#else
return -TARGET_ENOSYS;
#endif
@ -495,12 +495,12 @@ long do_rt_sigreturn(CPUSPARCState *env)
env->npc = tnpc;
unlock_user_struct(sf, sf_addr, 0);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
segv_and_exit:
unlock_user_struct(sf, sf_addr, 0);
force_sig(TARGET_SIGSEGV);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
}
#if defined(TARGET_SPARC64) && !defined(TARGET_ABI32)

View File

@ -550,7 +550,7 @@ const char *target_strerror(int err)
if (err == QEMU_ERESTARTSYS) {
return "To be restarted";
}
if (err == TARGET_QEMU_ESIGRETURN) {
if (err == QEMU_ESIGRETURN) {
return "Successful exit from sigreturn";
}

View File

@ -188,7 +188,7 @@ void cpu_loop(CPUXtensaState *env)
env->pc -= 3;
break;
case -TARGET_QEMU_ESIGRETURN:
case -QEMU_ESIGRETURN:
break;
}
break;

View File

@ -263,12 +263,12 @@ long do_rt_sigreturn(CPUXtensaState *env)
target_restore_altstack(&frame->uc.tuc_stack, env);
unlock_user_struct(frame, frame_addr, 0);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
badframe:
unlock_user_struct(frame, frame_addr, 0);
force_sig(TARGET_SIGSEGV);
return -TARGET_QEMU_ESIGRETURN;
return -QEMU_ESIGRETURN;
}
void setup_sigtramp(abi_ulong sigtramp_page)