entry.S 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /*
  2. * File: arch/blackfin/kernel/entry.S
  3. * Based on:
  4. * Author:
  5. *
  6. * Created:
  7. * Description:
  8. *
  9. * Modified:
  10. * Copyright 2004-2006 Analog Devices Inc.
  11. *
  12. * Bugs: Enter bugs at http://blackfin.uclinux.org/
  13. *
  14. * This program is free software; you can redistribute it and/or modify
  15. * it under the terms of the GNU General Public License as published by
  16. * the Free Software Foundation; either version 2 of the License, or
  17. * (at your option) any later version.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public License
  25. * along with this program; if not, see the file COPYING, or write
  26. * to the Free Software Foundation, Inc.,
  27. * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  28. */
  29. #include <linux/linkage.h>
  30. #include <asm/thread_info.h>
  31. #include <asm/errno.h>
  32. #include <asm/blackfin.h>
  33. #include <asm/asm-offsets.h>
  34. #include <asm/context.S>
  35. #ifdef CONFIG_EXCPT_IRQ_SYSC_L1
  36. .section .l1.text
  37. #else
  38. .text
  39. #endif
  40. ENTRY(_ret_from_fork)
  41. #ifdef CONFIG_IPIPE
  42. [--sp] = reti; /* IRQs on. */
  43. SP += 4;
  44. #endif /* CONFIG_IPIPE */
  45. SP += -12;
  46. call _schedule_tail;
  47. SP += 12;
  48. r0 = [sp + PT_IPEND];
  49. cc = bittst(r0,1);
  50. if cc jump .Lin_kernel;
  51. RESTORE_CONTEXT
  52. rti;
  53. .Lin_kernel:
  54. bitclr(r0,1);
  55. [sp + PT_IPEND] = r0;
  56. /* do a 'fake' RTI by jumping to [RETI]
  57. * to avoid clearing supervisor mode in child
  58. */
  59. r0 = [sp + PT_PC];
  60. [sp + PT_P0] = r0;
  61. RESTORE_ALL_SYS
  62. jump (p0);
  63. ENDPROC(_ret_from_fork)
  64. ENTRY(_sys_fork)
  65. r0 = -EINVAL;
  66. #if (ANOMALY_05000371)
  67. nop;
  68. nop;
  69. nop;
  70. #endif
  71. rts;
  72. ENDPROC(_sys_fork)
  73. ENTRY(_sys_vfork)
  74. r0 = sp;
  75. r0 += 24;
  76. [--sp] = rets;
  77. SP += -12;
  78. call _bfin_vfork;
  79. SP += 12;
  80. rets = [sp++];
  81. rts;
  82. ENDPROC(_sys_vfork)
  83. ENTRY(_sys_clone)
  84. r0 = sp;
  85. r0 += 24;
  86. [--sp] = rets;
  87. SP += -12;
  88. call _bfin_clone;
  89. SP += 12;
  90. rets = [sp++];
  91. rts;
  92. ENDPROC(_sys_clone)
  93. ENTRY(_sys_rt_sigreturn)
  94. r0 = sp;
  95. r0 += 24;
  96. [--sp] = rets;
  97. SP += -12;
  98. call _do_rt_sigreturn;
  99. SP += 12;
  100. rets = [sp++];
  101. rts;
  102. ENDPROC(_sys_rt_sigreturn)