entry.S 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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/mach-common/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. RESTORE_ALL_SYS
  55. p0 = reti;
  56. jump (p0);
  57. ENTRY(_sys_fork)
  58. r0 = -EINVAL;
  59. rts;
  60. ENTRY(_sys_vfork)
  61. r0 = sp;
  62. r0 += 24;
  63. [--sp] = rets;
  64. SP += -12;
  65. call _bfin_vfork;
  66. SP += 12;
  67. rets = [sp++];
  68. rts;
  69. ENTRY(_sys_clone)
  70. r0 = sp;
  71. r0 += 24;
  72. [--sp] = rets;
  73. SP += -12;
  74. call _bfin_clone;
  75. SP += 12;
  76. rets = [sp++];
  77. rts;
  78. ENTRY(_sys_rt_sigreturn)
  79. r0 = sp;
  80. r0 += 24;
  81. [--sp] = rets;
  82. SP += -12;
  83. call _do_rt_sigreturn;
  84. SP += 12;
  85. rets = [sp++];
  86. rts;