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. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | */ |
Catalin Marinas | 39ad04c | 2014-04-02 10:57:48 +0100 | [diff] [blame] | 11 | #include <linux/init.h> |
| 12 | #include <linux/linkage.h> |
George G. Davis | f2255be | 2009-04-01 20:27:18 +0100 | [diff] [blame] | 13 | #include <asm/thread_info.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | #include <asm/vfpmacros.h> |
Catalin Marinas | 39ad04c | 2014-04-02 10:57:48 +0100 | [diff] [blame] | 15 | #include <asm/assembler.h> |
| 16 | #include <asm/asm-offsets.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | |
Russell King | 15ac49b | 2012-07-30 19:42:10 +0100 | [diff] [blame] | 18 | @ VFP entry point. |
| 19 | @ |
| 20 | @ r0 = instruction opcode (32-bit ARM or two 16-bit Thumb) |
| 21 | @ r2 = PC value to resume execution after successful emulation |
| 22 | @ r9 = normal "successful" return address |
| 23 | @ r10 = this threads thread_info structure |
| 24 | @ lr = unrecognised instruction return address |
Catalin Marinas | 1417a6b | 2014-04-22 16:14:29 +0100 | [diff] [blame] | 25 | @ IRQs enabled. |
Russell King | 15ac49b | 2012-07-30 19:42:10 +0100 | [diff] [blame] | 26 | @ |
Catalin Marinas | 93ed397 | 2008-08-28 11:22:32 +0100 | [diff] [blame] | 27 | ENTRY(do_vfp) |
Catalin Marinas | 0b1f68e | 2014-04-02 10:57:49 +0100 | [diff] [blame] | 28 | inc_preempt_count r10, r4 |
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) |
Catalin Marinas | 0b1f68e | 2014-04-02 10:57:49 +0100 | [diff] [blame] | 36 | dec_preempt_count_ti r10, r4 |
Russell King | 6ebbf2c | 2014-06-30 16:29:12 +0100 | [diff] [blame] | 37 | ret lr |
Russell King | 5d4cae5 | 2007-06-10 12:22:20 +0100 | [diff] [blame] | 38 | ENDPROC(vfp_null_entry) |
| 39 | |
Catalin Marinas | 88987ef | 2009-07-24 12:32:52 +0100 | [diff] [blame] | 40 | .align 2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | .LCvfp: |
| 42 | .word vfp_vector |
| 43 | |
| 44 | @ This code is called if the VFP does not exist. It needs to flag the |
| 45 | @ failure to the VFP initialisation code. |
| 46 | |
| 47 | __INIT |
Catalin Marinas | 93ed397 | 2008-08-28 11:22:32 +0100 | [diff] [blame] | 48 | ENTRY(vfp_testing_entry) |
Catalin Marinas | 0b1f68e | 2014-04-02 10:57:49 +0100 | [diff] [blame] | 49 | dec_preempt_count_ti r10, r4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | ldr r0, VFP_arch_address |
Will Deacon | f27d6e1 | 2013-05-16 19:38:51 +0100 | [diff] [blame] | 51 | str r0, [r0] @ set to non-zero value |
Russell King | 6ebbf2c | 2014-06-30 16:29:12 +0100 | [diff] [blame] | 52 | ret r9 @ we have handled the fault |
Catalin Marinas | 93ed397 | 2008-08-28 11:22:32 +0100 | [diff] [blame] | 53 | ENDPROC(vfp_testing_entry) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 54 | |
Catalin Marinas | 88987ef | 2009-07-24 12:32:52 +0100 | [diff] [blame] | 55 | .align 2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | VFP_arch_address: |
| 57 | .word VFP_arch |
| 58 | |
| 59 | __FINIT |