X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=libc%2Fsysdeps%2Flinux%2Fi960%2Fclone.S;fp=libc%2Fsysdeps%2Flinux%2Fi960%2Fclone.S;h=0000000000000000000000000000000000000000;hb=7db56e580823ca91aff186d46eac693b09b9bb0e;hp=9419f287c0b9fd9a6f8cff2f2a936c96f5d3d7c2;hpb=49b3d8569a8c8cb724ba6eadb34dea2df9b5ec4d;p=uclinux-h8%2Fuclibc-ng.git diff --git a/libc/sysdeps/linux/i960/clone.S b/libc/sysdeps/linux/i960/clone.S deleted file mode 100644 index 9419f287c..000000000 --- a/libc/sysdeps/linux/i960/clone.S +++ /dev/null @@ -1,61 +0,0 @@ -# -# clone.S, part of the i960 support for the uClibc library. -# -# Copyright (C) 2002 by Okiok Data Ltd. http://www.okiok.com/ -# -# This program is free software; you can redistribute it and/or modify it under -# the terms of the GNU Library General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) any -# later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more -# details. -# -# You should have received a copy of the GNU Library General Public License -# along with this program; if not, see . -# -# Derived from an old port of uC-libc to the i960 by Keith Adams (kma@cse.ogi.edu). -# - -#include -#include - -/* clone is even more special than fork as it mucks with stacks - and invokes a function in the right context after its all over. */ - -/* int _clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */ - - .globl clone -clone: - /* set up new stack image in regs r4-r7; argument will be in r3 in child. */ - ldconst 0, r4 /* pfp == 0 */ - addo 16, g1, r5 /* sp == newfp + 16 */ - mov g0, r6 /* rip == fnc */ - mov g2, r7 - stq r4, (g1) - - addo sp, 4, sp - st g10, -4(sp) - mov sp, g10 - ldconst __NR_clone, g13 - calls 0 - - /* Do the system call */ - cmpibg 0, g0, __syscall_error /* if < 0, error */ - be thread_start /* if == 0, we're the child */ - ret /* we're the parent */ - -__syscall_error: - not g0, r3 - callx ___errno_location - st r3, (g0) - ret - -thread_start: - # our new pfp is in g1; here we go - flushreg - mov g1, pfp - flushreg - ret