diff options
Diffstat (limited to 'arch/mips/kernel/traps.c')
-rw-r--r-- | arch/mips/kernel/traps.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 6bee29097a56..b602ac6eb47d 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
@@ -46,6 +46,9 @@ | |||
46 | #include <asm/types.h> | 46 | #include <asm/types.h> |
47 | #include <asm/stacktrace.h> | 47 | #include <asm/stacktrace.h> |
48 | 48 | ||
49 | extern void check_wait(void); | ||
50 | extern asmlinkage void r4k_wait(void); | ||
51 | extern asmlinkage void rollback_handle_int(void); | ||
49 | extern asmlinkage void handle_int(void); | 52 | extern asmlinkage void handle_int(void); |
50 | extern asmlinkage void handle_tlbm(void); | 53 | extern asmlinkage void handle_tlbm(void); |
51 | extern asmlinkage void handle_tlbl(void); | 54 | extern asmlinkage void handle_tlbl(void); |
@@ -822,8 +825,10 @@ static void mt_ase_fp_affinity(void) | |||
822 | if (cpus_intersects(current->cpus_allowed, mt_fpu_cpumask)) { | 825 | if (cpus_intersects(current->cpus_allowed, mt_fpu_cpumask)) { |
823 | cpumask_t tmask; | 826 | cpumask_t tmask; |
824 | 827 | ||
825 | cpus_and(tmask, current->thread.user_cpus_allowed, | 828 | current->thread.user_cpus_allowed |
826 | mt_fpu_cpumask); | 829 | = current->cpus_allowed; |
830 | cpus_and(tmask, current->cpus_allowed, | ||
831 | mt_fpu_cpumask); | ||
827 | set_cpus_allowed(current, tmask); | 832 | set_cpus_allowed(current, tmask); |
828 | set_thread_flag(TIF_FPUBOUND); | 833 | set_thread_flag(TIF_FPUBOUND); |
829 | } | 834 | } |
@@ -1251,6 +1256,9 @@ static void *set_vi_srs_handler(int n, vi_handler_t addr, int srs) | |||
1251 | 1256 | ||
1252 | extern char except_vec_vi, except_vec_vi_lui; | 1257 | extern char except_vec_vi, except_vec_vi_lui; |
1253 | extern char except_vec_vi_ori, except_vec_vi_end; | 1258 | extern char except_vec_vi_ori, except_vec_vi_end; |
1259 | extern char rollback_except_vec_vi; | ||
1260 | char *vec_start = (cpu_wait == r4k_wait) ? | ||
1261 | &rollback_except_vec_vi : &except_vec_vi; | ||
1254 | #ifdef CONFIG_MIPS_MT_SMTC | 1262 | #ifdef CONFIG_MIPS_MT_SMTC |
1255 | /* | 1263 | /* |
1256 | * We need to provide the SMTC vectored interrupt handler | 1264 | * We need to provide the SMTC vectored interrupt handler |
@@ -1258,11 +1266,11 @@ static void *set_vi_srs_handler(int n, vi_handler_t addr, int srs) | |||
1258 | * Status.IM bit to be masked before going there. | 1266 | * Status.IM bit to be masked before going there. |
1259 | */ | 1267 | */ |
1260 | extern char except_vec_vi_mori; | 1268 | extern char except_vec_vi_mori; |
1261 | const int mori_offset = &except_vec_vi_mori - &except_vec_vi; | 1269 | const int mori_offset = &except_vec_vi_mori - vec_start; |
1262 | #endif /* CONFIG_MIPS_MT_SMTC */ | 1270 | #endif /* CONFIG_MIPS_MT_SMTC */ |
1263 | const int handler_len = &except_vec_vi_end - &except_vec_vi; | 1271 | const int handler_len = &except_vec_vi_end - vec_start; |
1264 | const int lui_offset = &except_vec_vi_lui - &except_vec_vi; | 1272 | const int lui_offset = &except_vec_vi_lui - vec_start; |
1265 | const int ori_offset = &except_vec_vi_ori - &except_vec_vi; | 1273 | const int ori_offset = &except_vec_vi_ori - vec_start; |
1266 | 1274 | ||
1267 | if (handler_len > VECTORSPACING) { | 1275 | if (handler_len > VECTORSPACING) { |
1268 | /* | 1276 | /* |
@@ -1272,7 +1280,7 @@ static void *set_vi_srs_handler(int n, vi_handler_t addr, int srs) | |||
1272 | panic("VECTORSPACING too small"); | 1280 | panic("VECTORSPACING too small"); |
1273 | } | 1281 | } |
1274 | 1282 | ||
1275 | memcpy(b, &except_vec_vi, handler_len); | 1283 | memcpy(b, vec_start, handler_len); |
1276 | #ifdef CONFIG_MIPS_MT_SMTC | 1284 | #ifdef CONFIG_MIPS_MT_SMTC |
1277 | BUG_ON(n > 7); /* Vector index %d exceeds SMTC maximum. */ | 1285 | BUG_ON(n > 7); /* Vector index %d exceeds SMTC maximum. */ |
1278 | 1286 | ||
@@ -1554,6 +1562,10 @@ void __init trap_init(void) | |||
1554 | extern char except_vec3_generic, except_vec3_r4000; | 1562 | extern char except_vec3_generic, except_vec3_r4000; |
1555 | extern char except_vec4; | 1563 | extern char except_vec4; |
1556 | unsigned long i; | 1564 | unsigned long i; |
1565 | int rollback; | ||
1566 | |||
1567 | check_wait(); | ||
1568 | rollback = (cpu_wait == r4k_wait); | ||
1557 | 1569 | ||
1558 | #if defined(CONFIG_KGDB) | 1570 | #if defined(CONFIG_KGDB) |
1559 | if (kgdb_early_setup) | 1571 | if (kgdb_early_setup) |
@@ -1618,7 +1630,7 @@ void __init trap_init(void) | |||
1618 | if (board_be_init) | 1630 | if (board_be_init) |
1619 | board_be_init(); | 1631 | board_be_init(); |
1620 | 1632 | ||
1621 | set_except_vector(0, handle_int); | 1633 | set_except_vector(0, rollback ? rollback_handle_int : handle_int); |
1622 | set_except_vector(1, handle_tlbm); | 1634 | set_except_vector(1, handle_tlbm); |
1623 | set_except_vector(2, handle_tlbl); | 1635 | set_except_vector(2, handle_tlbl); |
1624 | set_except_vector(3, handle_tlbs); | 1636 | set_except_vector(3, handle_tlbs); |