Merge tag 'mxs-fixes-3.10' of git://git.linaro.org/people/shawnguo/linux-2.6 into...
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / arm / vfp / entry.S
CommitLineData
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.
1da177e4 10 */
f2255be8 11#include <asm/thread_info.h>
1da177e4 12#include <asm/vfpmacros.h>
f2255be8 13#include "../kernel/entry-header.S"
1da177e4 14
15ac49b6
RK
15@ 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
22@ IRQs disabled.
23@
93ed3970 24ENTRY(do_vfp)
568dca15 25#ifdef CONFIG_PREEMPT_COUNT
f2255be8
GD
26 ldr r4, [r10, #TI_PREEMPT] @ get preempt count
27 add r11, r4, #1 @ increment it
28 str r11, [r10, #TI_PREEMPT]
29#endif
5d25ac03 30 enable_irq
1da177e4 31 ldr r4, .LCvfp
c6428464 32 ldr r11, [r10, #TI_CPU] @ CPU number
1da177e4
LT
33 add r10, r10, #TI_VFPSTATE @ r10 = workspace
34 ldr pc, [r4] @ call VFP entry point
93ed3970 35ENDPROC(do_vfp)
1da177e4 36
5d4cae5f 37ENTRY(vfp_null_entry)
568dca15 38#ifdef CONFIG_PREEMPT_COUNT
f2255be8
GD
39 get_thread_info r10
40 ldr r4, [r10, #TI_PREEMPT] @ get preempt count
41 sub r11, r4, #1 @ decrement it
42 str r11, [r10, #TI_PREEMPT]
43#endif
5d4cae5f
RK
44 mov pc, lr
45ENDPROC(vfp_null_entry)
46
88987ef9 47 .align 2
1da177e4
LT
48.LCvfp:
49 .word vfp_vector
50
51@ This code is called if the VFP does not exist. It needs to flag the
52@ failure to the VFP initialisation code.
53
54 __INIT
93ed3970 55ENTRY(vfp_testing_entry)
568dca15 56#ifdef CONFIG_PREEMPT_COUNT
f2255be8
GD
57 get_thread_info r10
58 ldr r4, [r10, #TI_PREEMPT] @ get preempt count
59 sub r11, r4, #1 @ decrement it
60 str r11, [r10, #TI_PREEMPT]
61#endif
1da177e4 62 ldr r0, VFP_arch_address
f27d6e17 63 str r0, [r0] @ set to non-zero value
1da177e4 64 mov pc, r9 @ we have handled the fault
93ed3970 65ENDPROC(vfp_testing_entry)
1da177e4 66
88987ef9 67 .align 2
1da177e4
LT
68VFP_arch_address:
69 .word VFP_arch
70
71 __FINIT