blob: c0c3fe8112288ced7ee5e0caa04a6fc51b2e0d33 [file] [log] [blame]
Bryan Wu1394f032007-05-06 14:50:22 -07001/*
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
30#include <linux/linkage.h>
31#include <asm/thread_info.h>
32#include <asm/errno.h>
Graf Yang8f658732008-11-18 17:48:22 +080033#include <asm/blackfin.h>
Bryan Wu1394f032007-05-06 14:50:22 -070034#include <asm/asm-offsets.h>
35
Bryan Wu639f6572008-08-27 10:51:02 +080036#include <asm/context.S>
Bryan Wu1394f032007-05-06 14:50:22 -070037
38#ifdef CONFIG_EXCPT_IRQ_SYSC_L1
39.section .l1.text
40#else
41.text
42#endif
43
44ENTRY(_ret_from_fork)
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
Robin Getzaa770aa2007-10-29 18:14:15 +080058 */
59 r0 = [sp + PT_PC];
60 [sp + PT_P0] = r0;
61
Bryan Wu1394f032007-05-06 14:50:22 -070062 RESTORE_ALL_SYS
Bryan Wu1394f032007-05-06 14:50:22 -070063 jump (p0);
Mike Frysinger51be24c2007-06-11 15:31:30 +080064ENDPROC(_ret_from_fork)
Bryan Wu1394f032007-05-06 14:50:22 -070065
66ENTRY(_sys_fork)
67 r0 = -EINVAL;
Michael Hennerich2cfebf22008-07-16 16:59:05 +080068#if (ANOMALY_05000371)
69 nop;
70 nop;
71 nop;
72#endif
Bryan Wu1394f032007-05-06 14:50:22 -070073 rts;
Mike Frysinger51be24c2007-06-11 15:31:30 +080074ENDPROC(_sys_fork)
Bryan Wu1394f032007-05-06 14:50:22 -070075
76ENTRY(_sys_vfork)
77 r0 = sp;
78 r0 += 24;
79 [--sp] = rets;
80 SP += -12;
81 call _bfin_vfork;
82 SP += 12;
83 rets = [sp++];
84 rts;
Mike Frysinger51be24c2007-06-11 15:31:30 +080085ENDPROC(_sys_vfork)
Bryan Wu1394f032007-05-06 14:50:22 -070086
87ENTRY(_sys_clone)
88 r0 = sp;
89 r0 += 24;
90 [--sp] = rets;
91 SP += -12;
92 call _bfin_clone;
93 SP += 12;
94 rets = [sp++];
95 rts;
Mike Frysinger51be24c2007-06-11 15:31:30 +080096ENDPROC(_sys_clone)
Bryan Wu1394f032007-05-06 14:50:22 -070097
98ENTRY(_sys_rt_sigreturn)
99 r0 = sp;
100 r0 += 24;
101 [--sp] = rets;
102 SP += -12;
103 call _do_rt_sigreturn;
104 SP += 12;
105 rets = [sp++];
106 rts;
Mike Frysinger51be24c2007-06-11 15:31:30 +0800107ENDPROC(_sys_rt_sigreturn)