From patchwork Sat Nov 1 08:59:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: sposelenov@emcraft.com X-Patchwork-Id: 405764 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id D0C721400B6 for ; Sat, 1 Nov 2014 19:59:11 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 9255733A90; Sat, 1 Nov 2014 08:59:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gGFCy6NS-B9F; Sat, 1 Nov 2014 08:59:09 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id D78A8339F5; Sat, 1 Nov 2014 08:59:08 +0000 (UTC) X-Original-To: uclibc@lists.busybox.net Delivered-To: uclibc@osuosl.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 558BF1C1EDA for ; Sat, 1 Nov 2014 08:59:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 5408395774 for ; Sat, 1 Nov 2014 08:59:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CENr9V1jnNN3 for ; Sat, 1 Nov 2014 08:59:07 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from ocean.emcraft.com (ocean.emcraft.com [213.221.7.182]) by hemlock.osuosl.org (Postfix) with ESMTPS id 1839E95762 for ; Sat, 1 Nov 2014 08:59:07 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=[IPv6:::1]) by ocean.emcraft.com with esmtp (Exim 4.76) (envelope-from ) id 1XkUWW-0003wI-F4; Sat, 01 Nov 2014 11:59:04 +0300 Message-ID: <1414832344.11706.8.camel@mehome> Subject: [PATCH 2/3] Fixed clone() for Cortex-M3 From: Sergei Poselenov To: Bernhard Reutner-Fischer Date: Sat, 01 Nov 2014 11:59:04 +0300 In-Reply-To: <1414831960.11706.3.camel@mehome> References: <20141022141126.3e6849ec@skywanderer.emcraft.com> <723A8C88-67FA-4D54-85A5-18F2A7D3B4F0@gmail.com> <1414831960.11706.3.camel@mehome> Organization: Emcraft Systems OOO X-Mailer: Evolution 3.8.5 (3.8.5-2.fc19) Mime-Version: 1.0 Cc: uclibc@uclibc.org, Andrii X-BeenThere: uclibc@uclibc.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Discussion and development of uClibc \(the embedded C library\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: uclibc-bounces@uclibc.org Sender: "uClibc" commit 5c6eec82dd4ef1962b92d5d6531f14b6d7a6a30a Author: Sergei Poselenov Date: Sun Oct 26 14:53:32 2014 +0400 Fixed clone() for Cortex-M3. Signed-off-by: Sergei Poselenov diff --git a/libc/sysdeps/linux/arm/clone.S b/libc/sysdeps/linux/arm/clone.S index fdc05b8..6c89a10 100644 --- a/libc/sysdeps/linux/arm/clone.S +++ b/libc/sysdeps/linux/arm/clone.S @@ -104,26 +104,24 @@ __clone: @ get flags mov r0, r2 @ new sp is already in r1 - @ load remaining arguments off the stack - stmfd sp!, {r4} - ldr r2, [sp, #4] - ldr r3, [sp, #8] - ldr r4, [sp, #12] DO_CALL (clone) movs a1, a1 blt __error - ldmnefd sp!, {r4} IT(t, ne) #if defined(__USE_BX__) bxne lr #else movne pc, lr #endif - @ pick the function arg and call address off the stack and execute ldr r0, [sp, #4] - mov lr, pc - ldr pc, [sp] +#if defined(__USE_BX__) + ldr r1, [sp] + blx r1 +#else + mov lr, pc + ldr pc, [sp] +#endif @ and we are done, passing the return value through r0 b HIDDEN_JUMPTARGET(_exit)