]> git.karo-electronics.de Git - karo-tx-linux.git/blob - arch/blackfin/kernel/entry.S
Blackfin arch: include linux/mm.h since we use PAGE_ALIGN and such
[karo-tx-linux.git] / arch / blackfin / kernel / entry.S
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/blackfin.h>
34 #include <asm/asm-offsets.h>
35
36 #include <asm/context.S>
37
38 #ifdef CONFIG_EXCPT_IRQ_SYSC_L1
39 .section .l1.text
40 #else
41 .text
42 #endif
43
44 ENTRY(_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
58          */
59         r0 = [sp + PT_PC];
60         [sp + PT_P0] = r0;
61
62         RESTORE_ALL_SYS
63         jump (p0);
64 ENDPROC(_ret_from_fork)
65
66 ENTRY(_sys_fork)
67         r0 = -EINVAL;
68 #if (ANOMALY_05000371)
69         nop;
70         nop;
71         nop;
72 #endif
73         rts;
74 ENDPROC(_sys_fork)
75
76 ENTRY(_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;
85 ENDPROC(_sys_vfork)
86
87 ENTRY(_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;
96 ENDPROC(_sys_clone)
97
98 ENTRY(_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;
107 ENDPROC(_sys_rt_sigreturn)