| Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 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 |  | 
| Bryan Wu | 639f657 | 2008-08-27 10:51:02 +0800 | [diff] [blame] | 35 | #include <asm/context.S> | 
| Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 36 |  | 
|  | 37 | #ifdef CONFIG_EXCPT_IRQ_SYSC_L1 | 
|  | 38 | .section .l1.text | 
|  | 39 | #else | 
|  | 40 | .text | 
|  | 41 | #endif | 
|  | 42 |  | 
|  | 43 | ENTRY(_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 | 
| Robin Getz | aa770aa | 2007-10-29 18:14:15 +0800 | [diff] [blame] | 57 | */ | 
|  | 58 | r0 = [sp + PT_PC]; | 
|  | 59 | [sp + PT_P0] = r0; | 
|  | 60 |  | 
| Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 61 | RESTORE_ALL_SYS | 
| Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 62 | jump (p0); | 
| Mike Frysinger | 51be24c | 2007-06-11 15:31:30 +0800 | [diff] [blame] | 63 | ENDPROC(_ret_from_fork) | 
| Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 64 |  | 
|  | 65 | ENTRY(_sys_fork) | 
|  | 66 | r0 = -EINVAL; | 
| Michael Hennerich | 2cfebf2 | 2008-07-16 16:59:05 +0800 | [diff] [blame] | 67 | #if (ANOMALY_05000371) | 
|  | 68 | nop; | 
|  | 69 | nop; | 
|  | 70 | nop; | 
|  | 71 | #endif | 
| Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 72 | rts; | 
| Mike Frysinger | 51be24c | 2007-06-11 15:31:30 +0800 | [diff] [blame] | 73 | ENDPROC(_sys_fork) | 
| Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 74 |  | 
|  | 75 | ENTRY(_sys_vfork) | 
|  | 76 | r0 = sp; | 
|  | 77 | r0 += 24; | 
|  | 78 | [--sp] = rets; | 
|  | 79 | SP += -12; | 
|  | 80 | call _bfin_vfork; | 
|  | 81 | SP += 12; | 
|  | 82 | rets = [sp++]; | 
|  | 83 | rts; | 
| Mike Frysinger | 51be24c | 2007-06-11 15:31:30 +0800 | [diff] [blame] | 84 | ENDPROC(_sys_vfork) | 
| Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 85 |  | 
|  | 86 | ENTRY(_sys_clone) | 
|  | 87 | r0 = sp; | 
|  | 88 | r0 += 24; | 
|  | 89 | [--sp] = rets; | 
|  | 90 | SP += -12; | 
|  | 91 | call _bfin_clone; | 
|  | 92 | SP += 12; | 
|  | 93 | rets = [sp++]; | 
|  | 94 | rts; | 
| Mike Frysinger | 51be24c | 2007-06-11 15:31:30 +0800 | [diff] [blame] | 95 | ENDPROC(_sys_clone) | 
| Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 96 |  | 
|  | 97 | ENTRY(_sys_rt_sigreturn) | 
|  | 98 | r0 = sp; | 
|  | 99 | r0 += 24; | 
|  | 100 | [--sp] = rets; | 
|  | 101 | SP += -12; | 
|  | 102 | call _do_rt_sigreturn; | 
|  | 103 | SP += 12; | 
|  | 104 | rets = [sp++]; | 
|  | 105 | rts; | 
| Mike Frysinger | 51be24c | 2007-06-11 15:31:30 +0800 | [diff] [blame] | 106 | ENDPROC(_sys_rt_sigreturn) |