entry.S 2.1 KB

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