entry.S 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. * r2 = faulted PC+4
  14. * r9 = successful return
  15. * r10 = thread_info structure
  16. * lr = failure return
  17. */
  18. #include <asm/thread_info.h>
  19. #include <asm/vfpmacros.h>
  20. #include "../kernel/entry-header.S"
  21. ENTRY(do_vfp)
  22. #ifdef CONFIG_PREEMPT
  23. ldr r4, [r10, #TI_PREEMPT] @ get preempt count
  24. add r11, r4, #1 @ increment it
  25. str r11, [r10, #TI_PREEMPT]
  26. #endif
  27. enable_irq
  28. str r2, [sp, #S_PC] @ update regs->ARM_pc for Thumb 2 case
  29. ldr r4, .LCvfp
  30. ldr r11, [r10, #TI_CPU] @ CPU number
  31. add r10, r10, #TI_VFPSTATE @ r10 = workspace
  32. ldr pc, [r4] @ call VFP entry point
  33. ENDPROC(do_vfp)
  34. ENTRY(vfp_null_entry)
  35. #ifdef CONFIG_PREEMPT
  36. get_thread_info r10
  37. ldr r4, [r10, #TI_PREEMPT] @ get preempt count
  38. sub r11, r4, #1 @ decrement it
  39. str r11, [r10, #TI_PREEMPT]
  40. #endif
  41. mov pc, lr
  42. ENDPROC(vfp_null_entry)
  43. .align 2
  44. .LCvfp:
  45. .word vfp_vector
  46. @ This code is called if the VFP does not exist. It needs to flag the
  47. @ failure to the VFP initialisation code.
  48. __INIT
  49. ENTRY(vfp_testing_entry)
  50. #ifdef CONFIG_PREEMPT
  51. get_thread_info r10
  52. ldr r4, [r10, #TI_PREEMPT] @ get preempt count
  53. sub r11, r4, #1 @ decrement it
  54. str r11, [r10, #TI_PREEMPT]
  55. #endif
  56. ldr r0, VFP_arch_address
  57. str r5, [r0] @ known non-zero value
  58. mov pc, r9 @ we have handled the fault
  59. ENDPROC(vfp_testing_entry)
  60. .align 2
  61. VFP_arch_address:
  62. .word VFP_arch
  63. __FINIT