Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 | */ |
George G. Davis | f2255be | 2009-04-01 20:27:18 +0100 | [diff] [blame] | 18 | #include <asm/thread_info.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | #include <asm/vfpmacros.h> |
George G. Davis | f2255be | 2009-04-01 20:27:18 +0100 | [diff] [blame] | 20 | #include "../kernel/entry-header.S" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | |
Catalin Marinas | 93ed397 | 2008-08-28 11:22:32 +0100 | [diff] [blame] | 22 | ENTRY(do_vfp) |
George G. Davis | f2255be | 2009-04-01 20:27:18 +0100 | [diff] [blame] | 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 |
Russell King | 5d25ac0 | 2006-03-15 12:33:43 +0000 | [diff] [blame] | 28 | enable_irq |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | ldr r4, .LCvfp |
Catalin Marinas | c642846 | 2007-01-24 18:47:08 +0100 | [diff] [blame] | 30 | ldr r11, [r10, #TI_CPU] @ CPU number |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 31 | add r10, r10, #TI_VFPSTATE @ r10 = workspace |
| 32 | ldr pc, [r4] @ call VFP entry point |
Catalin Marinas | 93ed397 | 2008-08-28 11:22:32 +0100 | [diff] [blame] | 33 | ENDPROC(do_vfp) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | |
Russell King | 5d4cae5 | 2007-06-10 12:22:20 +0100 | [diff] [blame] | 35 | ENTRY(vfp_null_entry) |
George G. Davis | f2255be | 2009-04-01 20:27:18 +0100 | [diff] [blame] | 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 |
Russell King | 5d4cae5 | 2007-06-10 12:22:20 +0100 | [diff] [blame] | 42 | mov pc, lr |
| 43 | ENDPROC(vfp_null_entry) |
| 44 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 45 | .LCvfp: |
| 46 | .word vfp_vector |
| 47 | |
| 48 | @ This code is called if the VFP does not exist. It needs to flag the |
| 49 | @ failure to the VFP initialisation code. |
| 50 | |
| 51 | __INIT |
Catalin Marinas | 93ed397 | 2008-08-28 11:22:32 +0100 | [diff] [blame] | 52 | ENTRY(vfp_testing_entry) |
George G. Davis | f2255be | 2009-04-01 20:27:18 +0100 | [diff] [blame] | 53 | #ifdef CONFIG_PREEMPT |
| 54 | get_thread_info r10 |
| 55 | ldr r4, [r10, #TI_PREEMPT] @ get preempt count |
| 56 | sub r11, r4, #1 @ decrement it |
| 57 | str r11, [r10, #TI_PREEMPT] |
| 58 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | ldr r0, VFP_arch_address |
| 60 | str r5, [r0] @ known non-zero value |
| 61 | mov pc, r9 @ we have handled the fault |
Catalin Marinas | 93ed397 | 2008-08-28 11:22:32 +0100 | [diff] [blame] | 62 | ENDPROC(vfp_testing_entry) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 63 | |
| 64 | VFP_arch_address: |
| 65 | .word VFP_arch |
| 66 | |
| 67 | __FINIT |