From patchwork Mon Nov 18 13:06:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vineet Gupta X-Patchwork-Id: 292077 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id CB31A2C00B9 for ; Tue, 19 Nov 2013 00:10:34 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 50CC194B32; Mon, 18 Nov 2013 13:10:31 +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 P67QfXAib2lR; Mon, 18 Nov 2013 13:10:29 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id F0A05935E7; Mon, 18 Nov 2013 13:10:28 +0000 (UTC) X-Original-To: uclibc@lists.busybox.net Delivered-To: uclibc@osuosl.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id EDB5C1C1EF3 for ; Mon, 18 Nov 2013 13:10:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id E860D334D2 for ; Mon, 18 Nov 2013 13:10:26 +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 fN1ocYM58a7l for ; Mon, 18 Nov 2013 13:10:26 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from vaxjo.synopsys.com (us02smtp1.synopsys.com [198.182.60.75]) by silver.osuosl.org (Postfix) with ESMTP id 1E2E4334E5 for ; Mon, 18 Nov 2013 13:10:26 +0000 (UTC) Received: from WBSNus02mta1 (us02secmta1.synopsys.com [10.12.235.96]) by vaxjo.synopsys.com (Postfix) with ESMTP id D7E12DA52; Mon, 18 Nov 2013 05:07:03 -0800 (PST) Received: from us02secmta1.internal.synopsys.com (us02secmta1.internal.synopsys.com [127.0.0.1]) by us02secmta1.internal.synopsys.com (Service) with ESMTP id C4C9B4E213; Mon, 18 Nov 2013 05:07:03 -0800 (PST) Received: from mailhost.synopsys.com (mailhost3.synopsys.com [10.12.238.238]) by us02secmta1.internal.synopsys.com (Service) with ESMTP id A12C74E202; Mon, 18 Nov 2013 05:07:03 -0800 (PST) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 94474B03; Mon, 18 Nov 2013 05:07:03 -0800 (PST) Received: from US01WXQAHTC1.internal.synopsys.com (us01wxqahtc1.internal.synopsys.com [10.12.238.230]) by mailhost.synopsys.com (Postfix) with ESMTP id 8E180B02; Mon, 18 Nov 2013 05:07:03 -0800 (PST) Received: from IN01WEHTCB.internal.synopsys.com (10.144.199.105) by US01WXQAHTC1.internal.synopsys.com (10.12.238.230) with Microsoft SMTP Server (TLS) id 14.2.298.4; Mon, 18 Nov 2013 05:07:03 -0800 Received: from vineetg-E6520.internal.synopsys.com (10.12.197.99) by IN01WEHTCB.internal.synopsys.com (10.144.199.243) with Microsoft SMTP Server (TLS) id 14.2.298.4; Mon, 18 Nov 2013 18:36:58 +0530 From: Vineet Gupta To: Subject: [PATCH 3/6] LT.old: Add ARC support Date: Mon, 18 Nov 2013 18:36:10 +0530 Message-ID: <1384779973-30342-4-git-send-email-vgupta@synopsys.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1384779973-30342-1-git-send-email-vgupta@synopsys.com> References: <1384779973-30342-1-git-send-email-vgupta@synopsys.com> MIME-Version: 1.0 X-Originating-IP: [10.12.197.99] Cc: Vineet Gupta , Francois Bedard X-BeenThere: uclibc@uclibc.org X-Mailman-Version: 2.1.14 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-bounces@uclibc.org Signed-off-by: Vineet Gupta --- .../linuxthreads.old/sysdeps/arc/pt-machine.h | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 libpthread/linuxthreads.old/sysdeps/arc/pt-machine.h diff --git a/libpthread/linuxthreads.old/sysdeps/arc/pt-machine.h b/libpthread/linuxthreads.old/sysdeps/arc/pt-machine.h new file mode 100644 index 000000000000..0d6e29c44f08 --- /dev/null +++ b/libpthread/linuxthreads.old/sysdeps/arc/pt-machine.h @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2013 Synopsys, Inc. (www.synopsys.com) + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ + +#ifndef _PT_MACHINE_H +#define _PT_MACHINE_H 1 +#include + +#ifndef PT_EI +# define PT_EI __extern_always_inline +#endif + +extern long int testandset (int *spinlock); +extern int __compare_and_swap (long int *p, long int oldval, long int newval); + +PT_EI long int +testandset (int *spinlock) +{ + unsigned int old = 1; + + /* Atomically exchange @spinlock with 1 */ + __asm__ __volatile__( + "ex %0, [%1]" + : "+r" (old) + : "r" (spinlock) + : "memory"); + + return old; + +} + +/* Get some notion of the current stack. Need not be exactly the top + of the stack, just something somewhere in the current frame. + I don't trust register variables, so let's do this the safe way. */ +#define CURRENT_STACK_FRAME \ +__extension__ ({ char *__sp; __asm__ ("mov %0,sp" : "=r" (__sp)); __sp; }) + +#else +#error PT_MACHINE already defined +#endif /* pt-machine.h */