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