[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 03/20] bsd-user: style tweak: Remove #if 0'd code
From: |
Warner Losh |
Subject: |
[PULL 03/20] bsd-user: style tweak: Remove #if 0'd code |
Date: |
Wed, 12 May 2021 11:17:03 -0600 |
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
---
bsd-user/main.c | 143 ------------------------------------------------
1 file changed, 143 deletions(-)
diff --git a/bsd-user/main.c b/bsd-user/main.c
index 5253ceb24b..c342dd7829 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -243,118 +243,10 @@ void cpu_loop(CPUX86State *env)
env->eflags &= ~CC_C;
}
break;
-#endif
-#if 0
- case EXCP0B_NOSEG:
- case EXCP0C_STACK:
- info.si_signo = SIGBUS;
- info.si_errno = 0;
- info.si_code = TARGET_SI_KERNEL;
- info._sifields._sigfault._addr = 0;
- queue_signal(env, info.si_signo, &info);
- break;
- case EXCP0D_GPF:
- /* XXX: potential problem if ABI32 */
-#ifndef TARGET_X86_64
- if (env->eflags & VM_MASK) {
- handle_vm86_fault(env);
- } else
-#endif
- {
- info.si_signo = SIGSEGV;
- info.si_errno = 0;
- info.si_code = TARGET_SI_KERNEL;
- info._sifields._sigfault._addr = 0;
- queue_signal(env, info.si_signo, &info);
- }
- break;
- case EXCP0E_PAGE:
- info.si_signo = SIGSEGV;
- info.si_errno = 0;
- if (!(env->error_code & 1))
- info.si_code = TARGET_SEGV_MAPERR;
- else
- info.si_code = TARGET_SEGV_ACCERR;
- info._sifields._sigfault._addr = env->cr[2];
- queue_signal(env, info.si_signo, &info);
- break;
- case EXCP00_DIVZ:
-#ifndef TARGET_X86_64
- if (env->eflags & VM_MASK) {
- handle_vm86_trap(env, trapnr);
- } else
-#endif
- {
- /* division by zero */
- info.si_signo = SIGFPE;
- info.si_errno = 0;
- info.si_code = TARGET_FPE_INTDIV;
- info._sifields._sigfault._addr = env->eip;
- queue_signal(env, info.si_signo, &info);
- }
- break;
- case EXCP01_DB:
- case EXCP03_INT3:
-#ifndef TARGET_X86_64
- if (env->eflags & VM_MASK) {
- handle_vm86_trap(env, trapnr);
- } else
-#endif
- {
- info.si_signo = SIGTRAP;
- info.si_errno = 0;
- if (trapnr == EXCP01_DB) {
- info.si_code = TARGET_TRAP_BRKPT;
- info._sifields._sigfault._addr = env->eip;
- } else {
- info.si_code = TARGET_SI_KERNEL;
- info._sifields._sigfault._addr = 0;
- }
- queue_signal(env, info.si_signo, &info);
- }
- break;
- case EXCP04_INTO:
- case EXCP05_BOUND:
-#ifndef TARGET_X86_64
- if (env->eflags & VM_MASK) {
- handle_vm86_trap(env, trapnr);
- } else
-#endif
- {
- info.si_signo = SIGSEGV;
- info.si_errno = 0;
- info.si_code = TARGET_SI_KERNEL;
- info._sifields._sigfault._addr = 0;
- queue_signal(env, info.si_signo, &info);
- }
- break;
- case EXCP06_ILLOP:
- info.si_signo = SIGILL;
- info.si_errno = 0;
- info.si_code = TARGET_ILL_ILLOPN;
- info._sifields._sigfault._addr = env->eip;
- queue_signal(env, info.si_signo, &info);
- break;
#endif
case EXCP_INTERRUPT:
/* just indicate that signals should be handled asap */
break;
-#if 0
- case EXCP_DEBUG:
- {
- int sig;
-
- sig = gdb_handlesig(env, TARGET_SIGTRAP);
- if (sig)
- {
- info.si_signo = sig;
- info.si_errno = 0;
- info.si_code = TARGET_TRAP_BRKPT;
- queue_signal(env, info.si_signo, &info);
- }
- }
- break;
-#endif
default:
pc = env->segs[R_CS].base + env->eip;
fprintf(stderr, "qemu: 0x%08lx: unhandled CPU exception 0x%x -
aborting\n",
@@ -588,16 +480,6 @@ void cpu_loop(CPUSPARCState *env)
break;
case TT_TFAULT:
case TT_DFAULT:
-#if 0
- {
- info.si_signo = SIGSEGV;
- info.si_errno = 0;
- /* XXX: check env->error_code */
- info.si_code = TARGET_SEGV_MAPERR;
- info._sifields._sigfault._addr = env->mmuregs[4];
- queue_signal(env, info.si_signo, &info);
- }
-#endif
break;
#else
case TT_SPILL: /* window overflow */
@@ -608,19 +490,6 @@ void cpu_loop(CPUSPARCState *env)
break;
case TT_TFAULT:
case TT_DFAULT:
-#if 0
- {
- info.si_signo = SIGSEGV;
- info.si_errno = 0;
- /* XXX: check env->error_code */
- info.si_code = TARGET_SEGV_MAPERR;
- if (trapnr == TT_DFAULT)
- info._sifields._sigfault._addr = env->dmmuregs[4];
- else
- info._sifields._sigfault._addr = env->tsptr->tpc;
- /* queue_signal(env, info.si_signo, &info); */
- }
-#endif
break;
#endif
case EXCP_INTERRUPT:
@@ -628,19 +497,7 @@ void cpu_loop(CPUSPARCState *env)
break;
case EXCP_DEBUG:
{
-#if 0
- int sig =
-#endif
gdb_handlesig(cs, TARGET_SIGTRAP);
-#if 0
- if (sig)
- {
- info.si_signo = sig;
- info.si_errno = 0;
- info.si_code = TARGET_TRAP_BRKPT;
- /* queue_signal(env, info.si_signo, &info); */
- }
-#endif
}
break;
default:
--
2.22.1
- [PULL 00/20] bsd-user style tweaks and start cleanup, Warner Losh, 2021/05/12
- [PULL 01/20] bsd-user: whitespace changes, Warner Losh, 2021/05/12
- [PULL 03/20] bsd-user: style tweak: Remove #if 0'd code,
Warner Losh <=
- [PULL 02/20] bsd-user: style tweak: use C not C++ comments, Warner Losh, 2021/05/12
- [PULL 10/20] bsd-user: style tweak: use {} for all if statements, format else correctly, Warner Losh, 2021/05/12
- [PULL 06/20] bsd-user: style tweak: move extern to header file, Warner Losh, 2021/05/12
- [PULL 07/20] bsd-user: style tweak: remove spacing after '*' and add after }, Warner Losh, 2021/05/12
- [PULL 09/20] bsd-user: style tweak: don't assign in if statements, Warner Losh, 2021/05/12
- [PULL 13/20] bsd-user: whitespace changes, Warner Losh, 2021/05/12
- [PULL 04/20] bsd-user: style tweak: Use preferred block comments, Warner Losh, 2021/05/12
- [PULL 05/20] bsd-user: Remove commented out code, Warner Losh, 2021/05/12
- [PULL 08/20] bsd-user: style tweak: Use preferred block comments, Warner Losh, 2021/05/12
- [PULL 15/20] bsd-user: style tweak: keyword space (, Warner Losh, 2021/05/12