]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
ARM: 6269/1: Add 'code' parameter for hook_fault_code()
authorKirill A. Shutemov <kirill@shutemov.name>
Thu, 22 Jul 2010 12:18:19 +0000 (13:18 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 27 Jul 2010 09:48:34 +0000 (10:48 +0100)
Add one more parameter to hook_fault_code() to be able to set 'code'
field of struct fsr_info.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/include/asm/system.h
arch/arm/mach-integrator/pci_v3.c
arch/arm/mach-iop13xx/pci.c
arch/arm/mach-ixp2000/pci.c
arch/arm/mach-ixp23xx/pci.c
arch/arm/mach-ixp4xx/common-pci.c
arch/arm/mach-ks8695/pci.c
arch/arm/mm/alignment.c
arch/arm/mm/fault.c
arch/arm/plat-iop/pci.c

index 5f4f48002734c2aa173ed8b8c0cd2294b64a8250..8ba1ccf82a0200283367db344ed79259f8d57c05 100644 (file)
@@ -83,7 +83,7 @@ void arm_notify_die(const char *str, struct pt_regs *regs, struct siginfo *info,
 
 void hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int,
                                       struct pt_regs *),
-                    int sig, const char *name);
+                    int sig, int code, const char *name);
 
 #define xchg(ptr,x) \
        ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
index 9cef0590d5aa3d4af92e62d41601b7057f94e0b3..6467d99fa2ee4a0c674d9071dad669cb5caa7b32 100644 (file)
@@ -505,10 +505,10 @@ void __init pci_v3_preinit(void)
        /*
         * Hook in our fault handler for PCI errors
         */
-       hook_fault_code(4, v3_pci_fault, SIGBUS, "external abort on linefetch");
-       hook_fault_code(6, v3_pci_fault, SIGBUS, "external abort on linefetch");
-       hook_fault_code(8, v3_pci_fault, SIGBUS, "external abort on non-linefetch");
-       hook_fault_code(10, v3_pci_fault, SIGBUS, "external abort on non-linefetch");
+       hook_fault_code(4, v3_pci_fault, SIGBUS, 0, "external abort on linefetch");
+       hook_fault_code(6, v3_pci_fault, SIGBUS, 0, "external abort on linefetch");
+       hook_fault_code(8, v3_pci_fault, SIGBUS, 0, "external abort on non-linefetch");
+       hook_fault_code(10, v3_pci_fault, SIGBUS, 0, "external abort on non-linefetch");
 
        spin_lock_irqsave(&v3_lock, flags);
 
index 6d5a90813d31b6b96532b3b1a5cdb555e972ec41..773ea0c95b9f6fc91d8c9c57f3a3bd0f714b306d 100644 (file)
@@ -987,7 +987,7 @@ void __init iop13xx_pci_init(void)
                iop13xx_atux_setup();
        }
 
-       hook_fault_code(16+6, iop13xx_pci_abort, SIGBUS,
+       hook_fault_code(16+6, iop13xx_pci_abort, SIGBUS, 0,
                        "imprecise external abort");
 }
 
index 90771cad06f86f7fe3238021ce8ae39ce90cadc2..f797c5f538b094e2d600c78b85d70d70ff25d295 100644 (file)
@@ -209,7 +209,7 @@ ixp2000_pci_preinit(void)
                        "the needed workaround has not been configured in");
 #endif
 
-       hook_fault_code(16+6, ixp2000_pci_abort_handler, SIGBUS,
+       hook_fault_code(16+6, ixp2000_pci_abort_handler, SIGBUS, 0,
                                "PCI config cycle to non-existent device");
 }
 
index 4b0e598a91c91f4573d927a8016d91aab0154f7d..563819a83292db81f72b147986b98b573868149f 100644 (file)
@@ -229,7 +229,7 @@ void __init ixp23xx_pci_preinit(void)
 {
        ixp23xx_pci_common_init();
 
-       hook_fault_code(16+6, ixp23xx_pci_abort_handler, SIGBUS,
+       hook_fault_code(16+6, ixp23xx_pci_abort_handler, SIGBUS, 0,
                        "PCI config cycle to non-existent device");
 
        *IXP23XX_PCI_ADDR_EXT = 0x0000e000;
index e3181534c7f9dba7fe1cc8f6e4185aae21c8c87b..f4fbb5ec645b0a04c27318319969441ef897c10c 100644 (file)
@@ -382,7 +382,8 @@ void __init ixp4xx_pci_preinit(void)
 
 
        /* hook in our fault handler for PCI errors */
-       hook_fault_code(16+6, abort_handler, SIGBUS, "imprecise external abort");
+       hook_fault_code(16+6, abort_handler, SIGBUS, 0,
+                       "imprecise external abort");
 
        pr_debug("setup PCI-AHB(inbound) and AHB-PCI(outbound) address mappings\n");
 
index 78499667eb7b3241c3a5c1dfbbc69df4840a3991..5fcd082a17f9bff9b0d8a0818b199ebffd5833d2 100644 (file)
@@ -268,8 +268,8 @@ static void __init ks8695_pci_preinit(void)
        __raw_writel(0, KS8695_PCI_VA + KS8695_PIOBAC);
 
        /* hook in fault handlers */
-       hook_fault_code(8, ks8695_pci_fault, SIGBUS, "external abort on non-linefetch");
-       hook_fault_code(10, ks8695_pci_fault, SIGBUS, "external abort on non-linefetch");
+       hook_fault_code(8, ks8695_pci_fault, SIGBUS, 0, "external abort on non-linefetch");
+       hook_fault_code(10, ks8695_pci_fault, SIGBUS, 0, "external abort on non-linefetch");
 }
 
 static void ks8695_show_pciregs(void)
index 53a609680c1047dda20b33a4962df662f3d8f4c4..77cfdbed9501f7e6888a8e836e45a8898645c811 100644 (file)
@@ -924,8 +924,10 @@ static int __init alignment_init(void)
                ai_usermode = UM_FIXUP;
        }
 
-       hook_fault_code(1, do_alignment, SIGBUS, "alignment exception");
-       hook_fault_code(3, do_alignment, SIGBUS, "alignment exception");
+       hook_fault_code(1, do_alignment, SIGBUS, BUS_ADRALN,
+                       "alignment exception");
+       hook_fault_code(3, do_alignment, SIGBUS, BUS_ADRALN,
+                       "alignment exception");
 
        return 0;
 }
index ce6f3a422c81e3c752389cedecfa15e13fd25f9a..84131c832430b129b4db1d9999e86dba926f8a9c 100644 (file)
@@ -508,13 +508,15 @@ static struct fsr_info {
 
 void __init
 hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int, struct pt_regs *),
-               int sig, const char *name)
+               int sig, int code, const char *name)
 {
-       if (nr >= 0 && nr < ARRAY_SIZE(fsr_info)) {
-               fsr_info[nr].fn   = fn;
-               fsr_info[nr].sig  = sig;
-               fsr_info[nr].name = name;
-       }
+       if (nr < 0 || nr >= ARRAY_SIZE(fsr_info))
+               BUG();
+
+       fsr_info[nr].fn   = fn;
+       fsr_info[nr].sig  = sig;
+       fsr_info[nr].code = code;
+       fsr_info[nr].name = name;
 }
 
 /*
index ce31f316ac75c1e72af3693a58633a10e50e7f7a..43f2b158237c71c99cc51f0e3d99066a05ee65cb 100644 (file)
@@ -359,7 +359,7 @@ static void __init iop3xx_atu_debug(void)
        DBG("ATU: IOP3XX_ATUCMD=0x%04x\n", *IOP3XX_ATUCMD);
        DBG("ATU: IOP3XX_ATUCR=0x%08x\n", *IOP3XX_ATUCR);
 
-       hook_fault_code(16+6, iop3xx_pci_abort, SIGBUS, "imprecise external abort");
+       hook_fault_code(16+6, iop3xx_pci_abort, SIGBUS, 0, "imprecise external abort");
 }
 
 /* for platforms that might be host-bus-adapters */