entry.S 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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/asm-offsets.h>
  33. #include <asm/context.S>
  34. #ifdef CONFIG_EXCPT_IRQ_SYSC_L1
  35. .section .l1.text
  36. #else
  37. .text
  38. #endif
  39. ENTRY(_ret_from_fork)
  40. SP += -12;
  41. call _schedule_tail;
  42. SP += 12;
  43. r0 = [sp + PT_IPEND];
  44. cc = bittst(r0,1);
  45. if cc jump .Lin_kernel;
  46. RESTORE_CONTEXT
  47. rti;
  48. .Lin_kernel:
  49. bitclr(r0,1);
  50. [sp + PT_IPEND] = r0;
  51. /* do a 'fake' RTI by jumping to [RETI]
  52. * to avoid clearing supervisor mode in child
  53. */
  54. r0 = [sp + PT_PC];
  55. [sp + PT_P0] = r0;
  56. RESTORE_ALL_SYS
  57. jump (p0);
  58. ENDPROC(_ret_from_fork)
  59. ENTRY(_sys_fork)
  60. r0 = -EINVAL;
  61. #if (ANOMALY_05000371)
  62. nop;
  63. nop;
  64. nop;
  65. #endif
  66. rts;
  67. ENDPROC(_sys_fork)
  68. ENTRY(_sys_vfork)
  69. r0 = sp;
  70. r0 += 24;
  71. [--sp] = rets;
  72. SP += -12;
  73. call _bfin_vfork;
  74. SP += 12;
  75. rets = [sp++];
  76. rts;
  77. ENDPROC(_sys_vfork)
  78. ENTRY(_sys_clone)
  79. r0 = sp;
  80. r0 += 24;
  81. [--sp] = rets;
  82. SP += -12;
  83. call _bfin_clone;
  84. SP += 12;
  85. rets = [sp++];
  86. rts;
  87. ENDPROC(_sys_clone)
  88. ENTRY(_sys_rt_sigreturn)
  89. r0 = sp;
  90. r0 += 24;
  91. [--sp] = rets;
  92. SP += -12;
  93. call _do_rt_sigreturn;
  94. SP += 12;
  95. rets = [sp++];
  96. rts;
  97. ENDPROC(_sys_rt_sigreturn)