diff options
| author | Leonid Yegoshin <Leonid.Yegoshin@imgtec.com> | 2014-11-24 06:54:19 -0500 |
|---|---|---|
| committer | Markos Chandras <markos.chandras@imgtec.com> | 2015-02-17 10:37:27 -0500 |
| commit | 207083b1da59242cbbcd1752eea359ed4760914b (patch) | |
| tree | c9eade37fa995edf46b4580a593d0d4e79acb508 /arch/mips/kernel | |
| parent | 9c7d5768681193b3bb9f00409d689141d20d5bff (diff) | |
MIPS: kernel: r4k_switch: Add support for MIPS R6
Add the MIPS R6 related preprocessor definitions for save/restore
FPU related functions. We also set the appropriate ISA level
so the final return instruction "jr ra" will produce the correct
opcode on R6.
Signed-off-by: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Diffstat (limited to 'arch/mips/kernel')
| -rw-r--r-- | arch/mips/kernel/r4k_switch.S | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/arch/mips/kernel/r4k_switch.S b/arch/mips/kernel/r4k_switch.S index 64591e671878..3b1a36f13a7d 100644 --- a/arch/mips/kernel/r4k_switch.S +++ b/arch/mips/kernel/r4k_switch.S | |||
| @@ -115,7 +115,8 @@ | |||
| 115 | * Save a thread's fp context. | 115 | * Save a thread's fp context. |
| 116 | */ | 116 | */ |
| 117 | LEAF(_save_fp) | 117 | LEAF(_save_fp) |
| 118 | #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2) | 118 | #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2) || \ |
| 119 | defined(CONFIG_CPU_MIPS32_R6) | ||
| 119 | mfc0 t0, CP0_STATUS | 120 | mfc0 t0, CP0_STATUS |
| 120 | #endif | 121 | #endif |
| 121 | fpu_save_double a0 t0 t1 # clobbers t1 | 122 | fpu_save_double a0 t0 t1 # clobbers t1 |
| @@ -126,7 +127,8 @@ LEAF(_save_fp) | |||
| 126 | * Restore a thread's fp context. | 127 | * Restore a thread's fp context. |
| 127 | */ | 128 | */ |
| 128 | LEAF(_restore_fp) | 129 | LEAF(_restore_fp) |
| 129 | #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2) | 130 | #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2) || \ |
| 131 | defined(CONFIG_CPU_MIPS32_R6) | ||
| 130 | mfc0 t0, CP0_STATUS | 132 | mfc0 t0, CP0_STATUS |
| 131 | #endif | 133 | #endif |
| 132 | fpu_restore_double a0 t0 t1 # clobbers t1 | 134 | fpu_restore_double a0 t0 t1 # clobbers t1 |
| @@ -240,9 +242,9 @@ LEAF(_init_fpu) | |||
| 240 | mtc1 t1, $f30 | 242 | mtc1 t1, $f30 |
| 241 | mtc1 t1, $f31 | 243 | mtc1 t1, $f31 |
| 242 | 244 | ||
| 243 | #ifdef CONFIG_CPU_MIPS32_R2 | 245 | #if defined(CONFIG_CPU_MIPS32_R2) || defined(CONFIG_CPU_MIPS32_R6) |
| 244 | .set push | 246 | .set push |
| 245 | .set mips32r2 | 247 | .set MIPS_ISA_LEVEL_RAW |
| 246 | .set fp=64 | 248 | .set fp=64 |
| 247 | sll t0, t0, 5 # is Status.FR set? | 249 | sll t0, t0, 5 # is Status.FR set? |
| 248 | bgez t0, 1f # no: skip setting upper 32b | 250 | bgez t0, 1f # no: skip setting upper 32b |
| @@ -280,9 +282,9 @@ LEAF(_init_fpu) | |||
| 280 | mthc1 t1, $f30 | 282 | mthc1 t1, $f30 |
| 281 | mthc1 t1, $f31 | 283 | mthc1 t1, $f31 |
| 282 | 1: .set pop | 284 | 1: .set pop |
| 283 | #endif /* CONFIG_CPU_MIPS32_R2 */ | 285 | #endif /* CONFIG_CPU_MIPS32_R2 || CONFIG_CPU_MIPS32_R6 */ |
| 284 | #else | 286 | #else |
| 285 | .set arch=r4000 | 287 | .set MIPS_ISA_ARCH_LEVEL_RAW |
| 286 | dmtc1 t1, $f0 | 288 | dmtc1 t1, $f0 |
| 287 | dmtc1 t1, $f2 | 289 | dmtc1 t1, $f2 |
| 288 | dmtc1 t1, $f4 | 290 | dmtc1 t1, $f4 |
