entry.S 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /*
  2. * Copyright 2004-2009 Analog Devices Inc.
  3. *
  4. * Licensed under the GPL-2 or later
  5. */
  6. #include <linux/linkage.h>
  7. #include <asm/thread_info.h>
  8. #include <asm/errno.h>
  9. #include <asm/blackfin.h>
  10. #include <asm/asm-offsets.h>
  11. #include <asm/context.S>
  12. #ifdef CONFIG_EXCPT_IRQ_SYSC_L1
  13. .section .l1.text
  14. #else
  15. .text
  16. #endif
  17. ENTRY(_ret_from_fork)
  18. #ifdef CONFIG_IPIPE
  19. /*
  20. * Hw IRQs are off on entry, and we don't want the scheduling tail
  21. * code to starve high priority domains from interrupts while it
  22. * runs. Therefore we first stall the root stage to have the
  23. * virtual interrupt state reflect IMASK.
  24. */
  25. p0.l = ___ipipe_root_status;
  26. p0.h = ___ipipe_root_status;
  27. r4 = [p0];
  28. bitset(r4, 0);
  29. [p0] = r4;
  30. /*
  31. * Then we may enable hw IRQs, allowing preemption from high
  32. * priority domains. schedule_tail() will do local_irq_enable()
  33. * since Blackfin does not define __ARCH_WANT_UNLOCKED_CTXSW, so
  34. * there is no need to unstall the root domain by ourselves
  35. * afterwards.
  36. */
  37. p0.l = _bfin_irq_flags;
  38. p0.h = _bfin_irq_flags;
  39. r4 = [p0];
  40. sti r4;
  41. #endif /* CONFIG_IPIPE */
  42. SP += -12;
  43. pseudo_long_call _schedule_tail, p5;
  44. SP += 12;
  45. r0 = [sp + PT_IPEND];
  46. cc = bittst(r0,1);
  47. if cc jump .Lin_kernel;
  48. RESTORE_CONTEXT
  49. rti;
  50. .Lin_kernel:
  51. bitclr(r0,1);
  52. [sp + PT_IPEND] = r0;
  53. /* do a 'fake' RTI by jumping to [RETI]
  54. * to avoid clearing supervisor mode in child
  55. */
  56. r0 = [sp + PT_PC];
  57. [sp + PT_P0] = r0;
  58. RESTORE_ALL_SYS
  59. jump (p0);
  60. ENDPROC(_ret_from_fork)
  61. ENTRY(_sys_fork)
  62. r0 = -EINVAL;
  63. #if (ANOMALY_05000371)
  64. nop;
  65. nop;
  66. nop;
  67. #endif
  68. rts;
  69. ENDPROC(_sys_fork)
  70. ENTRY(_sys_vfork)
  71. r0 = sp;
  72. r0 += 24;
  73. [--sp] = rets;
  74. SP += -12;
  75. pseudo_long_call _bfin_vfork, p2;
  76. SP += 12;
  77. rets = [sp++];
  78. rts;
  79. ENDPROC(_sys_vfork)
  80. ENTRY(_sys_clone)
  81. r0 = sp;
  82. r0 += 24;
  83. [--sp] = rets;
  84. SP += -12;
  85. pseudo_long_call _bfin_clone, p2;
  86. SP += 12;
  87. rets = [sp++];
  88. rts;
  89. ENDPROC(_sys_clone)
  90. ENTRY(_sys_rt_sigreturn)
  91. r0 = sp;
  92. r0 += 24;
  93. [--sp] = rets;
  94. SP += -12;
  95. pseudo_long_call _do_rt_sigreturn, p2;
  96. SP += 12;
  97. rets = [sp++];
  98. rts;
  99. ENDPROC(_sys_rt_sigreturn)