[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 12/48] bsd-user: style tweak: Remove #if 0'd code
From: |
imp |
Subject: |
[PATCH v2 12/48] bsd-user: style tweak: Remove #if 0'd code |
Date: |
Sat, 24 Apr 2021 09:59:40 -0600 |
From: Warner Losh <imp@bsdimp.com>
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 ff886de98e..3c6c0ec687 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -244,118 +244,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",
@@ -589,16 +481,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 */
@@ -609,19 +491,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:
@@ -629,19 +498,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
- [PATCH v2 08/48] bsd-user: style tweak: use C not C++ comments, (continued)
- [PATCH v2 08/48] bsd-user: style tweak: use C not C++ comments, imp, 2021/04/24
- [PATCH v2 09/48] bsd-user: style tweak: use C not C++ comments, imp, 2021/04/24
- [PATCH v2 13/48] bsd-user: style tweak: Remove #if 0'd code, imp, 2021/04/24
- [PATCH v2 20/48] bsd-user: style tweak: use {} consistently in for / if / else statements, imp, 2021/04/24
- [PATCH v2 17/48] bsd-user: style tweak: Fix commentary issues, imp, 2021/04/24
- [PATCH v2 21/48] bsd-user: style nits: return is not a function, imp, 2021/04/24
- [PATCH v2 15/48] bsd-user: style tweak: return is not a function, eliminate (), imp, 2021/04/24
- [PATCH v2 12/48] bsd-user: style tweak: Remove #if 0'd code,
imp <=
- [PATCH v2 14/48] bsd-user: style tweak: Remove #if 0'd code, imp, 2021/04/24
- [PATCH v2 22/48] bsd-user: use qemu_strtoul in preference to strtol, imp, 2021/04/24
- [PATCH v2 10/48] bsd-user: Remove commented out code, imp, 2021/04/24
- [PATCH v2 24/48] bsd-user: create target_arch_cpu.h, imp, 2021/04/24
- [PATCH v2 32/48] bsd-user: style tweak: remove spacing after '*' and add after }, imp, 2021/04/24