entry.S 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. * r5 = 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. ldr r4, .LCvfp
  29. ldr r11, [r10, #TI_CPU] @ CPU number
  30. add r10, r10, #TI_VFPSTATE @ r10 = workspace
  31. ldr pc, [r4] @ call VFP entry point
  32. ENDPROC(do_vfp)
  33. ENTRY(vfp_null_entry)
  34. #ifdef CONFIG_PREEMPT
  35. get_thread_info r10
  36. ldr r4, [r10, #TI_PREEMPT] @ get preempt count
  37. sub r11, r4, #1 @ decrement it
  38. str r11, [r10, #TI_PREEMPT]
  39. #endif
  40. mov pc, lr
  41. ENDPROC(vfp_null_entry)
  42. .align 2
  43. .LCvfp:
  44. .word vfp_vector
  45. @ This code is called if the VFP does not exist. It needs to flag the
  46. @ failure to the VFP initialisation code.
  47. __INIT
  48. ENTRY(vfp_testing_entry)
  49. #ifdef CONFIG_PREEMPT
  50. get_thread_info r10
  51. ldr r4, [r10, #TI_PREEMPT] @ get preempt count
  52. sub r11, r4, #1 @ decrement it
  53. str r11, [r10, #TI_PREEMPT]
  54. #endif
  55. ldr r0, VFP_arch_address
  56. str r5, [r0] @ known non-zero value
  57. mov pc, r9 @ we have handled the fault
  58. ENDPROC(vfp_testing_entry)
  59. .align 2
  60. VFP_arch_address:
  61. .word VFP_arch
  62. __FINIT