blob: ba592a9e6fb36cfa868c2b4a8ade37248c0743b8 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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 */
18#include <linux/linkage.h>
19#include <linux/init.h>
Sam Ravnborge6ae7442005-09-09 21:08:59 +020020#include <asm/asm-offsets.h>
Russell King9c429542006-03-23 16:59:37 +000021#include <asm/assembler.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070022#include <asm/vfpmacros.h>
23
Catalin Marinas93ed3972008-08-28 11:22:32 +010024ENTRY(do_vfp)
Russell King5d25ac02006-03-15 12:33:43 +000025 enable_irq
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)
33 mov pc, lr
34ENDPROC(vfp_null_entry)
35
Linus Torvalds1da177e2005-04-16 15:20:36 -070036.LCvfp:
37 .word vfp_vector
38
39@ This code is called if the VFP does not exist. It needs to flag the
40@ failure to the VFP initialisation code.
41
42 __INIT
Catalin Marinas93ed3972008-08-28 11:22:32 +010043ENTRY(vfp_testing_entry)
Linus Torvalds1da177e2005-04-16 15:20:36 -070044 ldr r0, VFP_arch_address
45 str r5, [r0] @ known non-zero value
46 mov pc, r9 @ we have handled the fault
Catalin Marinas93ed3972008-08-28 11:22:32 +010047ENDPROC(vfp_testing_entry)
Linus Torvalds1da177e2005-04-16 15:20:36 -070048
49VFP_arch_address:
50 .word VFP_arch
51
52 __FINIT