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