diff options
author | Mike Frysinger <vapier@gentoo.org> | 2011-05-29 23:12:51 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2011-07-23 01:10:43 -0400 |
commit | fb1d9be5967fff0a3c93b06304fd992e3c438b7f (patch) | |
tree | 0c1c8a2fe6ad2b9c52bdc4a58e0f396058dc75c3 /arch/blackfin/kernel | |
parent | 072a5cff2fcaa4648c98bea6d549fac7ee4174fe (diff) |
Blackfin: optimize double fault boot checking
This moves the double fault data used at boot time into a single struct
which can then easily be addressed with indexed loads rather than having
to explicitly load multiple addresses.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin/kernel')
-rw-r--r-- | arch/blackfin/kernel/asm-offsets.c | 10 | ||||
-rw-r--r-- | arch/blackfin/kernel/setup.c | 16 |
2 files changed, 19 insertions, 7 deletions
diff --git a/arch/blackfin/kernel/asm-offsets.c b/arch/blackfin/kernel/asm-offsets.c index bd32c09b9349..17e35465a416 100644 --- a/arch/blackfin/kernel/asm-offsets.c +++ b/arch/blackfin/kernel/asm-offsets.c | |||
@@ -138,6 +138,16 @@ int main(void) | |||
138 | DEFINE(PDA_DF_SEQSTAT, offsetof(struct blackfin_pda, seqstat_doublefault)); | 138 | DEFINE(PDA_DF_SEQSTAT, offsetof(struct blackfin_pda, seqstat_doublefault)); |
139 | DEFINE(PDA_DF_RETX, offsetof(struct blackfin_pda, retx_doublefault)); | 139 | DEFINE(PDA_DF_RETX, offsetof(struct blackfin_pda, retx_doublefault)); |
140 | #endif | 140 | #endif |
141 | |||
142 | /* PDA initial management */ | ||
143 | DEFINE(PDA_INIT_RETX, offsetof(struct blackfin_initial_pda, retx)); | ||
144 | #ifdef CONFIG_DEBUG_DOUBLEFAULT | ||
145 | DEFINE(PDA_INIT_DF_DCPLB, offsetof(struct blackfin_initial_pda, dcplb_doublefault_addr)); | ||
146 | DEFINE(PDA_INIT_DF_ICPLB, offsetof(struct blackfin_initial_pda, icplb_doublefault_addr)); | ||
147 | DEFINE(PDA_INIT_DF_SEQSTAT, offsetof(struct blackfin_initial_pda, seqstat_doublefault)); | ||
148 | DEFINE(PDA_INIT_DF_RETX, offsetof(struct blackfin_initial_pda, retx_doublefault)); | ||
149 | #endif | ||
150 | |||
141 | #ifdef CONFIG_SMP | 151 | #ifdef CONFIG_SMP |
142 | /* Inter-core lock (in L2 SRAM) */ | 152 | /* Inter-core lock (in L2 SRAM) */ |
143 | DEFINE(SIZEOF_CORELOCK, sizeof(struct corelock_slot)); | 153 | DEFINE(SIZEOF_CORELOCK, sizeof(struct corelock_slot)); |
diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c index 536bd9d7e0cf..dfa2525a442d 100644 --- a/arch/blackfin/kernel/setup.c +++ b/arch/blackfin/kernel/setup.c | |||
@@ -54,8 +54,7 @@ EXPORT_SYMBOL(mtd_size); | |||
54 | #endif | 54 | #endif |
55 | 55 | ||
56 | char __initdata command_line[COMMAND_LINE_SIZE]; | 56 | char __initdata command_line[COMMAND_LINE_SIZE]; |
57 | void __initdata *init_retx, *init_saved_retx, *init_saved_seqstat, | 57 | struct blackfin_initial_pda __initdata initial_pda; |
58 | *init_saved_icplb_fault_addr, *init_saved_dcplb_fault_addr; | ||
59 | 58 | ||
60 | /* boot memmap, for parsing "memmap=" */ | 59 | /* boot memmap, for parsing "memmap=" */ |
61 | #define BFIN_MEMMAP_MAX 128 /* number of entries in bfin_memmap */ | 60 | #define BFIN_MEMMAP_MAX 128 /* number of entries in bfin_memmap */ |
@@ -957,13 +956,16 @@ void __init setup_arch(char **cmdline_p) | |||
957 | printk(KERN_EMERG "Recovering from DOUBLE FAULT event\n"); | 956 | printk(KERN_EMERG "Recovering from DOUBLE FAULT event\n"); |
958 | #ifdef CONFIG_DEBUG_DOUBLEFAULT | 957 | #ifdef CONFIG_DEBUG_DOUBLEFAULT |
959 | /* We assume the crashing kernel, and the current symbol table match */ | 958 | /* We assume the crashing kernel, and the current symbol table match */ |
960 | printk(KERN_EMERG " While handling exception (EXCAUSE = 0x%x) at %pF\n", | 959 | printk(KERN_EMERG " While handling exception (EXCAUSE = %#x) at %pF\n", |
961 | (int)init_saved_seqstat & SEQSTAT_EXCAUSE, init_saved_retx); | 960 | initial_pda.seqstat_doublefault & SEQSTAT_EXCAUSE, |
962 | printk(KERN_NOTICE " DCPLB_FAULT_ADDR: %pF\n", init_saved_dcplb_fault_addr); | 961 | initial_pda.retx_doublefault); |
963 | printk(KERN_NOTICE " ICPLB_FAULT_ADDR: %pF\n", init_saved_icplb_fault_addr); | 962 | printk(KERN_NOTICE " DCPLB_FAULT_ADDR: %pF\n", |
963 | initial_pda.dcplb_doublefault_addr); | ||
964 | printk(KERN_NOTICE " ICPLB_FAULT_ADDR: %pF\n", | ||
965 | initial_pda.icplb_doublefault_addr); | ||
964 | #endif | 966 | #endif |
965 | printk(KERN_NOTICE " The instruction at %pF caused a double exception\n", | 967 | printk(KERN_NOTICE " The instruction at %pF caused a double exception\n", |
966 | init_retx); | 968 | initial_pda.retx); |
967 | } else if (_bfin_swrst & RESET_WDOG) | 969 | } else if (_bfin_swrst & RESET_WDOG) |
968 | printk(KERN_INFO "Recovering from Watchdog event\n"); | 970 | printk(KERN_INFO "Recovering from Watchdog event\n"); |
969 | else if (_bfin_swrst & RESET_SOFTWARE) | 971 | else if (_bfin_swrst & RESET_SOFTWARE) |