提交 a86b3c64 编写于 作者: C Chen Gang S 提交者: Michael Tokarev

linux-user/main.c: Use TARGET_SIG* instead of SIG*

In main.c, all SIG* should be TARGET_SIG*, since the relevant functions
(queue_signal() and gdb_handlesig()) expect TARGET_SIG*.

The corresponding vi command is "1,$ s/\<SIG/TARGET_SIG/g".
Signed-off-by: NChen Gang <gang.chen.5i5j@gmail.com>
Reviewed-by: NPeter Maydell <peter.maydell@linaro.org>
Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
上级 71ec7cef
...@@ -315,7 +315,7 @@ void cpu_loop(CPUX86State *env) ...@@ -315,7 +315,7 @@ void cpu_loop(CPUX86State *env)
#endif #endif
case EXCP0B_NOSEG: case EXCP0B_NOSEG:
case EXCP0C_STACK: case EXCP0C_STACK:
info.si_signo = SIGBUS; info.si_signo = TARGET_SIGBUS;
info.si_errno = 0; info.si_errno = 0;
info.si_code = TARGET_SI_KERNEL; info.si_code = TARGET_SI_KERNEL;
info._sifields._sigfault._addr = 0; info._sifields._sigfault._addr = 0;
...@@ -329,7 +329,7 @@ void cpu_loop(CPUX86State *env) ...@@ -329,7 +329,7 @@ void cpu_loop(CPUX86State *env)
} else } else
#endif #endif
{ {
info.si_signo = SIGSEGV; info.si_signo = TARGET_SIGSEGV;
info.si_errno = 0; info.si_errno = 0;
info.si_code = TARGET_SI_KERNEL; info.si_code = TARGET_SI_KERNEL;
info._sifields._sigfault._addr = 0; info._sifields._sigfault._addr = 0;
...@@ -337,7 +337,7 @@ void cpu_loop(CPUX86State *env) ...@@ -337,7 +337,7 @@ void cpu_loop(CPUX86State *env)
} }
break; break;
case EXCP0E_PAGE: case EXCP0E_PAGE:
info.si_signo = SIGSEGV; info.si_signo = TARGET_SIGSEGV;
info.si_errno = 0; info.si_errno = 0;
if (!(env->error_code & 1)) if (!(env->error_code & 1))
info.si_code = TARGET_SEGV_MAPERR; info.si_code = TARGET_SEGV_MAPERR;
...@@ -354,7 +354,7 @@ void cpu_loop(CPUX86State *env) ...@@ -354,7 +354,7 @@ void cpu_loop(CPUX86State *env)
#endif #endif
{ {
/* division by zero */ /* division by zero */
info.si_signo = SIGFPE; info.si_signo = TARGET_SIGFPE;
info.si_errno = 0; info.si_errno = 0;
info.si_code = TARGET_FPE_INTDIV; info.si_code = TARGET_FPE_INTDIV;
info._sifields._sigfault._addr = env->eip; info._sifields._sigfault._addr = env->eip;
...@@ -369,7 +369,7 @@ void cpu_loop(CPUX86State *env) ...@@ -369,7 +369,7 @@ void cpu_loop(CPUX86State *env)
} else } else
#endif #endif
{ {
info.si_signo = SIGTRAP; info.si_signo = TARGET_SIGTRAP;
info.si_errno = 0; info.si_errno = 0;
if (trapnr == EXCP01_DB) { if (trapnr == EXCP01_DB) {
info.si_code = TARGET_TRAP_BRKPT; info.si_code = TARGET_TRAP_BRKPT;
...@@ -389,7 +389,7 @@ void cpu_loop(CPUX86State *env) ...@@ -389,7 +389,7 @@ void cpu_loop(CPUX86State *env)
} else } else
#endif #endif
{ {
info.si_signo = SIGSEGV; info.si_signo = TARGET_SIGSEGV;
info.si_errno = 0; info.si_errno = 0;
info.si_code = TARGET_SI_KERNEL; info.si_code = TARGET_SI_KERNEL;
info._sifields._sigfault._addr = 0; info._sifields._sigfault._addr = 0;
...@@ -397,7 +397,7 @@ void cpu_loop(CPUX86State *env) ...@@ -397,7 +397,7 @@ void cpu_loop(CPUX86State *env)
} }
break; break;
case EXCP06_ILLOP: case EXCP06_ILLOP:
info.si_signo = SIGILL; info.si_signo = TARGET_SIGILL;
info.si_errno = 0; info.si_errno = 0;
info.si_code = TARGET_ILL_ILLOPN; info.si_code = TARGET_ILL_ILLOPN;
info._sifields._sigfault._addr = env->eip; info._sifields._sigfault._addr = env->eip;
...@@ -519,7 +519,7 @@ segv: ...@@ -519,7 +519,7 @@ segv:
end_exclusive(); end_exclusive();
/* We get the PC of the entry address - which is as good as anything, /* We get the PC of the entry address - which is as good as anything,
on a real kernel what you get depends on which mode it uses. */ on a real kernel what you get depends on which mode it uses. */
info.si_signo = SIGSEGV; info.si_signo = TARGET_SIGSEGV;
info.si_errno = 0; info.si_errno = 0;
/* XXX: check env->error_code */ /* XXX: check env->error_code */
info.si_code = TARGET_SEGV_MAPERR; info.si_code = TARGET_SEGV_MAPERR;
...@@ -696,7 +696,7 @@ void cpu_loop(CPUARMState *env) ...@@ -696,7 +696,7 @@ void cpu_loop(CPUARMState *env)
rc = EmulateAll(opcode, &ts->fpa, env); rc = EmulateAll(opcode, &ts->fpa, env);
if (rc == 0) { /* illegal instruction */ if (rc == 0) { /* illegal instruction */
info.si_signo = SIGILL; info.si_signo = TARGET_SIGILL;
info.si_errno = 0; info.si_errno = 0;
info.si_code = TARGET_ILL_ILLOPN; info.si_code = TARGET_ILL_ILLOPN;
info._sifields._sigfault._addr = env->regs[15]; info._sifields._sigfault._addr = env->regs[15];
...@@ -720,7 +720,7 @@ void cpu_loop(CPUARMState *env) ...@@ -720,7 +720,7 @@ void cpu_loop(CPUARMState *env)
//printf("fpsr 0x%x, arm_fpe 0x%x\n",fpsr,arm_fpe); //printf("fpsr 0x%x, arm_fpe 0x%x\n",fpsr,arm_fpe);
if (fpsr & (arm_fpe << 16)) { /* exception enabled? */ if (fpsr & (arm_fpe << 16)) { /* exception enabled? */
info.si_signo = SIGFPE; info.si_signo = TARGET_SIGFPE;
info.si_errno = 0; info.si_errno = 0;
/* ordered by priority, least first */ /* ordered by priority, least first */
...@@ -844,7 +844,7 @@ void cpu_loop(CPUARMState *env) ...@@ -844,7 +844,7 @@ void cpu_loop(CPUARMState *env)
case EXCP_DATA_ABORT: case EXCP_DATA_ABORT:
addr = env->exception.vaddress; addr = env->exception.vaddress;
{ {
info.si_signo = SIGSEGV; info.si_signo = TARGET_SIGSEGV;
info.si_errno = 0; info.si_errno = 0;
/* XXX: check env->error_code */ /* XXX: check env->error_code */
info.si_code = TARGET_SEGV_MAPERR; info.si_code = TARGET_SEGV_MAPERR;
...@@ -1030,7 +1030,7 @@ void cpu_loop(CPUARMState *env) ...@@ -1030,7 +1030,7 @@ void cpu_loop(CPUARMState *env)
/* just indicate that signals should be handled asap */ /* just indicate that signals should be handled asap */
break; break;
case EXCP_UDEF: case EXCP_UDEF:
info.si_signo = SIGILL; info.si_signo = TARGET_SIGILL;
info.si_errno = 0; info.si_errno = 0;
info.si_code = TARGET_ILL_ILLOPN; info.si_code = TARGET_ILL_ILLOPN;
info._sifields._sigfault._addr = env->pc; info._sifields._sigfault._addr = env->pc;
...@@ -1043,7 +1043,7 @@ void cpu_loop(CPUARMState *env) ...@@ -1043,7 +1043,7 @@ void cpu_loop(CPUARMState *env)
/* fall through for segv */ /* fall through for segv */
case EXCP_PREFETCH_ABORT: case EXCP_PREFETCH_ABORT:
case EXCP_DATA_ABORT: case EXCP_DATA_ABORT:
info.si_signo = SIGSEGV; info.si_signo = TARGET_SIGSEGV;
info.si_errno = 0; info.si_errno = 0;
/* XXX: check env->error_code */ /* XXX: check env->error_code */
info.si_code = TARGET_SEGV_MAPERR; info.si_code = TARGET_SEGV_MAPERR;
...@@ -1123,7 +1123,7 @@ void cpu_loop(CPUUniCore32State *env) ...@@ -1123,7 +1123,7 @@ void cpu_loop(CPUUniCore32State *env)
break; break;
case UC32_EXCP_DTRAP: case UC32_EXCP_DTRAP:
case UC32_EXCP_ITRAP: case UC32_EXCP_ITRAP:
info.si_signo = SIGSEGV; info.si_signo = TARGET_SIGSEGV;
info.si_errno = 0; info.si_errno = 0;
/* XXX: check env->error_code */ /* XXX: check env->error_code */
info.si_code = TARGET_SEGV_MAPERR; info.si_code = TARGET_SEGV_MAPERR;
...@@ -2672,7 +2672,7 @@ void cpu_loop(CPUOpenRISCState *env) ...@@ -2672,7 +2672,7 @@ void cpu_loop(CPUOpenRISCState *env)
break; break;
case EXCP_BUSERR: case EXCP_BUSERR:
qemu_log("\nBus error, exit, pc is %#x\n", env->pc); qemu_log("\nBus error, exit, pc is %#x\n", env->pc);
gdbsig = SIGBUS; gdbsig = TARGET_SIGBUS;
break; break;
case EXCP_DPF: case EXCP_DPF:
case EXCP_IPF: case EXCP_IPF:
...@@ -2684,11 +2684,11 @@ void cpu_loop(CPUOpenRISCState *env) ...@@ -2684,11 +2684,11 @@ void cpu_loop(CPUOpenRISCState *env)
break; break;
case EXCP_ALIGN: case EXCP_ALIGN:
qemu_log("\nAlignment pc is %#x\n", env->pc); qemu_log("\nAlignment pc is %#x\n", env->pc);
gdbsig = SIGBUS; gdbsig = TARGET_SIGBUS;
break; break;
case EXCP_ILLEGAL: case EXCP_ILLEGAL:
qemu_log("\nIllegal instructionpc is %#x\n", env->pc); qemu_log("\nIllegal instructionpc is %#x\n", env->pc);
gdbsig = SIGILL; gdbsig = TARGET_SIGILL;
break; break;
case EXCP_INT: case EXCP_INT:
qemu_log("\nExternal interruptpc is %#x\n", env->pc); qemu_log("\nExternal interruptpc is %#x\n", env->pc);
...@@ -2699,7 +2699,7 @@ void cpu_loop(CPUOpenRISCState *env) ...@@ -2699,7 +2699,7 @@ void cpu_loop(CPUOpenRISCState *env)
break; break;
case EXCP_RANGE: case EXCP_RANGE:
qemu_log("\nRange\n"); qemu_log("\nRange\n");
gdbsig = SIGSEGV; gdbsig = TARGET_SIGSEGV;
break; break;
case EXCP_SYSCALL: case EXCP_SYSCALL:
env->pc += 4; /* 0xc00; */ env->pc += 4; /* 0xc00; */
...@@ -2717,7 +2717,7 @@ void cpu_loop(CPUOpenRISCState *env) ...@@ -2717,7 +2717,7 @@ void cpu_loop(CPUOpenRISCState *env)
break; break;
case EXCP_TRAP: case EXCP_TRAP:
qemu_log("\nTrap\n"); qemu_log("\nTrap\n");
gdbsig = SIGTRAP; gdbsig = TARGET_SIGTRAP;
break; break;
case EXCP_NR: case EXCP_NR:
qemu_log("\nNR\n"); qemu_log("\nNR\n");
...@@ -2787,7 +2787,7 @@ void cpu_loop(CPUSH4State *env) ...@@ -2787,7 +2787,7 @@ void cpu_loop(CPUSH4State *env)
break; break;
case 0xa0: case 0xa0:
case 0xc0: case 0xc0:
info.si_signo = SIGSEGV; info.si_signo = TARGET_SIGSEGV;
info.si_errno = 0; info.si_errno = 0;
info.si_code = TARGET_SEGV_MAPERR; info.si_code = TARGET_SEGV_MAPERR;
info._sifields._sigfault._addr = env->tea; info._sifields._sigfault._addr = env->tea;
...@@ -2818,7 +2818,7 @@ void cpu_loop(CPUCRISState *env) ...@@ -2818,7 +2818,7 @@ void cpu_loop(CPUCRISState *env)
switch (trapnr) { switch (trapnr) {
case 0xaa: case 0xaa:
{ {
info.si_signo = SIGSEGV; info.si_signo = TARGET_SIGSEGV;
info.si_errno = 0; info.si_errno = 0;
/* XXX: check env->error_code */ /* XXX: check env->error_code */
info.si_code = TARGET_SEGV_MAPERR; info.si_code = TARGET_SEGV_MAPERR;
...@@ -2879,7 +2879,7 @@ void cpu_loop(CPUMBState *env) ...@@ -2879,7 +2879,7 @@ void cpu_loop(CPUMBState *env)
switch (trapnr) { switch (trapnr) {
case 0xaa: case 0xaa:
{ {
info.si_signo = SIGSEGV; info.si_signo = TARGET_SIGSEGV;
info.si_errno = 0; info.si_errno = 0;
/* XXX: check env->error_code */ /* XXX: check env->error_code */
info.si_code = TARGET_SEGV_MAPERR; info.si_code = TARGET_SEGV_MAPERR;
...@@ -2917,14 +2917,14 @@ void cpu_loop(CPUMBState *env) ...@@ -2917,14 +2917,14 @@ void cpu_loop(CPUMBState *env)
switch (env->sregs[SR_ESR] & 31) { switch (env->sregs[SR_ESR] & 31) {
case ESR_EC_DIVZERO: case ESR_EC_DIVZERO:
info.si_signo = SIGFPE; info.si_signo = TARGET_SIGFPE;
info.si_errno = 0; info.si_errno = 0;
info.si_code = TARGET_FPE_FLTDIV; info.si_code = TARGET_FPE_FLTDIV;
info._sifields._sigfault._addr = 0; info._sifields._sigfault._addr = 0;
queue_signal(env, info.si_signo, &info); queue_signal(env, info.si_signo, &info);
break; break;
case ESR_EC_FPU: case ESR_EC_FPU:
info.si_signo = SIGFPE; info.si_signo = TARGET_SIGFPE;
info.si_errno = 0; info.si_errno = 0;
if (env->sregs[SR_FSR] & FSR_IO) { if (env->sregs[SR_FSR] & FSR_IO) {
info.si_code = TARGET_FPE_FLTINV; info.si_code = TARGET_FPE_FLTINV;
...@@ -3003,7 +3003,7 @@ void cpu_loop(CPUM68KState *env) ...@@ -3003,7 +3003,7 @@ void cpu_loop(CPUM68KState *env)
case EXCP_LINEF: case EXCP_LINEF:
case EXCP_UNSUPPORTED: case EXCP_UNSUPPORTED:
do_sigill: do_sigill:
info.si_signo = SIGILL; info.si_signo = TARGET_SIGILL;
info.si_errno = 0; info.si_errno = 0;
info.si_code = TARGET_ILL_ILLOPN; info.si_code = TARGET_ILL_ILLOPN;
info._sifields._sigfault._addr = env->pc; info._sifields._sigfault._addr = env->pc;
...@@ -3030,7 +3030,7 @@ void cpu_loop(CPUM68KState *env) ...@@ -3030,7 +3030,7 @@ void cpu_loop(CPUM68KState *env)
break; break;
case EXCP_ACCESS: case EXCP_ACCESS:
{ {
info.si_signo = SIGSEGV; info.si_signo = TARGET_SIGSEGV;
info.si_errno = 0; info.si_errno = 0;
/* XXX: check env->error_code */ /* XXX: check env->error_code */
info.si_code = TARGET_SEGV_MAPERR; info.si_code = TARGET_SEGV_MAPERR;
...@@ -3337,12 +3337,12 @@ void cpu_loop(CPUS390XState *env) ...@@ -3337,12 +3337,12 @@ void cpu_loop(CPUS390XState *env)
switch (n) { switch (n) {
case PGM_OPERATION: case PGM_OPERATION:
case PGM_PRIVILEGED: case PGM_PRIVILEGED:
sig = SIGILL; sig = TARGET_SIGILL;
n = TARGET_ILL_ILLOPC; n = TARGET_ILL_ILLOPC;
goto do_signal_pc; goto do_signal_pc;
case PGM_PROTECTION: case PGM_PROTECTION:
case PGM_ADDRESSING: case PGM_ADDRESSING:
sig = SIGSEGV; sig = TARGET_SIGSEGV;
/* XXX: check env->error_code */ /* XXX: check env->error_code */
n = TARGET_SEGV_MAPERR; n = TARGET_SEGV_MAPERR;
addr = env->__excp_addr; addr = env->__excp_addr;
...@@ -3352,16 +3352,16 @@ void cpu_loop(CPUS390XState *env) ...@@ -3352,16 +3352,16 @@ void cpu_loop(CPUS390XState *env)
case PGM_SPECIAL_OP: case PGM_SPECIAL_OP:
case PGM_OPERAND: case PGM_OPERAND:
do_sigill_opn: do_sigill_opn:
sig = SIGILL; sig = TARGET_SIGILL;
n = TARGET_ILL_ILLOPN; n = TARGET_ILL_ILLOPN;
goto do_signal_pc; goto do_signal_pc;
case PGM_FIXPT_OVERFLOW: case PGM_FIXPT_OVERFLOW:
sig = SIGFPE; sig = TARGET_SIGFPE;
n = TARGET_FPE_INTOVF; n = TARGET_FPE_INTOVF;
goto do_signal_pc; goto do_signal_pc;
case PGM_FIXPT_DIVIDE: case PGM_FIXPT_DIVIDE:
sig = SIGFPE; sig = TARGET_SIGFPE;
n = TARGET_FPE_INTDIV; n = TARGET_FPE_INTDIV;
goto do_signal_pc; goto do_signal_pc;
...@@ -3386,7 +3386,7 @@ void cpu_loop(CPUS390XState *env) ...@@ -3386,7 +3386,7 @@ void cpu_loop(CPUS390XState *env)
/* ??? Quantum exception; BFP, DFP error. */ /* ??? Quantum exception; BFP, DFP error. */
goto do_sigill_opn; goto do_sigill_opn;
} }
sig = SIGFPE; sig = TARGET_SIGFPE;
goto do_signal_pc; goto do_signal_pc;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册