From patchwork Tue Sep 20 02:14:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Kozlov X-Patchwork-Id: 1680018 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=uclibc-ng.org (client-ip=89.238.66.15; helo=helium.openadk.org; envelope-from=devel-bounces@uclibc-ng.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=pfptdkimsnps header.b=fqNyOmIK; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=mail header.b=IoU/0dce; dkim-atps=neutral Received: from helium.openadk.org (helium.openadk.org [89.238.66.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MX0pz55zfz1ypS for ; Tue, 20 Sep 2022 22:14:49 +1000 (AEST) Received: from helium.openadk.org (localhost [IPv6:::1]) by helium.openadk.org (Postfix) with ESMTP id 101CA352077F; Tue, 20 Sep 2022 14:14:40 +0200 (CEST) Authentication-Results: helium.openadk.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=pfptdkimsnps header.b=fqNyOmIK; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=mail header.b=IoU/0dce; dkim-atps=neutral Received: from mx0a-00230701.pphosted.com (mx0a-00230701.pphosted.com [148.163.156.19]) by helium.openadk.org (Postfix) with ESMTPS id 9CAA43520669 for ; Tue, 20 Sep 2022 14:14:35 +0200 (CEST) Received: from pps.filterd (m0297266.ppops.net [127.0.0.1]) by mx0a-00230701.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28K5pYMp027853 for ; Tue, 20 Sep 2022 05:14:33 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pfptdkimsnps; bh=1nqfMExlyC+8RiDLyE5UYvH1MEEpI4g8SATCWCMdDRQ=; b=fqNyOmIK/K/HxN+45Q+VwkgBXFfFvTbmjIhaFfNzDPyf+rUJQ98Rmq2gstyiwoacsE3T 6mYqMFpyUVFHnSCWc6q9q4tLaFqWIzqiJRQGmhXpHY4Azc4TGzIwBdRfOiAYIAUsgEb1 qapj3Tuy5qtzG+GWsx0BN8Ta1oVToHiwkDSFzWoJie7P1pWsZ0gptz0v1xkM8qR0MM14 IzGk5F3ryLcpPSEvbqyfCXETycH+0hJ/JB9QIh7LXjML0KYol2WyPdzmPsANqVHhSdIX RETCt7hjHFXSXbzh8/1v7CkAiwkgGEpt7JTwRoicEId93AIEc00I+ZvMn4+SgPEHiZr+ tA== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.73.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 3jndg4phkw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 20 Sep 2022 05:14:33 -0700 Received: from mailhost.synopsys.com (mdc-mailhost1.synopsys.com [10.225.0.209]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mailhost.synopsys.com", Issuer "SNPSica2" (verified OK)) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 5E2A8400E5 for ; Tue, 20 Sep 2022 12:14:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1663676073; bh=pK/d8QXIXKT5ihuovMqeqQN3CY6x2PSqGR0r5wOLzE8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IoU/0dceRpx43SKr6HdiVt14BI0J/xUpM8Ffzkv7Q5F2hDjWE0rd2cVbOV9Rkv4ly zwsE4OCcdPXFrFjtwxpFI2e8sOHxWvtW67R1ys+AexozMpsoR7QK/atS2WO9dqijTI TOI/4rPDoFEu+G+Hp64pv2dWjzJVtJvxeOHFNw8mVQWAaiGjKf4D34mRrnivifTBSF hTT7K1xI1A2cPIFphHqc4bjt6fMvqyVUR0yNy1fJ6mKMkCzuVxtIdXqcqNybbjpRuc QFBSAlBySCCBIKQAV9OiPHW++8jEDrX8L+Xgz1XNerUTZyMGvpPgZgXkxei+Bc2uT5 7rjVdvHGqVxWA== Received: from SNPS-o0WHuHJU73.internal.synopsys.com (snps-o0whuhju73.internal.synopsys.com [10.116.108.115]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client did not present a certificate) by mailhost.synopsys.com (Postfix) with ESMTPSA id D2D5EA022E; Tue, 20 Sep 2022 12:14:31 +0000 (UTC) X-SNPS-Relay: synopsys.com From: Pavel.Kozlov@synopsys.com To: devel@uclibc-ng.org Date: Tue, 20 Sep 2022 16:14:20 +0400 Message-Id: <20220920121421.31618-4-kozlov@synopsys.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220920121421.31618-1-kozlov@synopsys.com> References: <20220920121421.31618-1-kozlov@synopsys.com> MIME-Version: 1.0 X-Proofpoint-GUID: OQbnALdUeXCGX5xDD1LR4bMjnpoKzThi X-Proofpoint-ORIG-GUID: OQbnALdUeXCGX5xDD1LR4bMjnpoKzThi X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-20_04,2022-09-16_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_active_cloned_notspam policy=outbound_active_cloned score=0 bulkscore=0 phishscore=0 malwarescore=0 mlxlogscore=658 spamscore=0 suspectscore=0 adultscore=0 impostorscore=0 clxscore=1015 priorityscore=1501 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209200073 Message-ID-Hash: DNYHKYEF3OPJFMUDXPIBDQQSHKIAIYHO X-Message-ID-Hash: DNYHKYEF3OPJFMUDXPIBDQQSHKIAIYHO X-MailFrom: Pavel.Kozlov@synopsys.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Alexey.Brodkin@synopsys.com X-Mailman-Version: 3.3.3 Precedence: list Subject: [uclibc-ng-devel] [PATCH 3/4] arc: add asm macros List-Id: uClibc-ng Development Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Sergey Matyukevich Add a header file with assembler macros to be able to handle in one place the differences between ARCv2 and ARCv3 ISAs. It is a preparatory step before the introduction of support for ARCv3 CPUs. Signed-off-by: Sergey Matyukevich Signed-off-by: Pavel Kozlov --- ldso/ldso/arc/resolve.S | 45 ++++++++++++++++++------------------ libc/sysdeps/linux/arc/asm.h | 28 ++++++++++++++++++++++ 2 files changed, 51 insertions(+), 22 deletions(-) create mode 100644 libc/sysdeps/linux/arc/asm.h diff --git a/ldso/ldso/arc/resolve.S b/ldso/ldso/arc/resolve.S index 891f66b97008..2b66c69cb5db 100644 --- a/ldso/ldso/arc/resolve.S +++ b/ldso/ldso/arc/resolve.S @@ -4,6 +4,7 @@ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball. */ +#include #include #include @@ -12,30 +13,30 @@ ; r10-r12 are already clobbered by PLTn, PLT0 thus neednot be saved .macro SAVE_CALLER_SAVED - push_s r0 - push_s r1 - push_s r2 - push_s r3 - st.a r4, [sp, -4] - st.a r5, [sp, -4] - st.a r6, [sp, -4] - st.a r7, [sp, -4] - st.a r8, [sp, -4] - st.a r9, [sp, -4] - push_s blink + PUSHR_S r0 + PUSHR_S r1 + PUSHR_S r2 + PUSHR_S r3 + PUSHR r4 + PUSHR r5 + PUSHR r6 + PUSHR r7 + PUSHR r8 + PUSHR r9 + PUSHR_S blink .endm .macro RESTORE_CALLER_SAVED_BUT_R0 - ld.ab blink,[sp, 4] - ld.ab r9, [sp, 4] - ld.ab r8, [sp, 4] - ld.ab r7, [sp, 4] - ld.ab r6, [sp, 4] - ld.ab r5, [sp, 4] - ld.ab r4, [sp, 4] - pop_s r3 - pop_s r2 - pop_s r1 + POPR blink + POPR r9 + POPR r8 + POPR r7 + POPR r6 + POPR r5 + POPR r4 + POPR_S r3 + POPR_S r2 + POPR_S r1 .endm ; Upon entry, PLTn, which led us here, sets up the following regs @@ -53,5 +54,5 @@ ENTRY(_dl_linux_resolve) RESTORE_CALLER_SAVED_BUT_R0 j_s.d [r0] ; r0 has resolved function addr - pop_s r0 ; restore first arg to resolved call + POPR_S r0 ; restore first arg to resolved call END(_dl_linux_resolve) diff --git a/libc/sysdeps/linux/arc/asm.h b/libc/sysdeps/linux/arc/asm.h new file mode 100644 index 000000000000..f98eb239fe15 --- /dev/null +++ b/libc/sysdeps/linux/arc/asm.h @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2022, Synopsys, Inc. (www.synopsys.com) + * + * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball. + */ + +#ifndef _ARC_ASM_H +#define _ARC_ASM_H + + +.macro PUSHR reg + push \reg +.endm + +.macro PUSHR_S reg + push_s \reg +.endm + +.macro POPR reg + pop \reg +.endm + +.macro POPR_S reg + pop_s \reg +.endm + + +#endif /* _ARC_ASM_H */