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