entry.S 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. p1 = [sp++];
  46. r0 = [sp++];
  47. cc = p1 == 0;
  48. if cc jump .Lfork;
  49. sp += -12;
  50. call (p1);
  51. sp += 12;
  52. .Lfork:
  53. RESTORE_CONTEXT
  54. rti;
  55. ENDPROC(_ret_from_fork)