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
30#include <linux/linkage.h>
31#include <asm/thread_info.h>
32#include <asm/errno.h>
33#include <asm/asm-offsets.h>
34
35#include <asm/mach-common/context.S>
36
37#ifdef CONFIG_EXCPT_IRQ_SYSC_L1
38.section .l1.text
39#else
40.text
41#endif
42
43ENTRY(_ret_from_fork)
44	SP += -12;
45	call _schedule_tail;
46	SP += 12;
47	r0 = [sp + PT_IPEND];
48	cc = bittst(r0,1);
49	if cc jump .Lin_kernel;
50	RESTORE_CONTEXT
51	rti;
52.Lin_kernel:
53	bitclr(r0,1);
54	[sp + PT_IPEND] = r0;
55	/* do a 'fake' RTI by jumping to [RETI]
56	 * to avoid clearing supervisor mode in child
57	*/
58	RESTORE_ALL_SYS
59	p0 = reti;
60	jump (p0);
61ENDPROC(_ret_from_fork)
62
63ENTRY(_sys_fork)
64	r0 = -EINVAL;
65	rts;
66ENDPROC(_sys_fork)
67
68ENTRY(_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;
77ENDPROC(_sys_vfork)
78
79ENTRY(_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;
88ENDPROC(_sys_clone)
89
90ENTRY(_sys_rt_sigreturn)
91	r0 = sp;
92	r0 += 24;
93	[--sp] = rets;
94	SP += -12;
95	call _do_rt_sigreturn;
96	SP += 12;
97	rets = [sp++];
98	rts;
99ENDPROC(_sys_rt_sigreturn)
100