arch/i386/kernel/traps.c

From: Dave Richards (drichards@mahinetworks.com)
Date: Mon Jul 08 2002 - 18:01:08 EST


While diagnosing an MMX/FPU problem I found a minor problem in the code
which diagnoses and generates signals for FPU exceptions. On x86 Stack
Fault Exception are a subclass of Invalid Operation. Thus, the FPU status
register will have both the SF and IF bits set when a stack fault occurs.
The code which turns FPU exceptions into signals was assuming IF would be
clear:

*** linux/arch/i386/kernel/traps.c Sun Sep 30 19:26:08 2001
--- linux-2.4.18/arch/i386/kernel/traps.c Tue Jul 2 15:59:33 2002
***************
*** 578,587 ****
--- 578,595 ----
    switch (((~cwd) & swd & 0x3f) | (swd & 0x240)) {
        case 0x000:
        default:
            break;
        case 0x001: /* Invalid Op */
+ #ifdef CONFIG_MAHI_NMP
+ case 0x041: /* Stack Fault */
+ case 0x241: /* Stack Fault | Direction */
+ #else
        case 0x040: /* Stack Fault */
        case 0x240: /* Stack Fault | Direction */
+ #endif
            info.si_code = FPE_FLTINV;
            break;
        case 0x002: /* Denormalize */

Dave Richards
Mahi Networks, Inc.
1039 N. McDowell Blvd.
Petaluma, CA 94954
(707) 283-1139 (voice)
(707) 283-1299 (fax)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jul 15 2002 - 22:00:14 EST