patch-2.3.99-pre6 linux/arch/ia64/ia32/ia32_traps.c

Next file: linux/arch/ia64/ia32/sys_ia32.c
Previous file: linux/arch/ia64/ia32/ia32_signal.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.99-pre5/linux/arch/ia64/ia32/ia32_traps.c linux/arch/ia64/ia32/ia32_traps.c
@@ -0,0 +1,47 @@
+#include <linux/kernel.h>
+#include <linux/sched.h>
+
+#include <asm/ia32.h>
+#include <asm/ptrace.h>
+
+int
+ia32_exception (struct pt_regs *regs, unsigned long isr)
+{
+	struct siginfo siginfo;
+
+	switch ((isr >> 16) & 0xff) {
+	      case 1:
+	      case 2:
+		if (isr == 0)
+			siginfo.si_code = TRAP_TRACE;
+		else if (isr & 0x4)
+			siginfo.si_code = TRAP_BRANCH;
+		else
+			siginfo.si_code = TRAP_BRKPT;
+		break;
+
+	      case 3:
+		siginfo.si_code = TRAP_BRKPT;
+		break;
+
+	      case 0:	/* Divide fault */
+	      case 4:	/* Overflow */
+	      case 5:	/* Bounds fault */
+	      case 6:	/* Invalid Op-code */
+	      case 7:	/* FP DNA */
+	      case 8:	/* Double Fault */
+	      case 9:	/* Invalid TSS */
+	      case 11:	/* Segment not present */
+	      case 12:	/* Stack fault */
+	      case 13:	/* General Protection Fault */
+	      case 16:	/* Pending FP error */
+	      case 17:	/* Alignment check */
+	      case 19:	/* SSE Numeric error */
+	      default:
+		return -1;
+	}
+	siginfo.si_signo = SIGTRAP;
+	siginfo.si_errno = 0;
+	send_sig_info(SIGTRAP, &siginfo, current);
+	return 0;
+}

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)