traps.c (f54db641b9bbca91b071128e4d71f0f6af9a3c25) traps.c (bc2a9408fa65195288b41751016c36fd00a75a85)
1/*
2 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
3 * Copyright 2007-2010 Freescale Semiconductor, Inc.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.

--- 1015 unchanged lines hidden (view full) ---

1024 if (!(regs->msr & MSR_PR) && /* not user-mode */
1025 report_bug(regs->nip, regs) == BUG_TRAP_TYPE_WARN) {
1026 regs->nip += 4;
1027 return;
1028 }
1029 _exception(SIGTRAP, regs, TRAP_BRKPT, regs->nip);
1030 return;
1031 }
1/*
2 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
3 * Copyright 2007-2010 Freescale Semiconductor, Inc.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.

--- 1015 unchanged lines hidden (view full) ---

1024 if (!(regs->msr & MSR_PR) && /* not user-mode */
1025 report_bug(regs->nip, regs) == BUG_TRAP_TYPE_WARN) {
1026 regs->nip += 4;
1027 return;
1028 }
1029 _exception(SIGTRAP, regs, TRAP_BRKPT, regs->nip);
1030 return;
1031 }
1032#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
1033 if (reason & REASON_TM) {
1034 /* This is a TM "Bad Thing Exception" program check.
1035 * This occurs when:
1036 * - An rfid/hrfid/mtmsrd attempts to cause an illegal
1037 * transition in TM states.
1038 * - A trechkpt is attempted when transactional.
1039 * - A treclaim is attempted when non transactional.
1040 * - A tend is illegally attempted.
1041 * - writing a TM SPR when transactional.
1042 */
1043 if (!user_mode(regs) &&
1044 report_bug(regs->nip, regs) == BUG_TRAP_TYPE_WARN) {
1045 regs->nip += 4;
1046 return;
1047 }
1048 /* If usermode caused this, it's done something illegal and
1049 * gets a SIGILL slap on the wrist. We call it an illegal
1050 * operand to distinguish from the instruction just being bad
1051 * (e.g. executing a 'tend' on a CPU without TM!); it's an
1052 * illegal /placement/ of a valid instruction.
1053 */
1054 if (user_mode(regs)) {
1055 _exception(SIGILL, regs, ILL_ILLOPN, regs->nip);
1056 return;
1057 } else {
1058 printk(KERN_EMERG "Unexpected TM Bad Thing exception "
1059 "at %lx (msr 0x%x)\n", regs->nip, reason);
1060 die("Unrecoverable exception", regs, SIGABRT);
1061 }
1062 }
1063#endif
1032
1033 /* We restore the interrupt state now */
1034 if (!arch_irq_disabled_regs(regs))
1035 local_irq_enable();
1036
1037#ifdef CONFIG_MATH_EMULATION
1038 /* (reason & REASON_ILLEGAL) would be the obvious thing here,
1039 * but there seems to be a hardware bug on the 405GP (RevD)

--- 702 unchanged lines hidden ---
1064
1065 /* We restore the interrupt state now */
1066 if (!arch_irq_disabled_regs(regs))
1067 local_irq_enable();
1068
1069#ifdef CONFIG_MATH_EMULATION
1070 /* (reason & REASON_ILLEGAL) would be the obvious thing here,
1071 * but there seems to be a hardware bug on the 405GP (RevD)

--- 702 unchanged lines hidden ---