.. | .. |
---|
7 | 7 | #include <asm/errno.h> |
---|
8 | 8 | #include <asm/asm-offsets.h> |
---|
9 | 9 | #include <asm/page.h> |
---|
| 10 | +#include <asm/fpu.h> |
---|
10 | 11 | |
---|
11 | 12 | #ifdef CONFIG_HWZOL |
---|
12 | 13 | .macro push_zol |
---|
.. | .. |
---|
15 | 16 | mfusr $r16, $LC |
---|
16 | 17 | .endm |
---|
17 | 18 | #endif |
---|
| 19 | + .macro skip_save_fucop_ctl |
---|
| 20 | +#if defined(CONFIG_FPU) |
---|
| 21 | +skip_fucop_ctl: |
---|
| 22 | + smw.adm $p0, [$sp], $p0, #0x1 |
---|
| 23 | + j fucop_ctl_done |
---|
| 24 | +#endif |
---|
| 25 | + .endm |
---|
18 | 26 | |
---|
19 | 27 | .macro save_user_regs |
---|
20 | | - |
---|
| 28 | +#if defined(CONFIG_FPU) |
---|
| 29 | + sethi $p0, hi20(has_fpu) |
---|
| 30 | + lbsi $p0, [$p0+lo12(has_fpu)] |
---|
| 31 | + beqz $p0, skip_fucop_ctl |
---|
| 32 | + mfsr $p0, $FUCOP_CTL |
---|
| 33 | + smw.adm $p0, [$sp], $p0, #0x1 |
---|
| 34 | + bclr $p0, $p0, #FUCOP_CTL_offCP0EN |
---|
| 35 | + mtsr $p0, $FUCOP_CTL |
---|
| 36 | +fucop_ctl_done: |
---|
| 37 | + /* move $SP to the bottom of pt_regs */ |
---|
| 38 | + addi $sp, $sp, -FUCOP_CTL_OFFSET |
---|
| 39 | +#else |
---|
21 | 40 | smw.adm $sp, [$sp], $sp, #0x1 |
---|
22 | 41 | /* move $SP to the bottom of pt_regs */ |
---|
23 | 42 | addi $sp, $sp, -OSP_OFFSET |
---|
| 43 | +#endif |
---|
24 | 44 | |
---|
25 | 45 | /* push $r0 ~ $r25 */ |
---|
26 | 46 | smw.bim $r0, [$sp], $r25 |
---|
.. | .. |
---|
79 | 99 | .long eh_syscall !Syscall |
---|
80 | 100 | .long asm_do_IRQ !IRQ |
---|
81 | 101 | |
---|
| 102 | + skip_save_fucop_ctl |
---|
82 | 103 | common_exception_handler: |
---|
83 | 104 | save_user_regs |
---|
84 | 105 | mfsr $p0, $ITYPE |
---|
.. | .. |
---|
103 | 124 | mtsr $r21, $PSW |
---|
104 | 125 | dsb |
---|
105 | 126 | jr $p1 |
---|
106 | | - |
---|
107 | 127 | /* syscall */ |
---|
108 | 128 | 1: |
---|
109 | 129 | addi $p1, $p0, #-NDS32_VECTOR_offEXCEPTION |
---|