lkml.org 
[lkml]   [2003]   [Feb]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH] PC-9800 subarch. support for 2.5.62-AC1 (21/21) traps
    This is additional patch to support NEC PC-9800 subarchitecture
    against 2.5.62-ac1. (21/21)

    Support difference of NMI handling, using mach-* scheme.

    Regards,
    Osamu Tomita

    diff -Nru linux-2.5.62-ac1/arch/i386/kernel/traps.c linux98-2.5.62-ac1/arch/i386/kernel/traps.c
    --- linux-2.5.62-ac1/arch/i386/kernel/traps.c 2003-02-21 10:00:45.000000000 +0900
    +++ linux98-2.5.62-ac1/arch/i386/kernel/traps.c 2003-02-21 11:18:20.000000000 +0900
    @@ -51,6 +51,8 @@
    #include <linux/irq.h>
    #include <linux/module.h>

    +#include "mach_traps.h"
    +
    asmlinkage int system_call(void);
    asmlinkage void lcall7(void);
    asmlinkage void lcall27(void);
    @@ -388,8 +390,7 @@
    printk("You probably have a hardware problem with your RAM chips\n");

    /* Clear and disable the memory parity error line. */
    - reason = (reason & 0xf) | 4;
    - outb(reason, 0x61);
    + clear_mem_error(reason);
    }

    static void io_check_error(unsigned char reason, struct pt_regs * regs)
    @@ -426,7 +427,7 @@

    static void default_do_nmi(struct pt_regs * regs)
    {
    - unsigned char reason = inb(0x61);
    + unsigned char reason = get_nmi_reason();

    if (!(reason & 0xc0)) {
    #if CONFIG_X86_LOCAL_APIC
    @@ -450,10 +451,7 @@
    * Reassert NMI in case it became active meanwhile
    * as it's edge-triggered.
    */
    - outb(0x8f, 0x70);
    - inb(0x71); /* dummy */
    - outb(0x0f, 0x70);
    - inb(0x71); /* dummy */
    + reassert_nmi();
    }

    static int dummy_nmi_callback(struct pt_regs * regs, int cpu)
    diff -Nru linux/include/asm-i386/mach-default/mach_traps.h linux98/include/asm-i386/mach-default/mach_traps.h
    --- linux/include/asm-i386/mach-default/mach_traps.h 1970-01-01 09:00:00.000000000 +0900
    +++ linux98/include/asm-i386/mach-default/mach_traps.h 2002-11-05 22:42:05.000000000 +0900
    @@ -0,0 +1,29 @@
    +/*
    + * include/asm-i386/mach-default/mach_traps.h
    + *
    + * Machine specific NMI handling for generic.
    + * Split out from traps.c by Osamu Tomita <tomita@cinet.co.jp>
    + */
    +#ifndef _MACH_TRAPS_H
    +#define _MACH_TRAPS_H
    +
    +static inline void clear_mem_error(unsigned char reason)
    +{
    + reason = (reason & 0xf) | 4;
    + outb(reason, 0x61);
    +}
    +
    +static inline unsigned char get_nmi_reason(void)
    +{
    + return inb(0x61);
    +}
    +
    +static inline void reassert_nmi(void)
    +{
    + outb(0x8f, 0x70);
    + inb(0x71); /* dummy */
    + outb(0x0f, 0x70);
    + inb(0x71); /* dummy */
    +}
    +
    +#endif /* !_MACH_TRAPS_H */
    diff -Nru linux/include/asm-i386/mach-pc9800/mach_traps.h linux98/include/asm-i386/mach-pc9800/mach_traps.h
    --- linux/include/asm-i386/mach-pc9800/mach_traps.h 1970-01-01 09:00:00.000000000 +0900
    +++ linux98/include/asm-i386/mach-pc9800/mach_traps.h 2002-11-05 22:46:55.000000000 +0900
    @@ -0,0 +1,27 @@
    +/*
    + * include/asm-i386/mach-pc9800/mach_traps.h
    + *
    + * Machine specific NMI handling for PC-9800.
    + * Written by Osamu Tomita <tomita@cinet.co.jp>
    + */
    +#ifndef _MACH_TRAPS_H
    +#define _MACH_TRAPS_H
    +
    +static inline void clear_mem_error(unsigned char reason)
    +{
    + outb(0x08, 0x37);
    + outb(0x09, 0x37);
    +}
    +
    +static inline unsigned char get_nmi_reason(void)
    +{
    + return (inb(0x33) & 6) ? 0x80 : 0;
    +}
    +
    +static inline void reassert_nmi(void)
    +{
    + outb(0x09, 0x50); /* disable NMI once */
    + outb(0x09, 0x52); /* re-enable it */
    +}
    +
    +#endif /* !_MACH_TRAPS_H */
    -
    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/
    \
     
     \ /
      Last update: 2005-03-22 13:33    [W:4.386 / U:0.504 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site