Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /* |
2 | * linux/arch/arm/vfp/entry.S | |
3 | * | |
4 | * Copyright (C) 2004 ARM Limited. | |
5 | * Written by Deep Blue Solutions Limited. | |
6 | * | |
7 | * This program is free software; you can redistribute it and/or modify | |
8 | * it under the terms of the GNU General Public License version 2 as | |
9 | * published by the Free Software Foundation. | |
10 | * | |
11 | * Basic entry code, called from the kernel's undefined instruction trap. | |
12 | * r0 = faulted instruction | |
13 | * r5 = faulted PC+4 | |
14 | * r9 = successful return | |
15 | * r10 = thread_info structure | |
16 | * lr = failure return | |
17 | */ | |
f2255be8 | 18 | #include <asm/thread_info.h> |
1da177e4 | 19 | #include <asm/vfpmacros.h> |
f2255be8 | 20 | #include "../kernel/entry-header.S" |
1da177e4 | 21 | |
93ed3970 | 22 | ENTRY(do_vfp) |
f2255be8 GD |
23 | #ifdef CONFIG_PREEMPT |
24 | ldr r4, [r10, #TI_PREEMPT] @ get preempt count | |
25 | add r11, r4, #1 @ increment it | |
26 | str r11, [r10, #TI_PREEMPT] | |
27 | #endif | |
5d25ac03 | 28 | enable_irq |
1da177e4 | 29 | ldr r4, .LCvfp |
c6428464 | 30 | ldr r11, [r10, #TI_CPU] @ CPU number |
1da177e4 LT |
31 | add r10, r10, #TI_VFPSTATE @ r10 = workspace |
32 | ldr pc, [r4] @ call VFP entry point | |
93ed3970 | 33 | ENDPROC(do_vfp) |
1da177e4 | 34 | |
5d4cae5f | 35 | ENTRY(vfp_null_entry) |
f2255be8 GD |
36 | #ifdef CONFIG_PREEMPT |
37 | get_thread_info r10 | |
38 | ldr r4, [r10, #TI_PREEMPT] @ get preempt count | |
39 | sub r11, r4, #1 @ decrement it | |
40 | str r11, [r10, #TI_PREEMPT] | |
41 | #endif | |
5d4cae5f RK |
42 | mov pc, lr |
43 | ENDPROC(vfp_null_entry) | |
44 | ||
88987ef9 | 45 | .align 2 |
1da177e4 LT |
46 | .LCvfp: |
47 | .word vfp_vector | |
48 | ||
49 | @ This code is called if the VFP does not exist. It needs to flag the | |
50 | @ failure to the VFP initialisation code. | |
51 | ||
52 | __INIT | |
93ed3970 | 53 | ENTRY(vfp_testing_entry) |
f2255be8 GD |
54 | #ifdef CONFIG_PREEMPT |
55 | get_thread_info r10 | |
56 | ldr r4, [r10, #TI_PREEMPT] @ get preempt count | |
57 | sub r11, r4, #1 @ decrement it | |
58 | str r11, [r10, #TI_PREEMPT] | |
59 | #endif | |
1da177e4 LT |
60 | ldr r0, VFP_arch_address |
61 | str r5, [r0] @ known non-zero value | |
62 | mov pc, r9 @ we have handled the fault | |
93ed3970 | 63 | ENDPROC(vfp_testing_entry) |
1da177e4 | 64 | |
88987ef9 | 65 | .align 2 |
1da177e4 LT |
66 | VFP_arch_address: |
67 | .word VFP_arch | |
68 | ||
69 | __FINIT |