blob: 0186cf9da890bcab8af516b2f5234128ae3b6f38 [file] [log] [blame]
Thomas Gleixnerd2912cb2019-06-04 10:11:33 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002/*
3 * linux/arch/arm/vfp/entry.S
4 *
5 * Copyright (C) 2004 ARM Limited.
6 * Written by Deep Blue Solutions Limited.
Linus Torvalds1da177e2005-04-16 15:20:36 -07007 */
Catalin Marinas39ad04c2014-04-02 10:57:48 +01008#include <linux/init.h>
9#include <linux/linkage.h>
George G. Davisf2255be2009-04-01 20:27:18 +010010#include <asm/thread_info.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070011#include <asm/vfpmacros.h>
Catalin Marinas39ad04c2014-04-02 10:57:48 +010012#include <asm/assembler.h>
13#include <asm/asm-offsets.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070014
Russell King15ac49b2012-07-30 19:42:10 +010015@ VFP entry point.
16@
17@ r0 = instruction opcode (32-bit ARM or two 16-bit Thumb)
18@ r2 = PC value to resume execution after successful emulation
19@ r9 = normal "successful" return address
20@ r10 = this threads thread_info structure
21@ lr = unrecognised instruction return address
Catalin Marinas1417a6b2014-04-22 16:14:29 +010022@ IRQs enabled.
Russell King15ac49b2012-07-30 19:42:10 +010023@
Catalin Marinas93ed3972008-08-28 11:22:32 +010024ENTRY(do_vfp)
Catalin Marinas0b1f68e2014-04-02 10:57:49 +010025 inc_preempt_count r10, r4
Linus Torvalds1da177e2005-04-16 15:20:36 -070026 ldr r4, .LCvfp
Catalin Marinasc6428462007-01-24 18:47:08 +010027 ldr r11, [r10, #TI_CPU] @ CPU number
Linus Torvalds1da177e2005-04-16 15:20:36 -070028 add r10, r10, #TI_VFPSTATE @ r10 = workspace
29 ldr pc, [r4] @ call VFP entry point
Catalin Marinas93ed3972008-08-28 11:22:32 +010030ENDPROC(do_vfp)
Linus Torvalds1da177e2005-04-16 15:20:36 -070031
Russell King5d4cae52007-06-10 12:22:20 +010032ENTRY(vfp_null_entry)
Catalin Marinas0b1f68e2014-04-02 10:57:49 +010033 dec_preempt_count_ti r10, r4
Russell King6ebbf2c2014-06-30 16:29:12 +010034 ret lr
Russell King5d4cae52007-06-10 12:22:20 +010035ENDPROC(vfp_null_entry)
36
Catalin Marinas88987ef2009-07-24 12:32:52 +010037 .align 2
Linus Torvalds1da177e2005-04-16 15:20:36 -070038.LCvfp:
39 .word vfp_vector
40
41@ This code is called if the VFP does not exist. It needs to flag the
42@ failure to the VFP initialisation code.
43
44 __INIT
Catalin Marinas93ed3972008-08-28 11:22:32 +010045ENTRY(vfp_testing_entry)
Catalin Marinas0b1f68e2014-04-02 10:57:49 +010046 dec_preempt_count_ti r10, r4
Linus Torvalds1da177e2005-04-16 15:20:36 -070047 ldr r0, VFP_arch_address
Will Deaconf27d6e12013-05-16 19:38:51 +010048 str r0, [r0] @ set to non-zero value
Russell King6ebbf2c2014-06-30 16:29:12 +010049 ret r9 @ we have handled the fault
Catalin Marinas93ed3972008-08-28 11:22:32 +010050ENDPROC(vfp_testing_entry)
Linus Torvalds1da177e2005-04-16 15:20:36 -070051
Catalin Marinas88987ef2009-07-24 12:32:52 +010052 .align 2
Linus Torvalds1da177e2005-04-16 15:20:36 -070053VFP_arch_address:
54 .word VFP_arch
55
56 __FINIT