From patchwork Tue Aug 20 12:10:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuriy Kolerov X-Patchwork-Id: 96148 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 19A8E38449CB for ; Tue, 20 Aug 2024 12:12:51 +0000 (GMT) X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from mx0a-00230701.pphosted.com (mx0a-00230701.pphosted.com [148.163.156.19]) by sourceware.org (Postfix) with ESMTPS id 060E53846080 for ; Tue, 20 Aug 2024 12:11:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 060E53846080 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=synopsys.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=synopsys.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 060E53846080 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.156.19 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724155894; cv=none; b=n+VAfXST+ewlMUFZm8Cz+/H8QOMJw8eCWpzh2z4tXtohYyrkF4k7nk09G0V7rZcsng0maH30QHZvO2aZF0/BckcRnDLVMcIJibY1idue7iBlo90fVy8E4eicr4znfl/XWGpfwnhQivBKmXzh6Ld45aR0lMhZSmCOTExiVGdKb4w= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724155894; c=relaxed/simple; bh=i3s/5nK73tLa02lXM9f83HHWc8oRbQSNGyg7UloM/LU=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-Id: MIME-Version; b=wFtQv7V3MhNzE+siDgZFvvc2KC8AfSXED16/9++D5XivKZFtzR8CTNzloJWwdBoX97zbxBsWDCfFdZjgOw3y2LSMPrDSxcCrOIvwqpNA0/LRkIMUGf7kyPOcEYuZze2KsnNLQ72P2DMu1cQT1PyLMkyEb4ntky80Z4NT2GFqooI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0297266.ppops.net [127.0.0.1]) by mx0a-00230701.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47KBaU5g021181 for ; Tue, 20 Aug 2024 05:11:31 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pfptdkimsnps; bh=0GHBV49N mbom+iRvztkGfRCt97/QCxf5pqwG4215Ypo=; b=QEO+6hidMBUtEu0+UpacqNnN krfCewSFC7DaJjrh2CaZE3nZTpSyNW1fYEi+3TCJv2KqOeu49IN9ayuANE1NrFwU WJM9McJmWNor+SmESbp3yu4eivHsCmrYIr9zth4Ac9SFUX6MV3WKKdAdQEGAMm17 DUQnkA+JgVK/dHzweQoD+XMRpQDxePN1v+VmZO/iUJINciXyUqTbVN3ruNhPDQJ3 nNTRnssV64gyvO1izjWnIjnznpLTMT4lTKt0PoR3y/mEPuvXylB/KnMa6aKprckk NF2VP77gnW6JioF2IQo5m4D5f/+93ponhrrfugavcsc+ME+dhaqyj1G/PxGSAA== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.87.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 414g8ktnwa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 20 Aug 2024 05:11:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1724155890; bh=i3s/5nK73tLa02lXM9f83HHWc8oRbQSNGyg7UloM/LU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fBRAuZs6mMGx5hsAyq1sfW8BPOdO1e05A6FSjGuGdIu5lsduOm1Q8XJ10HDhFw+aP UeNt3Ps8TLeRfskytqNNBVjLpIzD5THzUTVZumsxFxGVCCa8j1JCkynZmQtFigdNNB tk3ob3vakOz5Xn4tb1O5LnEfl0hrPDB6FOuZFbNjmYEKSFzrQbQ+3ZOB5q+yYcpogE iB5SPropdC2sYvHuWDu25796vM3rGfV18aBhQCGBRnVwLhqzDBa1Vjj/7pHwVg5ArY dEEKXLLgFAuIQJpXQP2s2H9JeAC47hwrAwaAhIYOZsuSIx18sbwHqpDcS5aPjna5v/ P4KDuQmA5DLZQ== Received: from mailhost.synopsys.com (eudc-mailhost2.synopsys.com [10.213.161.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mailhost.synopsys.com", Issuer "SNPSica2" (verified OK)) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 1035940467 for ; Tue, 20 Aug 2024 12:11:30 +0000 (UTC) Received: from SNPS-HRlPxd6IgG.internal.synopsys.com (snps-hrlpxd6igg.internal.synopsys.com [10.120.15.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by mailhost.synopsys.com (Postfix) with ESMTPSA id 3435FC048C; Tue, 20 Aug 2024 12:11:28 +0000 (UTC) X-SNPS-Relay: synopsys.com From: Yuriy.Kolerov@synopsys.com To: newlib@sourceware.org Cc: Yuriy Kolerov Subject: [PATCH 1/8] arc: libgloss: Fix define guard in nsim-syscall.h Date: Tue, 20 Aug 2024 15:10:36 +0300 Message-Id: <20240820121043.1605628-2-ykolerov@synopsys.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240820121043.1605628-1-ykolerov@synopsys.com> References: <20240820121043.1605628-1-ykolerov@synopsys.com> MIME-Version: 1.0 X-Proofpoint-GUID: IfS0-QhhjZRErrvfCoCkMUstrO94ZJoz X-Authority-Analysis: v=2.4 cv=T4TeTOKQ c=1 sm=1 tr=0 ts=66c487f2 cx=c_pps a=t4gDRyhI9k+KZ5gXRQysFQ==:117 a=t4gDRyhI9k+KZ5gXRQysFQ==:17 a=yoJbH4e0A30A:10 a=jIQo8A4GAAAA:8 a=BHLIh3G6Muy6jNyVwvMA:9 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-ORIG-GUID: IfS0-QhhjZRErrvfCoCkMUstrO94ZJoz X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-20_09,2024-08-19_03,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_active_cloned_notspam policy=outbound_active_cloned score=0 malwarescore=0 bulkscore=0 clxscore=1015 spamscore=0 lowpriorityscore=0 suspectscore=0 phishscore=0 mlxlogscore=872 impostorscore=0 mlxscore=0 priorityscore=1501 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2408200090 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: newlib-bounces~patchwork=sourceware.org@sourceware.org From: Yuriy Kolerov Signed-off-by: Yuriy Kolerov --- libgloss/arc/nsim-syscall.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libgloss/arc/nsim-syscall.h b/libgloss/arc/nsim-syscall.h index a2009f5b2..9d13b226e 100644 --- a/libgloss/arc/nsim-syscall.h +++ b/libgloss/arc/nsim-syscall.h @@ -28,8 +28,8 @@ POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _ASM_ARC_UNISTD_H -#define _ASM_ARC_UNISTD_H +#ifndef _NSIM_SYSCALL_H +#define _NSIM_SYSCALL_H #include @@ -454,4 +454,4 @@ struct nsim_stat { uint32_t __unused5; }; -#endif /* _ASM_ARC_UNISTD_H */ +#endif /* _NSIM_SYSCALL_H */ From patchwork Tue Aug 20 12:10:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuriy Kolerov X-Patchwork-Id: 96145 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C47AB38449C6 for ; Tue, 20 Aug 2024 12:11:57 +0000 (GMT) X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from mx0b-00230701.pphosted.com (mx0b-00230701.pphosted.com [148.163.158.9]) by sourceware.org (Postfix) with ESMTPS id 531A13846092 for ; Tue, 20 Aug 2024 12:11:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 531A13846092 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=synopsys.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=synopsys.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 531A13846092 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.158.9 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724155894; cv=none; b=pe9OFRXKOxFf1rmoDVHe2KlF48W8L4bJJaLN3awPYrTgTHfc7iUpKxjTf3UBdUcKaAIBX+OkcmBlfFG2NZkEHzLxduCyo8OXOAIiSfYZP2uiwMvpf2rBITHndtmXtWJO2dejGXz2YO+vOfmVA4MCWRIVqa53LZPVFZNCVIaEj5M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724155894; c=relaxed/simple; bh=nrmpgjlC/nwGauasgAge8z7lQdRlK072LM1sN/HUIw0=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-Id: MIME-Version; b=TjST8rwhKsnu9jFynxTAp+zwzpgQG5/Wjp4O3FkoiRCCWi1lVDjSBtMwPNhczgoqH/840dkW3FsV3gpaoaP5wU7hBzDwcRAohKwXNvDIvHjTYDxyN9bW9iOAI50OhR/YGOahToUI0s7ErEVtvfXlHN1j5VcAkKfarAgfv6VGJ4c= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0098572.ppops.net [127.0.0.1]) by mx0b-00230701.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47KBaMPN008002 for ; Tue, 20 Aug 2024 05:11:32 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pfptdkimsnps; bh=5H4v9sCZ KlUOTYWpMSzgTLlKQmMvfKhu2J7+xuJVULc=; b=SbAhFfhJDiZHiOaRfpInSvKB BwzPWyMkadYrwmCR3pPyQgBW39y1De04mX1k/z/3/2gLpJnMaK/e08F223Kw6U7V 2bCdzGIFMwFfXEjuuvKW6mh43mJ7pvyRjEqL0z2ScYx8Kogotj0/K1qTR0x/1/al UwpVep5smrCZByHv2ZIKZkKcqEUWrjrt0IRvTO6XTYJixG7cEwCM8J2uiYLEUzBT 7DCuEKVjdXxQgiCnBOkUK1d6ztTCWaEOZBVayKG+qP09FFN0O0XS3yINsUU2nzmh 562B7uxDDiv0FKJhvXOtihkvIF2cLwlPWRyMG/qSc4cZt9fEDlNOQnsTT+MsBA== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.73.133]) by mx0b-00230701.pphosted.com (PPS) with ESMTPS id 414g8k2rce-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 20 Aug 2024 05:11:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1724155890; bh=nrmpgjlC/nwGauasgAge8z7lQdRlK072LM1sN/HUIw0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Dj5EvikKrJIh05tTtFKboCoY8tHGimIAwfwBfO5oV+WpYPVmZReM+t28wfNXPrZ+o cxZZTU3LSVIEfEr8t0e5wSWNcmOspHcTRvWT+LYqh2zobZOi5yIX/VoIsiMNTPSecx InVwGp/zuRCY2XuhAOtd8AMDZTHNLZbkb1ZCqlfUjl4Vxgsb5LNnSNBgDEsSSKTVqg 22kjbuD2D+25INcjPTDUwXIb9B24q+UpNQra+c3HcqEJcGIkgPRtDEMSnLlCSkjqvh xHt/yesunoAQ103ROx2+wrVwZWgW4lulTBjsEz+6ZY1V7PNcbCBSE1vkoaCuDvsebr 7bzWVUJKkG9Sg== Received: from mailhost.synopsys.com (eudc-mailhost2.synopsys.com [10.213.161.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mailhost.synopsys.com", Issuer "SNPSica2" (verified OK)) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 74E0C40408 for ; Tue, 20 Aug 2024 12:11:30 +0000 (UTC) Received: from SNPS-HRlPxd6IgG.internal.synopsys.com (snps-hrlpxd6igg.internal.synopsys.com [10.120.15.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by mailhost.synopsys.com (Postfix) with ESMTPSA id A5B63C0B82; Tue, 20 Aug 2024 12:11:28 +0000 (UTC) X-SNPS-Relay: synopsys.com From: Yuriy.Kolerov@synopsys.com To: newlib@sourceware.org Cc: Alexey Brodkin Subject: [PATCH 2/8] arc: libgloss: Switch from .balign to .align Date: Tue, 20 Aug 2024 15:10:37 +0300 Message-Id: <20240820121043.1605628-3-ykolerov@synopsys.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240820121043.1605628-1-ykolerov@synopsys.com> References: <20240820121043.1605628-1-ykolerov@synopsys.com> MIME-Version: 1.0 X-Authority-Analysis: v=2.4 cv=bpgeB1ai c=1 sm=1 tr=0 ts=66c487f3 cx=c_pps a=8EbXvwLXkpGsT4ql/pYRAw==:117 a=8EbXvwLXkpGsT4ql/pYRAw==:17 a=yoJbH4e0A30A:10 a=jIQo8A4GAAAA:8 a=Bxg3xGbil7ffnsJbsCMA:9 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-GUID: 0r8Q3oGehIQwgpC2sOwNHB4lvIS98rpZ X-Proofpoint-ORIG-GUID: 0r8Q3oGehIQwgpC2sOwNHB4lvIS98rpZ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-20_09,2024-08-19_03,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_active_cloned_notspam policy=outbound_active_cloned score=0 suspectscore=0 impostorscore=0 spamscore=0 lowpriorityscore=0 phishscore=0 adultscore=0 clxscore=1015 priorityscore=1501 mlxlogscore=618 malwarescore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2408200090 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: newlib-bounces~patchwork=sourceware.org@sourceware.org From: Alexey Brodkin .align is supported by both GCC & MetaWare compiler for ARC, yet implements the same semantics as .balign which only works with GCC. Signed-off-by: Alexey Brodkin --- libgloss/arc/crt0.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libgloss/arc/crt0.S b/libgloss/arc/crt0.S index 0c2a2bd26..36b9c250a 100644 --- a/libgloss/arc/crt0.S +++ b/libgloss/arc/crt0.S @@ -276,4 +276,4 @@ _exit_halt: nop #endif b @_exit_halt -.balign 4 +.align 4 From patchwork Tue Aug 20 12:10:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuriy Kolerov X-Patchwork-Id: 96149 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8963B386D625 for ; Tue, 20 Aug 2024 12:12:55 +0000 (GMT) X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from mx0b-00230701.pphosted.com (mx0b-00230701.pphosted.com [148.163.158.9]) by sourceware.org (Postfix) with ESMTPS id BD1013846091 for ; Tue, 20 Aug 2024 12:11:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BD1013846091 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=synopsys.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=synopsys.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BD1013846091 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.158.9 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724155897; cv=none; b=DKzC5PLCimLK0BO3DSDM7dAE6i5JWLOeVQZ2m1F+8lUe8SONf1L20UygA2D/7O13JLSxTWNEc92tGmdBH9+yxF/PJvO8mDKqkiMeWdMC/+hHh0tmNMWBa4sh8XAiqM3nMzGAMG/ljF8MAT9susrvDnNgMJvUktKEEAEBNr7i9NU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724155897; c=relaxed/simple; bh=1HMnYehs1qwZ2azX7LOUsuPiWn/P9FBE4Nwp4vltgEo=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-Id: MIME-Version; b=vt6R25sm9oo+BkNBHQNPgrqCUw3PxhVz7+AeZuTBtD/GPY7XeO564BSo+wjrlY63iUh5t4dIWA9UADhPkXxmiy8an6ANYbvICaceINC1CmFoA8+XEsV0xkdjO74qUdxr46rwVMyzO73EdxNDahKl6GKraNZ8gwRfI7WV5lGgBcs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0297265.ppops.net [127.0.0.1]) by mx0a-00230701.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47KBaQd9020114 for ; Tue, 20 Aug 2024 05:11:32 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pfptdkimsnps; bh=KcSoZLut LPBFZmteAwA2PQ0goyKVmIXnKciT0db5P14=; b=qi5nlnUlaYaTGCqdJmuVal3b AQaXgskeWRqBguwclMs4D2nLJJLIJfqNeHOsy5Y0ZbBVKEY2QmV44lxRd7h1l6yb HTxoL3Upte1nQsqj6jiDCveB20ZdllekEksy9E3bKKieXuPtfsubFXn6jjp7vTa9 FxK4TnQ3YZyrw/qtJE5zFY59+a+Aykdq5Aq+B4bypPVlak7MiSZvEVJDioA0QByq GDttz2i88U8p1w1aS20YkegScW5TRxk3tpUtFtsoSW2FD1WrWAN3foEfNZi646vL xAihKFZhOQr1KPYlprCy62v0Wsdtinkg9CbKH3ZDWSPV+1pAk/mIhhnePtuP5Q== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.73.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 414g8mapvj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 20 Aug 2024 05:11:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1724155891; bh=1HMnYehs1qwZ2azX7LOUsuPiWn/P9FBE4Nwp4vltgEo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ccfmcjffzB4vWxEiiljDZEZPIGvdXbcW+z6A4rTQ5ZSLojuPa2O29yTRRjYiD6p19 drum/BKp7a+zZVKXwFr6nMD+5zcfKBECedRtTsl5zK0MKLoEKi0AOAberH4bmnU/aS vrfpJTohIfQSSLfyveOlREtqRJTvcyXMN072fMev9WPQv/ed911qzD78+7zkijzms+ MI5QBYzhGHwsTJkZvIJAjKpP2UOhfYIYkkMoR8uAN+YbNlLJxzm8YCVA/v5Z2hfr+9 VehlF2tZwMsaxj//E6FMFo4xKTTSu+MGisseRdYkctuGg2CAPKqBkARAYnJU7i8cVG zrY+c6Kk22Jew== Received: from mailhost.synopsys.com (eudc-mailhost2.synopsys.com [10.213.161.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mailhost.synopsys.com", Issuer "SNPSica2" (verified OK)) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id E8EAF4048B for ; Tue, 20 Aug 2024 12:11:30 +0000 (UTC) Received: from SNPS-HRlPxd6IgG.internal.synopsys.com (snps-hrlpxd6igg.internal.synopsys.com [10.120.15.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by mailhost.synopsys.com (Postfix) with ESMTPSA id 22828C0CBA; Tue, 20 Aug 2024 12:11:29 +0000 (UTC) X-SNPS-Relay: synopsys.com From: Yuriy.Kolerov@synopsys.com To: newlib@sourceware.org Cc: Yuriy Kolerov Subject: [PATCH 3/8] arc: libgloss: Clean MetaWare hostlink documentation Date: Tue, 20 Aug 2024 15:10:38 +0300 Message-Id: <20240820121043.1605628-4-ykolerov@synopsys.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240820121043.1605628-1-ykolerov@synopsys.com> References: <20240820121043.1605628-1-ykolerov@synopsys.com> MIME-Version: 1.0 X-Authority-Analysis: v=2.4 cv=HYFGTTE8 c=1 sm=1 tr=0 ts=66c487f4 cx=c_pps a=8EbXvwLXkpGsT4ql/pYRAw==:117 a=8EbXvwLXkpGsT4ql/pYRAw==:17 a=yoJbH4e0A30A:10 a=jIQo8A4GAAAA:8 a=Ob3TOZBIjYyB0-eJeHUA:9 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-GUID: MwJid2_nXpgQ-LSv8AQSmlXKVfwjuwMP X-Proofpoint-ORIG-GUID: MwJid2_nXpgQ-LSv8AQSmlXKVfwjuwMP X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-20_09,2024-08-19_03,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_active_cloned_notspam policy=outbound_active_cloned score=0 clxscore=1015 priorityscore=1501 malwarescore=0 phishscore=0 bulkscore=0 impostorscore=0 spamscore=0 mlxscore=0 mlxlogscore=882 suspectscore=0 lowpriorityscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2408200090 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: newlib-bounces~patchwork=sourceware.org@sourceware.org From: Yuriy Kolerov Signed-off-by: Yuriy Kolerov --- libgloss/arc/readme-hostlink.md | 134 ++++++++++++++++---------------- 1 file changed, 67 insertions(+), 67 deletions(-) diff --git a/libgloss/arc/readme-hostlink.md b/libgloss/arc/readme-hostlink.md index 0061be3df..e2e5a7da5 100644 --- a/libgloss/arc/readme-hostlink.md +++ b/libgloss/arc/readme-hostlink.md @@ -1,90 +1,90 @@ -Metaware hostlink IO +MetaWare Hostlink IO ==================== -This directory includes target-side implementation of Metaware hostlink -interface see Contents section. Target program can use Metaware hostlink -interface to send messages to nsim simulator or mdb debugger (it can be -attached to HW or nsim). +Target program can use MetaWare hostlink interface to send messages to nSIM +simulator or MDB debugger. -Quick start +Quick Start ----------- -To link with this version of libgloss please add `-specs=hl.specs` to baremetal -version of ARC gcc (arc-elf32). -Lets build and run simple program: +To link with MetaWare hostlink library use `-specs=hl.specs` with baremetal +version of GCC for ARC processors - `arc-elf32-gcc` for ARCv1/2 targets or +`arc64-elf-gcc` for ARCv3 targets. + +Consider this sample program named `hello.c`: - $ cat hello.c #include int main() { - printf("Hello World!\n"); - - return 0; + printf("Hello, World!\n"); + return 0; } - $ arc-elf32-gcc -mcpu=hs -specs=hl.specs ./hello.c -o hello - $ nsimdrv -prop=nsim_isa_family=av2hs -prop=nsim_hlink_gnu_io_ext=1 ./hello - Hello World! -Where `-mcpu` and `-prop=nsim_isa_family` is specific to your version of ARC CPU. -Option `-prop=nsim_hlink_gnu_io_ext=1` enables GNU IO extension for nSIM which -is used for some system calls. The `nsimdrv` option `-prop=nsim_emt={0,1,2}` -enables trap emulation and should be disabled (removed or set to `0`) to use -Metaware hostlink. +Build and run it for HS3x/4x targets: + + $ arc-elf32-gcc -mcpu=hs -specs=hl.specs hello.c -o hello.elf + $ nsimdrv -tcf $NSIM_HOME/etc/tcf/templates/hs48_full.tcf -p nsim_hostlink=1 hello.elf + Hello, World! + +Build and run it for HS5x targets: + + $ arc64-elf-gcc -mcpu=hs5x -specs=hl.specs hello.c -o hello.elf + $ nsimdrv -tcf $NSIM_HOME/etc/tcf/templates/hs58_full.tcf -p nsim_hostlink=1 hello.elf + Hello, World! -**NB:** Metaware hostlink requires symbols `__HOSTLINK__` and `_hl_blockedPeek` -to be present. So stripped binary won't work properly with Metaware hostlink. +Build and run it for HS6x targets: + + $ arc64-elf-gcc -mcpu=hs6x -specs=hl.specs hello.c -o hello.elf + $ nsimdrv -tcf $NSIM_HOME/etc/tcf/templates/hs68_full.tcf -p nsim_hostlink=1 hello.elf + Hello, World! Contents -------- -* `hl/hl_gw.*` -- Hostlink gateway. This API is used in the `hl_api.*`. - Please use `hl_message()` from `hl_api.*` for hostlink - message exchange. -* `hl/hl_api.*` -- High-level API to send hostlink messages, as well as - functions to work with messages. -* `hl/hl_.*` -- Syscall implementations through hostlink API; -* `arc-timer.*` -- Provides API to access ARC timers. Used by - `hl/hl_clock.c` in `_clock()` implementation. -* `arc-main-helper.c` -- Provides `__setup_argv_and_call_main()`. The function - is called from `__start()` in `crt0.S`. It allows - to setup `argc` and `arvg` as well as some custom - things through `_setup_low_level()`. -* `hl-setup.c` -- Provides `_setup_low_level()` for hostlink case. - It just configures default timer if it exists. Default - timer is used in the hostlink `clock()` - implementation. -* `hl-stub.c` -- Provides functions which are part of newlib but - implemented without hostlink. - e.g. `_kill()` and `_getpid()`. -* `sbrk.c` -- Provides `_sbrk()`. It uses `__start_heap` and - `__end_heap` variables. -* `libcfunc.c` -- Additional C system calls. -* `mcount.c` -- Profiler support. - -How it works + +* `hl/hl_gw.*` - Hostlink gateway. This API is used in the `hl_api.*`. + Please use `hl_message()` from `hl_api.*` for hostlink message exchange. +* `hl/hl_api.*` - High-level API to send hostlink messages, as well as + functions to work with messages. +* `hl/hl_.*` - System calls implementations through hostlink API. +* `arc-timer.*` - Provides API to access ARC timers. Used by `hl/hl_clock.c` + in `_clock()` implementation. +* `arc-main-helper.c` - Provides `__setup_argv_and_call_main()`. The function + is called from `__start()` in `crt0.S`. It allows to setup `argc` and `arvg` + as well as some custom things through `_setup_low_level()`. +* `hl-setup.c` - Provides `_setup_low_level()` for hostlink case. It just + configures default timer if it exists. Default timer is used in the hostlink + `clock()` implementation. +* `hl-stub.c` - Provides functions which are part of newlib but implemented + without hostlink. For example, `_kill()` and `_getpid()`. +* `sbrk.c` - Provides `_sbrk()`. It uses `__start_heap` and `__end_heap` + variables. +* `libcfunc.c` - Additional C system calls. +* `mcount.c` - Profiler support. + +How It Works ------------ + Simulator looks for `__HOSTLINK__` and `_hl_blockedPeek()` symbols. `__HOSTLINK__` is the start of shared structure for message exchange and `_hl_blockedPeek()` is a function to be called when program is waiting for simulator response. When program wants to send a message it should follow: - 1. Fill `__HOSTLINK__.payload` with packed data. - Packing format is following: `{u16 type, u16 size, char data[]}`. - Supported types are `char`, `short`, `int`, `string` and `int64`. - `hl_api` provides high-level API to this. - 2. Fill `__HOSTLINK__.pkt_hdr`. See `hl_pkt_init()` from `hl_gw.c`. - 3. Fill `__HOSTLINK__.hdr`. See `hl_send()` from `hl_gw.c`. - 4. Call `_hl_blockedPeek()` to get response. - At this point message should be delivered to debugger. - Some implementations uses change of `__HOSTLINK__.hdr.target2host_addr` as - a signal that packet is sent and can be processed. Other implementations - wait for `_hl_blockedPeek()` to be called. - - It means that portable implementation must fill - `__HOSTLINK__.hdr.target2host_addr` at the last step and then call - `_hl_blockedPeek()`. - 5. `_hl_blockedPeek()` returns pointer to debugger response which can be - processed on target if needed. Because debugger and target share the same - buffer the function actually returns `__HOSTLINK__.payload` that was - filled with packed data (see step 1) by the debugger. + +1. Fill `__HOSTLINK__.payload` with packed data. Packing format is following: + `{u16 type, u16 size, char data[]}`. Supported types are `char`, `short`, + `int`, `string` and `int64`. `hl_api` provides high-level API to this. +2. Fill `__HOSTLINK__.pkt_hdr`. See `hl_pkt_init()` from `hl_gw.c`. +3. Fill `__HOSTLINK__.hdr`. See `hl_send()` from `hl_gw.c`. +4. Call `_hl_blockedPeek()` to get response. At this point message should be + delivered to debugger. Some implementations uses change of + `__HOSTLINK__.hdr.target2host_addr` as a signal that packet is sent and can + be processed. Other implementations wait for `_hl_blockedPeek()` to be + called. It means that portable implementation must fill + `__HOSTLINK__.hdr.target2host_addr` at the last step and then call + `_hl_blockedPeek()`. +5. `_hl_blockedPeek()` returns pointer to debugger response which can be + processed on target if needed. Because debugger and target share the same + buffer the function actually returns `__HOSTLINK__.payload` that was + filled with packed data (see step 1) by the debugger. From patchwork Tue Aug 20 12:10:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuriy Kolerov X-Patchwork-Id: 96150 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5D9F03870864 for ; Tue, 20 Aug 2024 12:13:07 +0000 (GMT) X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from mx0a-00230701.pphosted.com (mx0a-00230701.pphosted.com [148.163.156.19]) by sourceware.org (Postfix) with ESMTPS id 5A1353845158 for ; Tue, 20 Aug 2024 12:11:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5A1353845158 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=synopsys.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=synopsys.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5A1353845158 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.156.19 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724155914; cv=none; b=KNjes9Hdx8bpn/KQ3XarGTDF3sq4ZCuYdoYqK3NvzMRe9x6KLTLpiPQAdU2AYLZPuhwcqoKVZuiErZWLNXv1DiROm+VOKWKnvq8vdfh9hhbuVUeAzMR0IlDJ8eL1JbCLuIGF6xZmoWTeS2/OTBP1eLOIOU2zfYysPc8GtmeEbv0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724155914; c=relaxed/simple; bh=3H+Og91xTu4CqX57aU2HZ6dXNRFnIULl/fNPZhDQ62c=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-Id: MIME-Version; b=rloJb54wKtJp3uuTgGfsyEtGb2clb9cnNsArKz5KjGCu2wPwiTqHbBErFibnaISo9uawiJB7cv1DNXMuHEtnz3B7ymfrqluFB3zLZcPbLQPk41lIOMIeNa1XL3nd6UKXXZSndXOp8BhEPqZpa+/luECaSCQ8riJ294zlgjbdzdE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0098571.ppops.net [127.0.0.1]) by mx0a-00230701.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47KBaLq4031022; Tue, 20 Aug 2024 05:11:51 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pfptdkimsnps; bh=4pB4Q+zE dAKhaevC7NZS51yqq29Aovd/XQ61IeiyL7s=; b=LNEn7zL5AhZ9qYm1xpQ7N9o/ 9XqdPkcuTd3d3/Z0UJtLKUM+/CvoibHcocug4heMmYCQ3MWu+n/K3vRTbimb7A+y aVHXSlG1dsceZctfn81h+7kbuAQmzzySvHQuQDKbMXZ0Yjw1gIw0T5F18a4qcKzn W1iHDTyZT8fDqf7cGJYKjMZ3bQdQ96b0VHRkFQjXG7myzP6PwMHm4VyCkjzITQqB aytEI6KOXAbG1t6v6BFTdmsl3at89R/cLHfonGxJTTbogle/I7+YsEFLU/GBHqwf gDixJFaMRSEL9FWV+N+9iiFpZhc2NICPKigNYBMLV7eehB0+9KCJpTx4eh38Qw== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.87.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 414g8kjmxp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 20 Aug 2024 05:11:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1724155891; bh=3H+Og91xTu4CqX57aU2HZ6dXNRFnIULl/fNPZhDQ62c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SzXpHcktge2t5qL+kyQjDKljuAGBSNV2mHowRB88+TGzLNU+6DaRd4vBr/U/QIMVz hHxPhQRQkAatxF0Uhac6Te5TF5H6fb6T6LjwD/aA8HkTPcBihXkFnfsp032VqGOdCI DL/1DtHwIDHftaEM9EyPHn+vdbdczN8zwxIykUxGV27rU7bgm0kh0qZkGuCj+gcrgT 6f/0wxg+wXxU+JZ7fGS6zQfJ7wxKJoIyCNAvDCLPVQkrhu5REmfsH+G52qvt6SuNEi fTkYzP1VvAVWTet0Hyb+MUQbudXIYO4toyEoSFy0eIVtXd0ZtNDMcPKLhcqdSOeeou LP6zQ453K0EDQ== Received: from mailhost.synopsys.com (eudc-mailhost2.synopsys.com [10.213.161.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) client-signature RSA-PSS (2048 bits)) (Client CN "mailhost.synopsys.com", Issuer "SNPSica2" (verified OK)) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 4082B40340; Tue, 20 Aug 2024 12:11:31 +0000 (UTC) Received: from SNPS-HRlPxd6IgG.internal.synopsys.com (snps-hrlpxd6igg.internal.synopsys.com [10.120.15.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by mailhost.synopsys.com (Postfix) with ESMTPSA id A8A87C0CFA; Tue, 20 Aug 2024 12:11:29 +0000 (UTC) X-SNPS-Relay: synopsys.com From: Yuriy.Kolerov@synopsys.com To: newlib@sourceware.org Cc: Claudiu Zissulescu Subject: [PATCH 4/8] arc: Use __ARC_UNALIGNED__ compiler macro Date: Tue, 20 Aug 2024 15:10:39 +0300 Message-Id: <20240820121043.1605628-5-ykolerov@synopsys.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240820121043.1605628-1-ykolerov@synopsys.com> References: <20240820121043.1605628-1-ykolerov@synopsys.com> MIME-Version: 1.0 X-Authority-Analysis: v=2.4 cv=VcqlP0p9 c=1 sm=1 tr=0 ts=66c48807 cx=c_pps a=t4gDRyhI9k+KZ5gXRQysFQ==:117 a=t4gDRyhI9k+KZ5gXRQysFQ==:17 a=yoJbH4e0A30A:10 a=pGLkceISAAAA:8 a=lUg8dyFN0qjm751KY2IA:9 X-Proofpoint-GUID: Md5tRu_c9ZjWuvaBqqPMS7cDD47WNkTQ X-Proofpoint-ORIG-GUID: Md5tRu_c9ZjWuvaBqqPMS7cDD47WNkTQ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-20_09,2024-08-19_03,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_active_cloned_notspam policy=outbound_active_cloned score=0 mlxscore=0 bulkscore=0 suspectscore=0 lowpriorityscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 phishscore=0 adultscore=0 malwarescore=0 spamscore=0 mlxlogscore=898 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2408200090 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: newlib-bounces~patchwork=sourceware.org@sourceware.org From: Claudiu Zissulescu Replace __ARC_ALIGNED_ACCESS__ macro with the compiler defined macro __ARC_UNALIGNED__ and improve file comments. Signed-off-by: Claudiu Zissulescu --- newlib/libc/machine/arc/memcpy-archs.S | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/newlib/libc/machine/arc/memcpy-archs.S b/newlib/libc/machine/arc/memcpy-archs.S index f30dafd4f..3c477a745 100644 --- a/newlib/libc/machine/arc/memcpy-archs.S +++ b/newlib/libc/machine/arc/memcpy-archs.S @@ -70,7 +70,21 @@ # define ZOLAND 0xF #endif -#ifdef __ARC_ALIGNED_ACCESS__ + +;;; MEMCPY copy memory regions +;;; Input arguments: +;;; r0 - output memory region +;;; r1 - input memory region +;;; r2 - size in bytes +;;; Returns: +;;; r0 - pointer to the first byte of the output region +;;; Clobber: +;;; r1, r2, r3, r4, r5, r6, r8r9, r10r11, lp_count + +#if !defined (__ARC_UNALIGNED__) + +;;; MEMCPY routine for the case when the CPU only accepts ALIGNED +;;; accesses to memory. ENTRY (memcpy) prefetch [r1] ; Prefetch the read location prefetchw [r0] ; Prefetch the write location @@ -268,6 +282,8 @@ ENDFUNC (memcpy) #else +;;; MEMCPY routine which is used by systems with unaligned memory +;;; accesses. This is the case for most of ARCHS CPU family. ENTRY(memcpy) prefetch [r1] ; Prefetch the read location prefetchw [r0] ; Prefetch the write location From patchwork Tue Aug 20 12:10:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuriy Kolerov X-Patchwork-Id: 96151 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E54E43846081 for ; Tue, 20 Aug 2024 12:13:10 +0000 (GMT) X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from mx0a-00230701.pphosted.com (mx0a-00230701.pphosted.com [148.163.156.19]) by sourceware.org (Postfix) with ESMTPS id 9DC28384514A for ; Tue, 20 Aug 2024 12:11:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9DC28384514A Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=synopsys.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=synopsys.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9DC28384514A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.156.19 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724155916; cv=none; b=uTrAUR1t5BR00oy1KykW5XyNXhDzuhUFw7S7ifYkv1qhFQhD2HQFvkoO5MxrbDPu/kH4Z3yTUrab9jJfq1l7XptjYiJchj8p9xJy6+nQSLw+l3YYyVM7jfFen+NPAjvIw1Bul0nBIdu8wbzAePBnGsII3PCy5no5yJNZLbTfhwg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724155916; c=relaxed/simple; bh=tm+wk1YqV4nKhi4HSBYNebbxtfP6RCv9GZ7/URytcEs=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-Id: MIME-Version; b=HQGJalt9bLzTkcPM5Tp3OvvfH4tItt2T2dxpikiClCmqw6q6ECsVn1E1TqmOP7Gyfp1C0ynUmz0Eobjtp42+fXYZY3GC8rz5cXMyZu0QLkdNGSDjnt4h1XhwCM5YHr9OLrRNIebA9aoDs8y9BxJN9wgvMO7qvjSoTQvVKZOytDQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0098571.ppops.net [127.0.0.1]) by mx0a-00230701.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47KBaKhA031015 for ; Tue, 20 Aug 2024 05:11:51 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pfptdkimsnps; bh=tq3njmKh xofQTyEesQwF+NfS3UFD+gKew9zbu3bYcgU=; b=IvEzzN4Hu8COYJGMK4+HDkFs J1YkWgaGwbVJl45sb/HQf1RwJMGOeQ2bmpe6bFi55ygFPErPNEFmvMsVdc5xTTkp 5dvC18zkqlqS30oBqrNXQrYM0KhWk8S431JhESma+iY0LZY449RWCsBlnIrxay9B yfR/MOBlWRYr1IdvXgObc8UWypEWfgC+hKsVmbViDs6Gl+mNVhBRL1jvIezmVi8x 40Gf9XMm+Ld3Uqbv3ato6zssd4tTxQ/OaXAv2beoSwjr4slKsgQgggq3XTZ2O6zg +wBeWEq3UuWrDqKykLvrt6pcB0E0NMwROhVbNV1GpcY7KqU8K6PcJkDUdX1X0Q== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.87.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 414g8kjmxu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 20 Aug 2024 05:11:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1724155891; bh=tm+wk1YqV4nKhi4HSBYNebbxtfP6RCv9GZ7/URytcEs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OWOB5Ki8PSoMocBq1Wh7Zu7CbSsc9MWU2KP3SEwY/xmcQXuTMhFSG4WjtXjot5hQ8 EFDxGxIw6Y9K+QMG8MCaGmCu7W3cmWL3F3e5IGjtaz3fZ/FYZ2O3RUcFtbib/GYpBT nDtAQHXKG+8lpjqfFxPW+rQHd1XjElHa0ts0p3tTLJsJXXX4lgGbEWe/0fB/koCrS0 Y7RADRv/LZzFN0F4+zWXA4kAxeTr4jkUqCggzkOqLC0ioV/mtITPeif7pMeyGVEF3M TLtZxL97y+s+9TPaW6gKS5JxJQ3iQ2Y6GDqtch1EXmVJnF0jCe+WVNwbtoF8T+7iUc Gu2EexyMea69Q== Received: from mailhost.synopsys.com (eudc-mailhost2.synopsys.com [10.213.161.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) client-signature RSA-PSS (2048 bits)) (Client CN "mailhost.synopsys.com", Issuer "SNPSica2" (verified OK)) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id A102D40467 for ; Tue, 20 Aug 2024 12:11:31 +0000 (UTC) Received: from SNPS-HRlPxd6IgG.internal.synopsys.com (snps-hrlpxd6igg.internal.synopsys.com [10.120.15.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by mailhost.synopsys.com (Postfix) with ESMTPSA id 28BFBC0B10; Tue, 20 Aug 2024 12:11:30 +0000 (UTC) X-SNPS-Relay: synopsys.com From: Yuriy.Kolerov@synopsys.com To: newlib@sourceware.org Cc: Alexey Brodkin Subject: [PATCH 5/8] arc: Remove @ from symbol references in assembly Date: Tue, 20 Aug 2024 15:10:40 +0300 Message-Id: <20240820121043.1605628-6-ykolerov@synopsys.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240820121043.1605628-1-ykolerov@synopsys.com> References: <20240820121043.1605628-1-ykolerov@synopsys.com> MIME-Version: 1.0 X-Authority-Analysis: v=2.4 cv=VcqlP0p9 c=1 sm=1 tr=0 ts=66c48807 cx=c_pps a=t4gDRyhI9k+KZ5gXRQysFQ==:117 a=t4gDRyhI9k+KZ5gXRQysFQ==:17 a=yoJbH4e0A30A:10 a=jIQo8A4GAAAA:8 a=UlrhkWCSf2s1214rN5AA:9 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-GUID: YxPt1RwAKGCax6TSi79Cj9RNuIO9-Qn- X-Proofpoint-ORIG-GUID: YxPt1RwAKGCax6TSi79Cj9RNuIO9-Qn- X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-20_09,2024-08-19_03,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_active_cloned_notspam policy=outbound_active_cloned score=0 mlxscore=0 bulkscore=0 suspectscore=0 lowpriorityscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 phishscore=0 adultscore=0 malwarescore=0 spamscore=0 mlxlogscore=761 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2408200090 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: newlib-bounces~patchwork=sourceware.org@sourceware.org From: Alexey Brodkin There's no semantic change, it's only to make the same code compilable with MetaWare toolchian, which actually assumes @x as a full name, not omitting @. Signed-off-by: Alexey Brodkin --- libgloss/arc/crt0.S | 46 +++++++++++++------------- libgloss/arc/gcrt0.S | 2 +- newlib/libc/machine/arc/memcpy-archs.S | 34 +++++++++---------- newlib/libc/machine/arc/strcmp-archs.S | 2 +- 4 files changed, 42 insertions(+), 42 deletions(-) diff --git a/libgloss/arc/crt0.S b/libgloss/arc/crt0.S index 36b9c250a..04fe82d7e 100644 --- a/libgloss/arc/crt0.S +++ b/libgloss/arc/crt0.S @@ -106,11 +106,11 @@ IVT_ENTRY(IRQ_20) ; 20 0x50 80 #ifdef __ARC601__ ; Startup code for the ARC601 processor __start: - mov gp, @__SDATA_BEGIN__ - mov sp, @__stack_top ; Point to top of stack + mov gp, __SDATA_BEGIN__ + mov sp, __stack_top ; Point to top of stack mov r5, 0 ; Zero value - mov_s r2, @__sbss_start ; r2 = start of the bss section - sub r3, @_end, r2 ; r3 = size of the bss section in bytes + mov_s r2, __sbss_start ; r2 = start of the bss section + sub r3, _end, r2 ; r3 = size of the bss section in bytes asr_s r3, r3 asr_s r3, r3 ; r3 = size of bss in words @@ -144,11 +144,11 @@ __start: #if defined (__ARC_CODE_DENSITY__) ;; Initialize jli_base - sr @__JLI_TABLE__,[jli_base] + sr __JLI_TABLE__,[jli_base] #endif - mov gp, @__SDATA_BEGIN__ - mov_s r2, @__sbss_start ; r2 = start of the bss section - sub r3, @_end, r2 ; r3 = size of the bss section in bytes + mov gp, __SDATA_BEGIN__ + mov_s r2, __sbss_start ; r2 = start of the bss section + sub r3, _end, r2 ; r3 = size of the bss section in bytes ; set up the loop counter register to the size (in words) of the bss section #if defined (__ARC_BARREL_SHIFTER__) asr.f lp_count, r3, 2 @@ -158,19 +158,19 @@ __start: #endif #if defined (__ARC600__) ; loop to zero out the bss. Enter loop only if lp_count != 0 - lpnz @.Lend_zbss + lpnz .Lend_zbss add r3, pcl, 20 sr r3, [2] ; LP_END ; initialize stack pointer, and this instruction has 2 words - mov sp, @__stack_top + mov sp, __stack_top mov_s r3, 0 st.ab r3, [r2, 4] ; zero out the word .Lend_zbss: #else - mov sp, @__stack_top ; initialize stack pointer + mov sp, __stack_top ; initialize stack pointer mov_s r3,0 ; loop to zero out the bss. Enter loop only if lp_count != 0 - lpnz @.Lend_zbss + lpnz .Lend_zbss st.ab r3,[r2, 4] ; zero out the word nop .Lend_zbss: @@ -220,30 +220,30 @@ __start: #endif /* ARCv2 */ ;; Call constructors - jl @_init + jl _init ;;; Setup fini routines to be called from exit - mov_s r0, @_fini - jl @atexit + mov_s r0, _fini + jl atexit #ifdef PROFILE_SUPPORT /* Defined in gcrt0.S. */ - mov r0,@__start - mov r1,@_etext - jl @_monstartup + mov r0,__start + mov r1,_etext + jl _monstartup #endif /* PROFILE_SUPPORT */ ; branch to main mov fp,0 ; initialize frame pointer - jl @__setup_argv_and_call_main + jl __setup_argv_and_call_main #ifdef PROFILE_SUPPORT mov r13, r0 ; Save return code - jl @_mcleanup + jl _mcleanup mov r0, r13 #endif /* PROFILE_SUPPORT */ ; r0 contains exit code - j @exit + j exit .size __start, .-__start ;;; arc-main-helper.o object can be used to replace this function and @@ -258,7 +258,7 @@ __setup_argv_and_call_main: ; Call main with argc = 0 and *argv[] = 0 mov r0, 0 mov r1, 0 - jl @main + jl main pop_s blink j_s [blink] @@ -275,5 +275,5 @@ _exit_halt: nop nop #endif - b @_exit_halt + b _exit_halt .align 4 diff --git a/libgloss/arc/gcrt0.S b/libgloss/arc/gcrt0.S index 0ce6b63cd..0526b99f3 100644 --- a/libgloss/arc/gcrt0.S +++ b/libgloss/arc/gcrt0.S @@ -58,7 +58,7 @@ __mcount: push r11 push r12 mov r0,blink - jl @_mcount_internal + jl _mcount_internal pop r12 pop r11 pop r10 diff --git a/newlib/libc/machine/arc/memcpy-archs.S b/newlib/libc/machine/arc/memcpy-archs.S index 3c477a745..e8a2a7e03 100644 --- a/newlib/libc/machine/arc/memcpy-archs.S +++ b/newlib/libc/machine/arc/memcpy-archs.S @@ -95,12 +95,12 @@ ENTRY (memcpy) ; if size <= 8 cmp r2, 8 - bls.d @.Lsmallchunk + bls.d .Lsmallchunk mov.f lp_count, r2 and.f r4, r0, 0x03 rsub lp_count, r4, 4 - lpnz @.Laligndestination + lpnz .Laligndestination ; LOOP BEGIN ldb.ab r5, [r1,1] sub r2, r2, 1 @@ -109,12 +109,12 @@ ENTRY (memcpy) ; Check the alignment of the source and.f r4, r1, 0x03 - bnz.d @.Lsourceunaligned + bnz.d .Lsourceunaligned ; CASE 0: Both source and destination are 32bit aligned ; Convert len to Dwords, unfold x4 lsr.f lp_count, r2, ZOLSHFT - lpnz @.Lcopy32_64bytes + lpnz .Lcopy32_64bytes ; LOOP START LOADX (r6, r1) PREFETCH_READ (r1) @@ -130,7 +130,7 @@ ENTRY (memcpy) and.f lp_count, r2, ZOLAND ;Last remaining 31 bytes .Lsmallchunk: - lpnz @.Lcopyremainingbytes + lpnz .Lcopyremainingbytes ; LOOP START ldb.ab r5, [r1,1] stb.ab r5, [r3,1] @@ -141,10 +141,10 @@ ENTRY (memcpy) .Lsourceunaligned: cmp r4, 2 - beq.d @.LunalignedOffby2 + beq.d .LunalignedOffby2 sub r2, r2, 1 - bhi.d @.LunalignedOffby3 + bhi.d .LunalignedOffby3 ldb.ab r5, [r1, 1] ; CASE 1: The source is unaligned, off by 1 @@ -159,7 +159,7 @@ ENTRY (memcpy) or r5, r5, r6 ; Both src and dst are aligned - lpnz @.Lcopy8bytes_1 + lpnz .Lcopy8bytes_1 ; LOOP START ld.ab r6, [r1, 4] prefetch [r1, 28] ;Prefetch the next read location @@ -186,7 +186,7 @@ ENTRY (memcpy) stb.ab r5, [r3, 1] and.f lp_count, r2, 0x07 ;Last 8bytes - lpnz @.Lcopybytewise_1 + lpnz .Lcopybytewise_1 ; LOOP START ldb.ab r6, [r1,1] stb.ab r6, [r3,1] @@ -204,7 +204,7 @@ ENTRY (memcpy) #ifdef __BIG_ENDIAN__ asl.nz r5, r5, 16 #endif - lpnz @.Lcopy8bytes_2 + lpnz .Lcopy8bytes_2 ; LOOP START ld.ab r6, [r1, 4] prefetch [r1, 28] ;Prefetch the next read location @@ -229,7 +229,7 @@ ENTRY (memcpy) sth.ab r5, [r3, 2] and.f lp_count, r2, 0x07 ;Last 8bytes - lpnz @.Lcopybytewise_2 + lpnz .Lcopybytewise_2 ; LOOP START ldb.ab r6, [r1,1] stb.ab r6, [r3,1] @@ -246,7 +246,7 @@ ENTRY (memcpy) #ifdef __BIG_ENDIAN__ asl.ne r5, r5, 24 #endif - lpnz @.Lcopy8bytes_3 + lpnz .Lcopy8bytes_3 ; LOOP START ld.ab r6, [r1, 4] prefetch [r1, 28] ;Prefetch the next read location @@ -271,7 +271,7 @@ ENTRY (memcpy) stb.ab r5, [r3, 1] and.f lp_count, r2, 0x07 ;Last 8bytes - lpnz @.Lcopybytewise_3 + lpnz .Lcopybytewise_3 ; LOOP START ldb.ab r6, [r1,1] stb.ab r6, [r3,1] @@ -294,12 +294,12 @@ ENTRY(memcpy) ;;; if size <= 8 cmp r2, 8 - bls.d @.Lsmallchunk + bls.d .Lsmallchunk mov.f lp_count, r2 ;;; Convert len to Dwords, unfold x4 lsr.f lp_count, r2, ZOLSHFT - lpnz @.Lcopyfast + lpnz .Lcopyfast ;; LOOP START LOADX (r6, r1) PREFETCH_READ (r1) @@ -316,7 +316,7 @@ ENTRY(memcpy) #ifdef __ARC_LL64__ and r2, r2, ZOLAND ;Remaining 31 bytes lsr.f lp_count, r2, 3 ;Convert to 64-bit words. - lpnz @.Lcopy64b + lpnz .Lcopy64b ;; LOOP START ldd.ab r6,[r1,8] std.ab r6,[r3,8] @@ -328,7 +328,7 @@ ENTRY(memcpy) #endif .Lsmallchunk: - lpnz @.Lcopyremainingbytes + lpnz .Lcopyremainingbytes ;; LOOP START ldb.ab r5, [r1,1] stb.ab r5, [r3,1] diff --git a/newlib/libc/machine/arc/strcmp-archs.S b/newlib/libc/machine/arc/strcmp-archs.S index 543cebc4e..3226c377f 100644 --- a/newlib/libc/machine/arc/strcmp-archs.S +++ b/newlib/libc/machine/arc/strcmp-archs.S @@ -40,7 +40,7 @@ ENTRY (strcmp) or r2, r0, r1 bmsk_s r2, r2, 1 - brne r2, 0, @.Lcharloop + brne r2, 0, .Lcharloop ; s1 and s2 are word aligned ld.ab r2, [r0, 4] From patchwork Tue Aug 20 12:10:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuriy Kolerov X-Patchwork-Id: 96146 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DC152384514B for ; Tue, 20 Aug 2024 12:12:20 +0000 (GMT) X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from mx0b-00230701.pphosted.com (mx0b-00230701.pphosted.com [148.163.158.9]) by sourceware.org (Postfix) with ESMTPS id 042A33846456 for ; Tue, 20 Aug 2024 12:11:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 042A33846456 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=synopsys.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=synopsys.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 042A33846456 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.158.9 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724155897; cv=none; b=lWCvM0xLNd/TkQbKvrSNqP1DIQWDd+KcI/lwXnF/lRhrs7qt2pDPf/XIbfK83RaiPsyqB1VrimVyURq45WxgrfwvEEN//Y0/iGKI1SKxIdCF/9+XdNKzJu+qMqXKC5PZQhIlPqwRfZnBZDyhnFsfgCmGNIG9G0jXtG22HO8QbKU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724155897; c=relaxed/simple; bh=suA0kDJVWh1SQLV8vbMIrmf7QSQnRO2e5ftIT0doPFk=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-Id: MIME-Version; b=Q2/jd7jSG6ejAvPz5CEGb1XFyq1N4xrWxbFfEaS1cNt8pjrbAbWFNmzO+ZDSql50vkqgE7dSW5gs9db6fllSUhLHzKNtSaoyRnHPfrCQq43exSGUqUPFaSm/jVZLtXmNDc31+snrjm/1dHJ1fcuZyhrfWTWgH5nZB36tWdJHLCY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0098572.ppops.net [127.0.0.1]) by mx0b-00230701.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47KBaLGE007947 for ; Tue, 20 Aug 2024 05:11:33 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pfptdkimsnps; bh=izM9JTv5 COhUOR45K/LFGcQ3rc8NS/06eJD4HgdsCMQ=; b=LEoTk4BIcRqwRpDh0tkognIg oqisct1sK7+lV4KCzgHiqdKrcNvGCk+DomXswE4UdQUblGDqiHLl4ZNiUc5VrOh3 CPLlFH8ovdUC6XsDbms35mGj/2KiE/iIL6rZfTaxVJPc9jW2vQmcmYyZNZHlvCz+ 6MGNgOrDHkKm43PA3/klfjukEpjeqHv8htoKypluCwl95w4e624+3BwUW6eb9LP5 sFM51FvFq2AeU1NsfIuN7oWxDeNrIEmM5DI0vtMuuD09yL80dYsaFMldS+Ve3PtW TNSp7L6NzQ4Tqb1+objstcUDS3AB9ZVm0VM1Lj3yB7buQj0oQ/fxl1Z3LNIi3g== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.73.133]) by mx0b-00230701.pphosted.com (PPS) with ESMTPS id 414g8k2rct-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 20 Aug 2024 05:11:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1724155892; bh=suA0kDJVWh1SQLV8vbMIrmf7QSQnRO2e5ftIT0doPFk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RbVkoALQr98HNE1F4xGEYvagMOxyDGsHxj7powLCwnl1MsWGahZ9+0C2TeyNOH9GE Le71okErmZpXkTxmqzXNlNxmbLoXNmUFc37hIVuU/MpjQArG2sm4gVWWdudB8ktth7 faogIFAnLCpt3m1JGBe2pO1B7W+phWF1ZMsML7s+Y6+I0orNyK1d1MH13ccVOlmLRg QQM5aJBnaKqZ7l+YfFNmNEYgy3kl6YEahUlVC6JGJ432NuU8XojiufkBsKqrpHPIma arsguybfh1SOOltZXU43sXln6DqUEjLfgDOpNg9MDo4INp6D5vQXhticI7+g/Or3+e UVpN1X/JNQHKQ== Received: from mailhost.synopsys.com (eudc-mailhost2.synopsys.com [10.213.161.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) client-signature RSA-PSS (2048 bits)) (Client CN "mailhost.synopsys.com", Issuer "SNPSica2" (verified OK)) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 3373540175 for ; Tue, 20 Aug 2024 12:11:32 +0000 (UTC) Received: from SNPS-HRlPxd6IgG.internal.synopsys.com (snps-hrlpxd6igg.internal.synopsys.com [10.120.15.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by mailhost.synopsys.com (Postfix) with ESMTPSA id ABD73C048C; Tue, 20 Aug 2024 12:11:30 +0000 (UTC) X-SNPS-Relay: synopsys.com From: Yuriy.Kolerov@synopsys.com To: newlib@sourceware.org Cc: Alexey Brodkin Subject: [PATCH 6/8] arc: libgloss: Accommodate MetaWare's standard symbol names Date: Tue, 20 Aug 2024 15:10:41 +0300 Message-Id: <20240820121043.1605628-7-ykolerov@synopsys.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240820121043.1605628-1-ykolerov@synopsys.com> References: <20240820121043.1605628-1-ykolerov@synopsys.com> MIME-Version: 1.0 X-Authority-Analysis: v=2.4 cv=bpgeB1ai c=1 sm=1 tr=0 ts=66c487f5 cx=c_pps a=8EbXvwLXkpGsT4ql/pYRAw==:117 a=8EbXvwLXkpGsT4ql/pYRAw==:17 a=yoJbH4e0A30A:10 a=jIQo8A4GAAAA:8 a=jE0oYVVNUc63e_m2cnQA:9 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-GUID: eOxPoDIDba_2mtlu51doE0WUtaymlMXy X-Proofpoint-ORIG-GUID: eOxPoDIDba_2mtlu51doE0WUtaymlMXy X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-20_09,2024-08-19_03,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_active_cloned_notspam policy=outbound_active_cloned score=0 suspectscore=0 impostorscore=0 spamscore=0 lowpriorityscore=0 phishscore=0 adultscore=0 clxscore=1015 priorityscore=1501 mlxlogscore=849 malwarescore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2408200090 X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: newlib-bounces~patchwork=sourceware.org@sourceware.org From: Alexey Brodkin It makes it usable with standard symbol names defined in default linker scripts of the MetaWare toolchain. Signed-off-by: Alexey Brodkin --- libgloss/arc/arc-specific.h | 32 ++++++++++++++++++++++++++ libgloss/arc/arc-symbols.h | 40 +++++++++++++++++++++++++++++++++ libgloss/arc/arc-timer.c | 18 ++++++++------- libgloss/arc/crt0.S | 20 +++++++++-------- libgloss/arc/emsk-uart-setup.c | 3 ++- libgloss/arc/iotdk-uart-setup.c | 3 ++- libgloss/arc/sbrk.c | 9 ++++---- libgloss/arc/uart-8250.c | 5 +++-- 8 files changed, 105 insertions(+), 25 deletions(-) create mode 100644 libgloss/arc/arc-specific.h create mode 100644 libgloss/arc/arc-symbols.h diff --git a/libgloss/arc/arc-specific.h b/libgloss/arc/arc-specific.h new file mode 100644 index 000000000..01f215a8e --- /dev/null +++ b/libgloss/arc/arc-specific.h @@ -0,0 +1,32 @@ +/* + * arc-specific.h -- provide ARC-specific definitions + * + * Copyright (c) 2024 Synopsys Inc. + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + * + */ + +#ifndef _ARC_SPECIFIC_H +#define _ARC_SPECIFIC_H + +/* First check for MetaWare compiler as it also defines __GNUC__. */ +#if defined (__CCAC__) + #define read_aux_reg(r) _lr(r) + #define write_aux_reg(r, v) _sr((unsigned int)(v), r) +#elif defined (__GNUC__) + #define read_aux_reg(r) __builtin_arc_lr(r) + #define write_aux_reg(v, r) __builtin_arc_sr((unsigned int)(v), r) +#else + #error "Unexpected compiler" +#endif + +#endif /* _ARC_SPECIFIC_H */ diff --git a/libgloss/arc/arc-symbols.h b/libgloss/arc/arc-symbols.h new file mode 100644 index 000000000..a41ee3953 --- /dev/null +++ b/libgloss/arc/arc-symbols.h @@ -0,0 +1,40 @@ +/* + * arc-symbols.h -- provide ARC-specific symbols + * + * Copyright (c) 2024 Synopsys Inc. + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + * + */ + +#ifndef _ARC_SYMBOLS_H +#define _ARC_SYMBOLS_H + +/* First check for MetaWare compiler as it also defines __GNUC__. */ +#if defined (__CCAC__) + #define STACK_TOP _estack + #define SMALL_DATA_BASE _SDA_BASE_ + #define SMALL_DATA_BSS_START _fsbss + #define SMALL_DATA_BSS_END _esbss + #define START_HEAP _fheap + #define END_HEAP _eheap +#elif defined (__GNUC__) + #define STACK_TOP __stack_top + #define SMALL_DATA_BASE __SDATA_BEGIN__ + #define SMALL_DATA_BSS_START __sbss_start + #define SMALL_DATA_BSS_END _end + #define START_HEAP __start_heap + #define END_HEAP __end_heap +#else + #error "Unexpected compiler" +#endif + +#endif /* _ARC_SYMBOLS_H */ \ No newline at end of file diff --git a/libgloss/arc/arc-timer.c b/libgloss/arc/arc-timer.c index 2437407e7..0d3074d5a 100644 --- a/libgloss/arc/arc-timer.c +++ b/libgloss/arc/arc-timer.c @@ -15,6 +15,8 @@ * */ +#include "arc-specific.h" + #define ARC_TIM_BUILD 0x75 #define ARC_TIM_BUILD_VER_MASK 0x00FF #define ARC_TIM_BUILD_TIM0_FL 0x0100 @@ -37,7 +39,7 @@ const unsigned int arc_timer_default = 0; static int _arc_timer_present (unsigned int tim) { - unsigned int bcr = __builtin_arc_lr (ARC_TIM_BUILD); + unsigned int bcr = read_aux_reg (ARC_TIM_BUILD); unsigned int ver = bcr & ARC_TIM_BUILD_VER_MASK; if (ver == 0) @@ -59,9 +61,9 @@ _arc_timer_read (unsigned int tim) if (_arc_timer_present (tim)) { if (tim == 0) - return __builtin_arc_lr (ARC_TIM_COUNT0); + return read_aux_reg (ARC_TIM_COUNT0); else if (tim == 1) - return __builtin_arc_lr (ARC_TIM_COUNT1); + return read_aux_reg (ARC_TIM_COUNT1); } return 0; @@ -95,14 +97,14 @@ _arc_timer_reset (unsigned int tim) return; } - ctrl = __builtin_arc_lr (tim_control); + ctrl = read_aux_reg (tim_control); /* Disable timer interrupt when programming. */ - __builtin_arc_sr (0, tim_control); + write_aux_reg (0, tim_control); /* Default limit is 24-bit, increase it to 32-bit. */ - __builtin_arc_sr (0xFFFFFFFF, tim_limit); + write_aux_reg (0xFFFFFFFF, tim_limit); /* Set NH bit to count only when processor is running. */ - __builtin_arc_sr (ctrl | ARC_TIM_CONTROL_NH_FL, tim_control); - __builtin_arc_sr (0, tim_count); + write_aux_reg (ctrl | ARC_TIM_CONTROL_NH_FL, tim_control); + write_aux_reg (0, tim_count); } } diff --git a/libgloss/arc/crt0.S b/libgloss/arc/crt0.S index 04fe82d7e..a64599eaa 100644 --- a/libgloss/arc/crt0.S +++ b/libgloss/arc/crt0.S @@ -41,6 +41,8 @@ the initialization code. */ +#include "arc-symbols.h" + /* Compatibility with older ARC GCC, that doesn't provide some of the preprocessor defines used by newlib and libgloss for ARC. */ #if defined (__Xbarrel_shifter) && !defined (__ARC_BARREL_SHIFTER__) @@ -106,11 +108,11 @@ IVT_ENTRY(IRQ_20) ; 20 0x50 80 #ifdef __ARC601__ ; Startup code for the ARC601 processor __start: - mov gp, __SDATA_BEGIN__ - mov sp, __stack_top ; Point to top of stack + mov gp, SMALL_DATA_BASE + mov sp, STACK_TOP ; Point to top of stack mov r5, 0 ; Zero value - mov_s r2, __sbss_start ; r2 = start of the bss section - sub r3, _end, r2 ; r3 = size of the bss section in bytes + mov_s r2, SMALL_DATA_BSS_START ; r2 = start of the bss section + sub r3, SMALL_DATA_BSS_START, r2 ; r3 = size of the bss section in bytes asr_s r3, r3 asr_s r3, r3 ; r3 = size of bss in words @@ -146,9 +148,9 @@ __start: ;; Initialize jli_base sr __JLI_TABLE__,[jli_base] #endif - mov gp, __SDATA_BEGIN__ - mov_s r2, __sbss_start ; r2 = start of the bss section - sub r3, _end, r2 ; r3 = size of the bss section in bytes + mov gp, SMALL_DATA_BASE + mov_s r2, SMALL_DATA_BSS_START ; r2 = start of the bss section + sub r3, SMALL_DATA_BSS_END, r2 ; r3 = size of the bss section in bytes ; set up the loop counter register to the size (in words) of the bss section #if defined (__ARC_BARREL_SHIFTER__) asr.f lp_count, r3, 2 @@ -162,12 +164,12 @@ __start: add r3, pcl, 20 sr r3, [2] ; LP_END ; initialize stack pointer, and this instruction has 2 words - mov sp, __stack_top + mov sp, STACK_TOP mov_s r3, 0 st.ab r3, [r2, 4] ; zero out the word .Lend_zbss: #else - mov sp, __stack_top ; initialize stack pointer + mov sp, STACK_TOP ; initialize stack pointer mov_s r3,0 ; loop to zero out the bss. Enter loop only if lp_count != 0 lpnz .Lend_zbss diff --git a/libgloss/arc/emsk-uart-setup.c b/libgloss/arc/emsk-uart-setup.c index b8e1ea859..16b5f7b38 100644 --- a/libgloss/arc/emsk-uart-setup.c +++ b/libgloss/arc/emsk-uart-setup.c @@ -15,6 +15,7 @@ * */ +#include "arc-specific.h" #include "uart-8250.h" /* Setup UART parameters. */ @@ -22,7 +23,7 @@ int _setup_low_level (void) { const uint32_t aux_dmp_per = 0x20a; - void * const uart_base = (char *)__builtin_arc_lr(aux_dmp_per) + 0x00009000; + void * const uart_base = (char *)read_aux_reg(aux_dmp_per) + 0x00009000; const int uart_aux_mapped = 0; const uint32_t uart_clock = 50000000; const uint32_t uart_baud = 115200; diff --git a/libgloss/arc/iotdk-uart-setup.c b/libgloss/arc/iotdk-uart-setup.c index e6d2ac887..a7b1183b8 100644 --- a/libgloss/arc/iotdk-uart-setup.c +++ b/libgloss/arc/iotdk-uart-setup.c @@ -15,6 +15,7 @@ * */ +#include "arc-specific.h" #include "uart-8250.h" /* Setup UART parameters. */ @@ -28,7 +29,7 @@ _setup_low_level (void) const uint32_t uart_baud = 115200; /* For this platform we have to enable UART clock before configuring it. */ - __builtin_arc_sr (0x01, (uint32_t) uart_base + uart_clk_ena); + write_aux_reg (0x01, (uint32_t) uart_base + uart_clk_ena); _uart_8250_setup (uart_base, uart_aux_mapped, uart_clock, uart_baud); diff --git a/libgloss/arc/sbrk.c b/libgloss/arc/sbrk.c index 8cb8461dd..2a83a5ac9 100644 --- a/libgloss/arc/sbrk.c +++ b/libgloss/arc/sbrk.c @@ -30,9 +30,10 @@ #include #include +#include "arc-symbols.h" -extern char __start_heap; -extern char __end_heap; +extern char START_HEAP; +extern char END_HEAP; caddr_t _sbrk (size_t nbytes) @@ -42,7 +43,7 @@ _sbrk (size_t nbytes) if (heap_ptr == NULL) { - heap_ptr = &__start_heap; + heap_ptr = &START_HEAP; } /* Align the 'heap_ptr' so that memory will always be allocated at word @@ -50,7 +51,7 @@ _sbrk (size_t nbytes) heap_ptr = (char *) ((((unsigned long) heap_ptr) + 7) & ~7); prev_heap_ptr = heap_ptr; - if ((heap_ptr + nbytes) < &__end_heap) + if ((heap_ptr + nbytes) < &END_HEAP) { heap_ptr += nbytes; return (caddr_t) prev_heap_ptr; diff --git a/libgloss/arc/uart-8250.c b/libgloss/arc/uart-8250.c index 6f4e9f3d6..fd9c55fc4 100644 --- a/libgloss/arc/uart-8250.c +++ b/libgloss/arc/uart-8250.c @@ -20,6 +20,7 @@ #include #include #include +#include "arc-specific.h" /* * List of UART 8250 registers with offsets: @@ -144,7 +145,7 @@ _uart_8250_write_reg (const struct _uart_8250 *uart, uint32_t reg, uint32_t value) { if (uart->aux_mapped) - __builtin_arc_sr (value, (uint32_t) uart->base + reg); + write_aux_reg (value, (uint32_t) uart->base + reg); else *(volatile uint32_t *)(uart->base + reg) = value; } @@ -154,7 +155,7 @@ static inline uint32_t _uart_8250_read_reg (const struct _uart_8250 *uart, uint32_t reg) { if (uart->aux_mapped) - return __builtin_arc_lr ((uint32_t) uart->base + reg); + return read_aux_reg ((uint32_t) uart->base + reg); else return *(volatile uint32_t *)(uart->base + reg); } From patchwork Tue Aug 20 12:10:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuriy Kolerov X-Patchwork-Id: 96147 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 63F61386D606 for ; Tue, 20 Aug 2024 12:12:30 +0000 (GMT) X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from mx0b-00230701.pphosted.com (mx0b-00230701.pphosted.com [148.163.158.9]) by sourceware.org (Postfix) with ESMTPS id 621D73846093 for ; Tue, 20 Aug 2024 12:11:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 621D73846093 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=synopsys.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=synopsys.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 621D73846093 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.158.9 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724155897; cv=none; b=IJTvPGihkQH6gY3HEQgpwejR9rnMOaem69mfNKnZ1n+MQ4sfCHxvfTYnlZh0ClovzKgVoju3kMJYXqKA/oE7naDRxuFLV27E7feHaIpWdjdyc+vbTn/64totAb1HMj8DUo7FZFOl8Uj5fAE8ZqrQ+niFJx3Nj8KRAe/cpezqq3A= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724155897; c=relaxed/simple; bh=Tr9/lmsXy2564JjZ1U7hODrEZbBpB6jN9sD8tqkR5nY=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-Id: MIME-Version; b=FLIP7vnJDGYjhFLmftBb3VG+zjOVUWEfkk6uy0LSytG0EY5ex/5AEGKDYYly9SZYN1zZxTbsoz2GVNytNS7HvBEe20ODoPRDaQxtGpDuiGOXTborI3YYWw0jEvm1cfFyXvkfIo/ldbyuPxUXKlNVQqvmmaV5mafTTT6i7+J2HHU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0297265.ppops.net [127.0.0.1]) by mx0a-00230701.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47KBaTJd020413 for ; Tue, 20 Aug 2024 05:11:34 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pfptdkimsnps; bh=0r5KdzM5 KYnx3VfRXTjDDRqeQzgcdIwWzXb8iPRRyCE=; b=b9kXK1xCl5kjR69CRHpxK1Is Xggv/njB+wC54FN9cAA02AgEPtxe6P71MibsWkNeTKHx4EkVNSiBhdyg9l87UNzO JQ11HBn6v10FtZXxt82CE82SOGOz7xQAV5XR8E6ENZnzi6dvhJno6VioGmeefJV2 Bbsv6eK8ogQeSHWEp8Dh/uMy1Kt6/fAQ8+quqVs4jHM8Bv+BAZpkU3wppWQqaI6B eFPuNuhZHNWibyenXh94Q09ZAD50can/URE8vllz2S62rSNcaVb9ydFC5u6NaU1M L1k71YRiwaPO5Pselt5MEt4Vqnzl/0tIWdj84vJAKcT76BoHAVL47aRKlPfabQ== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.73.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 414g8mapvs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 20 Aug 2024 05:11:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1724155892; bh=Tr9/lmsXy2564JjZ1U7hODrEZbBpB6jN9sD8tqkR5nY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZfT276WEHFIOth6OZ+uWCDaew5mV9i81SnSpn/fWfD5myo08LVwyGZVgM/Ho58Ssa iNBSnqWuV9wG1X9TByM+SnX2G0x7zBXbY7RkqARCN8keZxS12EBcoFHZpyvZPI7tC1 9EovNL8tVlJSK1VQxmVile6/ePG2w24ph5fNT+8UWa+9hKNtlpFLaWJqAw37h/xng4 XjDpCfnFFnzmhOT5zYEMxIGYvZiy4eonqnWl97AkVWc9OmZ6HeI8odaxXBIoUFtrmJ KTVMc3mRi7cV3Y9NWG/FKD02NDjVhluFkhtO0QOtqsPRkg57x4tl6J9EZh9Z58M/WF UH9DJWSZbSJfw== Received: from mailhost.synopsys.com (eudc-mailhost2.synopsys.com [10.213.161.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) client-signature RSA-PSS (2048 bits)) (Client CN "mailhost.synopsys.com", Issuer "SNPSica2" (verified OK)) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id A496940540 for ; Tue, 20 Aug 2024 12:11:32 +0000 (UTC) Received: from SNPS-HRlPxd6IgG.internal.synopsys.com (snps-hrlpxd6igg.internal.synopsys.com [10.120.15.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by mailhost.synopsys.com (Postfix) with ESMTPSA id 3B247C0B82; Tue, 20 Aug 2024 12:11:31 +0000 (UTC) X-SNPS-Relay: synopsys.com From: Yuriy.Kolerov@synopsys.com To: newlib@sourceware.org Cc: Yuriy Kolerov Subject: [PATCH 7/8] arc: libgloss: Use exit code in _exit_halt for nSIM Date: Tue, 20 Aug 2024 15:10:42 +0300 Message-Id: <20240820121043.1605628-8-ykolerov@synopsys.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240820121043.1605628-1-ykolerov@synopsys.com> References: <20240820121043.1605628-1-ykolerov@synopsys.com> MIME-Version: 1.0 X-Authority-Analysis: v=2.4 cv=HYFGTTE8 c=1 sm=1 tr=0 ts=66c487f5 cx=c_pps a=8EbXvwLXkpGsT4ql/pYRAw==:117 a=8EbXvwLXkpGsT4ql/pYRAw==:17 a=yoJbH4e0A30A:10 a=jIQo8A4GAAAA:8 a=b-Oql6b1aL_PulTl3gEA:9 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-GUID: tClDn4Mhe0uTDqPONXA1aMaJ28R7KH6O X-Proofpoint-ORIG-GUID: tClDn4Mhe0uTDqPONXA1aMaJ28R7KH6O X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-20_09,2024-08-19_03,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_active_cloned_notspam policy=outbound_active_cloned score=0 clxscore=1015 priorityscore=1501 malwarescore=0 phishscore=0 bulkscore=0 impostorscore=0 spamscore=0 mlxscore=0 mlxlogscore=943 suspectscore=0 lowpriorityscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2408200090 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: newlib-bounces~patchwork=sourceware.org@sourceware.org From: Yuriy Kolerov nSIM simulator supports exit codes. However, it's necessary to pass an exit code to _exit_halt, otherwise it's undefined. Signed-off-by: Yuriy Kolerov --- libgloss/arc/nsim-syscalls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libgloss/arc/nsim-syscalls.c b/libgloss/arc/nsim-syscalls.c index 80747e95d..807f95cd0 100644 --- a/libgloss/arc/nsim-syscalls.c +++ b/libgloss/arc/nsim-syscalls.c @@ -100,7 +100,7 @@ _open (const char * pathname, int flags, int mode) } /* Should be provided by crt0.S. */ -extern void __attribute__((noreturn, long_call)) _exit_halt (); +extern void __attribute__((noreturn, long_call)) _exit_halt (int ret); void __attribute__((noreturn)) @@ -109,7 +109,7 @@ _exit (int ret) /* Doing an "exit" system call would work on nSIM with hostlink, but call to _exit_halt, which will do a CPU halt is more universal and will work in many other cases as well, including an FPGA/SoC. */ - _exit_halt (); + _exit_halt (ret); } /* This is a copy of newlib/libc/posix/_isatty.c. It is needed because nSIM From patchwork Tue Aug 20 12:10:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuriy Kolerov X-Patchwork-Id: 96152 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C5ACA38449C8 for ; Tue, 20 Aug 2024 12:13:32 +0000 (GMT) X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from mx0b-00230701.pphosted.com (mx0b-00230701.pphosted.com [148.163.158.9]) by sourceware.org (Postfix) with ESMTPS id E9AFD384A47F for ; Tue, 20 Aug 2024 12:11:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E9AFD384A47F Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=synopsys.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=synopsys.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E9AFD384A47F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.158.9 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724155897; cv=none; b=gsv83HuNcFOOixYLIsfEl7CfRCSa9XWxswilQKGRpA24S2UOKjXZ8ve6VeU0TFAi6CX6ygJwkociuHtu02F41VKhpDu2Lo7UkcEmN8pDU3A5bZ7kMSk72Ge3B4wG30YqD7DRYuf5gpw7tItXowEq7P5CVS8mFb3y/K1NCpRq0So= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724155897; c=relaxed/simple; bh=+o6av86t0JFeJLlmiDAHY0C1D5iyM9MIFwVwPUcE1OY=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-Id: MIME-Version; b=j8n8whcJV1vPMW5ZMcrPYxoJiIHic8NwxS7ppf8fHG3GAico7QcqV6l0bDM1zxnTBUHXcPDTvwkcKt9iYOm30eu3ON3wLVBnENSdgefPqqlx2Wn5Gx6BiAmncbFrWqYjwOc+GVMhtPyVYOQoLv+LVloKVz5iOaw6MfoZ5lCOPc4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0098572.ppops.net [127.0.0.1]) by mx0b-00230701.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47KBaLPq007967 for ; Tue, 20 Aug 2024 05:11:34 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pfptdkimsnps; bh=2YLVfRgO Eu55oi6DkxVgB1wdUmyfqwoUT2EsjE96pnw=; b=BYjU4KCs3jKwlqatHG0MkhYB v6FCAmYcLOqD1NFHmSSfYq+8QwWgFX3PhdUqGbpWzOow1PGnr4SjvXeoLorvxlQD 0Tlg+VyFqqaoAdGNrBgJv4IaqCAIokl7e6IYf16kA9mxe7rKnSR328re1uuC6vqA 7rOhORJQjJtmsyPGL729zD3j8DW6i7Mjl3NlcT6yYYctIri20sf4YLS1ZoNyTL9f xE9uNd1s45mNOPavHUgqpr82rYnxBH3oLG5abcDEZ48v7Y5dBNRk9agI/17CXH0F D0wlxXvQ7ntLvyA0AYRnOiOScMGFkTwzG2NMHonNaappUSx1LM+0GJGAH/sRmA== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.73.133]) by mx0b-00230701.pphosted.com (PPS) with ESMTPS id 414g8k2rcy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 20 Aug 2024 05:11:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1724155893; bh=+o6av86t0JFeJLlmiDAHY0C1D5iyM9MIFwVwPUcE1OY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a7jJkqPykIkrYJrhmx2/Clt01Ja0U4mUNvaJzuL3Y86ieIXI/X6BQIq/96E2C1ZRu o3fgkyt4z7xk1tTpufyOEAoMBD7YivtopfoIP4f3XvhbYkellKUn4eLAyfoFWFmZvF VTS602Kq+GUMrc9PjHf10LbQCr4oDpguenZusOS9tKw/NMQkqVEQTukz95PvFzaCms z+20N/fF9ERkPJCN5ez46Y+Mkj/fPdqkgJLznkAWpIgm0a6gHboz49jiRJjbKsCKGh B4tPs+fj+AR0LEZkT+AtTMcq1AkC95YmqU/KDX1XeoVllmU7B/+SeICDTOcjiP/iAV BgTUkSQaTxcRg== Received: from mailhost.synopsys.com (eudc-mailhost2.synopsys.com [10.213.161.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) client-signature RSA-PSS (2048 bits)) (Client CN "mailhost.synopsys.com", Issuer "SNPSica2" (verified OK)) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 1DD1D4048B for ; Tue, 20 Aug 2024 12:11:33 +0000 (UTC) Received: from SNPS-HRlPxd6IgG.internal.synopsys.com (snps-hrlpxd6igg.internal.synopsys.com [10.120.15.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by mailhost.synopsys.com (Postfix) with ESMTPSA id AB6D2C0CBA; Tue, 20 Aug 2024 12:11:31 +0000 (UTC) X-SNPS-Relay: synopsys.com From: Yuriy.Kolerov@synopsys.com To: newlib@sourceware.org Cc: Yuriy Kolerov Subject: [PATCH 8/8] arc: libgloss: Prepare for porting to ARCv3 Date: Tue, 20 Aug 2024 15:10:43 +0300 Message-Id: <20240820121043.1605628-9-ykolerov@synopsys.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240820121043.1605628-1-ykolerov@synopsys.com> References: <20240820121043.1605628-1-ykolerov@synopsys.com> MIME-Version: 1.0 X-Authority-Analysis: v=2.4 cv=bpgeB1ai c=1 sm=1 tr=0 ts=66c487f6 cx=c_pps a=8EbXvwLXkpGsT4ql/pYRAw==:117 a=8EbXvwLXkpGsT4ql/pYRAw==:17 a=yoJbH4e0A30A:10 a=jIQo8A4GAAAA:8 a=wcNbVyCmb0o-XqfLdlsA:9 a=OSEWBN1MTu-9z82vAJ5Y:22 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-GUID: PmagYsImtggCbHWosezTvVAfRFw3FLmH X-Proofpoint-ORIG-GUID: PmagYsImtggCbHWosezTvVAfRFw3FLmH X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-20_09,2024-08-19_03,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_active_cloned_notspam policy=outbound_active_cloned score=0 suspectscore=0 impostorscore=0 spamscore=0 lowpriorityscore=0 phishscore=0 adultscore=0 clxscore=1015 priorityscore=1501 mlxlogscore=999 malwarescore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2408200090 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: newlib-bounces~patchwork=sourceware.org@sourceware.org From: Yuriy Kolerov There are 3 families of Synopsys DeisgnWare ARC processors: ARCompact/ARCv1 (32-bit), ARCv2 (32-bit) and ARCv3 (32-bit and 64-bit targets). Upstream Newlib supports only ARCv1/2. This commit prepares ARCv1/2 libgloss port to be reused by ARCv3 port (except crt* files). Note that __ARC64__ macro stands for all ARCv3 targets. Signed-off-by: Yuriy Kolerov --- libgloss/arc/hl-stub.c | 14 ++++++++++++++ libgloss/arc/hl/hl_gw.c | 9 +++++++++ libgloss/arc/hl/hl_toolchain.h | 10 ++++++++++ libgloss/arc/nsim-syscalls.c | 5 +++++ 4 files changed, 38 insertions(+) diff --git a/libgloss/arc/hl-stub.c b/libgloss/arc/hl-stub.c index 7f5b9facc..c4d6ee67b 100644 --- a/libgloss/arc/hl-stub.c +++ b/libgloss/arc/hl-stub.c @@ -15,6 +15,7 @@ * */ +#include #include #include #include @@ -44,6 +45,19 @@ _getpid (void) return __MYPID; } +/* We do not have 64-bit compatible hostlink fstat. */ +#if defined (__ARC64__) +int +_fstat (int fd, struct stat *st) +{ + memset (st, 0, sizeof (*st)); + st->st_mode = S_IFCHR; + st->st_blksize = 1024; + + return 0; +} +#endif + /* hostlink backend has only fstat(), so use fstat() in stat(). */ int diff --git a/libgloss/arc/hl/hl_gw.c b/libgloss/arc/hl/hl_gw.c index f576f097e..4a8f8780f 100644 --- a/libgloss/arc/hl/hl_gw.c +++ b/libgloss/arc/hl/hl_gw.c @@ -15,6 +15,7 @@ * */ +#include #include "hl_gw.h" #define HL_VERSION 1 @@ -134,7 +135,15 @@ _hl_send (volatile __uncached void *p) _hl_pkt_init (pkt_hdr, _hl_payload_used (p)); +#if defined (__ARC64__) + /* + * Here we pass only low 4 bytes of the packet address (pkt_hdr). + * The high part of the address is obtained from __HOSTLINK__ address. + */ + hdr->buf_addr = (uintptr_t) pkt_hdr & 0xFFFFFFFF; +#else hdr->buf_addr = (uint32_t) pkt_hdr; +#endif hdr->payload_size = _hl_payload_size (); hdr->host2target_addr = HL_NOADDRESS; hdr->version = HL_VERSION; diff --git a/libgloss/arc/hl/hl_toolchain.h b/libgloss/arc/hl/hl_toolchain.h index bf884bf3f..946061718 100644 --- a/libgloss/arc/hl/hl_toolchain.h +++ b/libgloss/arc/hl/hl_toolchain.h @@ -19,7 +19,12 @@ #define _HL_TOOLCHAIN_H #ifndef __uncached +#if defined (__ARC64__) + /* TODO: Uncached attribute is not implemented for ARCv3 yet. */ + #define __uncached +#else #define __uncached __attribute__((uncached)) +#endif #endif /* __uncached */ #ifndef __aligned @@ -43,7 +48,12 @@ #endif /* __noreturn */ #ifndef __longcall +#if defined (__ARC64__) + /* TODO: Long call attribute is not implemented for ARCv3 yet. */ + #define __longcall +#else #define __longcall __attribute__((long_call)) +#endif #endif /* __longcall */ #define HL_MAX_DCACHE_LINE 256 diff --git a/libgloss/arc/nsim-syscalls.c b/libgloss/arc/nsim-syscalls.c index 807f95cd0..0a99ad59c 100644 --- a/libgloss/arc/nsim-syscalls.c +++ b/libgloss/arc/nsim-syscalls.c @@ -100,7 +100,12 @@ _open (const char * pathname, int flags, int mode) } /* Should be provided by crt0.S. */ +#if defined (__ARC64__) +/* TODO: long_call is not implemented yet in GCC. Fix this when implemented. */ +extern void __attribute__((noreturn)) _exit_halt (int ret); +#else extern void __attribute__((noreturn, long_call)) _exit_halt (int ret); +#endif void __attribute__((noreturn))