diff options
author | Robin Getz <robin.getz@analog.com> | 2007-11-12 09:21:30 -0500 |
---|---|---|
committer | Bryan Wu <bryan.wu@analog.com> | 2007-11-12 09:21:30 -0500 |
commit | f26fbc48f130962fce15f37d079968f0f272e0c2 (patch) | |
tree | f92bda683343140b2ccf51b40c5dad71154b1595 /arch/blackfin/mach-common/entry.S | |
parent | 2ffbb8377c7a0713baf6644e285adc27a5654582 (diff) |
Blackfin arch: ensure we work around ANOMALY_05000261 for null pointers
We currently do not. Also make it easier to handle cplb violations - in traps.c
Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Diffstat (limited to 'arch/blackfin/mach-common/entry.S')
-rw-r--r-- | arch/blackfin/mach-common/entry.S | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/arch/blackfin/mach-common/entry.S b/arch/blackfin/mach-common/entry.S index 1b13fa470977..54712f9a60ac 100644 --- a/arch/blackfin/mach-common/entry.S +++ b/arch/blackfin/mach-common/entry.S | |||
@@ -71,13 +71,18 @@ ENDPROC(_safe_speculative_execution) | |||
71 | * This one does not lower the level to IRQ5, and thus can be used to | 71 | * This one does not lower the level to IRQ5, and thus can be used to |
72 | * patch up CPLB misses on the kernel stack. | 72 | * patch up CPLB misses on the kernel stack. |
73 | */ | 73 | */ |
74 | ENTRY(_ex_dcplb) | ||
75 | #if ANOMALY_05000261 | 74 | #if ANOMALY_05000261 |
75 | #define _ex_dviol _ex_workaround_261 | ||
76 | #define _ex_dmiss _ex_workaround_261 | ||
77 | #define _ex_dmult _ex_workaround_261 | ||
78 | |||
79 | ENTRY(_ex_workaround_261) | ||
76 | /* | 80 | /* |
77 | * Work around an anomaly: if we see a new DCPLB fault, return | 81 | * Work around an anomaly: if we see a new DCPLB fault, return |
78 | * without doing anything. Then, if we get the same fault again, | 82 | * without doing anything. Then, if we get the same fault again, |
79 | * handle it. | 83 | * handle it. |
80 | */ | 84 | */ |
85 | P4 = R7; /* Store EXCAUSE */ | ||
81 | p5.l = _last_cplb_fault_retx; | 86 | p5.l = _last_cplb_fault_retx; |
82 | p5.h = _last_cplb_fault_retx; | 87 | p5.h = _last_cplb_fault_retx; |
83 | r7 = [p5]; | 88 | r7 = [p5]; |
@@ -86,10 +91,24 @@ ENTRY(_ex_dcplb) | |||
86 | cc = r6 == r7; | 91 | cc = r6 == r7; |
87 | if !cc jump _return_from_exception; | 92 | if !cc jump _return_from_exception; |
88 | /* fall through */ | 93 | /* fall through */ |
94 | R7 = P4; | ||
95 | R6 = 0x26; /* Data CPLB Miss */ | ||
96 | cc = R6 == R7; | ||
97 | if cc jump _ex_dcplb_miss (BP); | ||
98 | /* Handle 0x23 Data CPLB Protection Violation | ||
99 | * and Data CPLB Multiple Hits - Linux Trap Zero | ||
100 | */ | ||
101 | jump _ex_trap_c; | ||
102 | ENDPROC(_ex_workaround_261) | ||
103 | |||
104 | #else | ||
105 | #define _ex_dviol _ex_trap_c | ||
106 | #define _ex_dmiss _ex_dcplb_miss | ||
107 | #define _ex_dmult _ex_trap_c | ||
89 | #endif | 108 | #endif |
90 | ENDPROC(_ex_dcplb) | ||
91 | 109 | ||
92 | ENTRY(_ex_icplb) | 110 | ENTRY(_ex_dcplb_miss) |
111 | ENTRY(_ex_icplb_miss) | ||
93 | (R7:6,P5:4) = [sp++]; | 112 | (R7:6,P5:4) = [sp++]; |
94 | ASTAT = [sp++]; | 113 | ASTAT = [sp++]; |
95 | SAVE_ALL_SYS | 114 | SAVE_ALL_SYS |
@@ -98,7 +117,7 @@ ENTRY(_ex_icplb) | |||
98 | RESTORE_ALL_SYS | 117 | RESTORE_ALL_SYS |
99 | SP = EX_SCRATCH_REG; | 118 | SP = EX_SCRATCH_REG; |
100 | rtx; | 119 | rtx; |
101 | ENDPROC(_ex_icplb) | 120 | ENDPROC(_ex_icplb_miss) |
102 | 121 | ||
103 | ENTRY(_ex_syscall) | 122 | ENTRY(_ex_syscall) |
104 | DEBUG_START_HWTRACE(p5, r7) | 123 | DEBUG_START_HWTRACE(p5, r7) |
@@ -908,6 +927,7 @@ ENDPROC(_early_trap) | |||
908 | #else | 927 | #else |
909 | .data | 928 | .data |
910 | #endif | 929 | #endif |
930 | |||
911 | ENTRY(_ex_table) | 931 | ENTRY(_ex_table) |
912 | /* entry for each EXCAUSE[5:0] | 932 | /* entry for each EXCAUSE[5:0] |
913 | * This table must be in sync with the table in ./kernel/traps.c | 933 | * This table must be in sync with the table in ./kernel/traps.c |
@@ -952,16 +972,16 @@ ENTRY(_ex_table) | |||
952 | .long _ex_trap_c /* 0x20 - Reserved */ | 972 | .long _ex_trap_c /* 0x20 - Reserved */ |
953 | .long _ex_trap_c /* 0x21 - Undefined Instruction */ | 973 | .long _ex_trap_c /* 0x21 - Undefined Instruction */ |
954 | .long _ex_trap_c /* 0x22 - Illegal Instruction Combination */ | 974 | .long _ex_trap_c /* 0x22 - Illegal Instruction Combination */ |
955 | .long _ex_dcplb /* 0x23 - Data CPLB Protection Violation */ | 975 | .long _ex_dviol /* 0x23 - Data CPLB Protection Violation */ |
956 | .long _ex_trap_c /* 0x24 - Data access misaligned */ | 976 | .long _ex_trap_c /* 0x24 - Data access misaligned */ |
957 | .long _ex_trap_c /* 0x25 - Unrecoverable Event */ | 977 | .long _ex_trap_c /* 0x25 - Unrecoverable Event */ |
958 | .long _ex_dcplb /* 0x26 - Data CPLB Miss */ | 978 | .long _ex_dmiss /* 0x26 - Data CPLB Miss */ |
959 | .long _ex_trap_c /* 0x27 - Data CPLB Multiple Hits - Linux Trap Zero */ | 979 | .long _ex_dmult /* 0x27 - Data CPLB Multiple Hits - Linux Trap Zero */ |
960 | .long _ex_trap_c /* 0x28 - Emulation Watchpoint */ | 980 | .long _ex_trap_c /* 0x28 - Emulation Watchpoint */ |
961 | .long _ex_trap_c /* 0x29 - Instruction fetch access error (535 only) */ | 981 | .long _ex_trap_c /* 0x29 - Instruction fetch access error (535 only) */ |
962 | .long _ex_trap_c /* 0x2A - Instruction fetch misaligned */ | 982 | .long _ex_trap_c /* 0x2A - Instruction fetch misaligned */ |
963 | .long _ex_icplb /* 0x2B - Instruction CPLB protection Violation */ | 983 | .long _ex_trap_c /* 0x2B - Instruction CPLB protection Violation */ |
964 | .long _ex_icplb /* 0x2C - Instruction CPLB miss */ | 984 | .long _ex_icplb_miss /* 0x2C - Instruction CPLB miss */ |
965 | .long _ex_trap_c /* 0x2D - Instruction CPLB Multiple Hits */ | 985 | .long _ex_trap_c /* 0x2D - Instruction CPLB Multiple Hits */ |
966 | .long _ex_trap_c /* 0x2E - Illegal use of Supervisor Resource */ | 986 | .long _ex_trap_c /* 0x2E - Illegal use of Supervisor Resource */ |
967 | .long _ex_trap_c /* 0x2E - Illegal use of Supervisor Resource */ | 987 | .long _ex_trap_c /* 0x2E - Illegal use of Supervisor Resource */ |