From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 257F73858439 for ; Tue, 16 May 2023 11:12:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 257F73858439 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34GAek0N016987 for ; Tue, 16 May 2023 11:12:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : mime-version; s=pp1; bh=sAn89Uncf1WtTegelB1J1+AIUuRYzqMRbtXZGpF/b0c=; b=ex/CJHqfu/MvVDzwZ8unqCLsyTUKoAVIEcLkYipRBjybAiyoRfCO0q+3Uuucad/M8WDR Tl4MRybd4wV8WEd47AYlNk4ZKGpxCy/4UxMn+iPCvp2RuDt2Vy6RbUy5xnzuOTnY6zEU AYuajoQ+spgHHkAonqpoV3bVRbsCkyDmv63ssRv0RTcsG7WhxcvHAGJ201hQLk/mW9Qc mQYNByJUagTRobDifBPrxqXUc/OSJMM1LXrwe23GVAUmOMZnmSV8A5G+fRCT8V6wlPUm YkM1l10H2RR81pJiUNwIWc9SgRxTjf4ZYoLESEBumSBSrSs/ptsW5gjBT/WwSeWUC5Nt UA== Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qm82f14dq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 16 May 2023 11:12:10 +0000 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 34G0lQ1q005719 for ; Tue, 16 May 2023 11:12:08 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma06ams.nl.ibm.com (PPS) with ESMTPS id 3qj1tdsjym-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 16 May 2023 11:12:08 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 34GBC5gd40567052 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 16 May 2023 11:12:05 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E8FC62004B; Tue, 16 May 2023 11:12:04 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3DC1920040; Tue, 16 May 2023 11:12:04 +0000 (GMT) Received: from ltcd97-lp3.. (unknown [9.40.194.171]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 16 May 2023 11:12:04 +0000 (GMT) From: Manjunath Matti To: libc-alpha@sourceware.org Cc: rajis@linux.ibm.com, Manjunath Matti Subject: [PATCH] powerpc: Use sysconf (_SC_SIGSTKSZ) to set SIGSTKSZ and MINSIGSTKSZ. Date: Tue, 16 May 2023 07:11:40 -0400 Message-Id: <20230516111140.2585699-1-mmatti@linux.ibm.com> X-Mailer: git-send-email 2.37.2 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: oQPgH6W815Ucf8PXBlAEiOcs-S-QaRYk X-Proofpoint-ORIG-GUID: oQPgH6W815Ucf8PXBlAEiOcs-S-QaRYk Content-Transfer-Encoding: 8bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-16_04,2023-05-16_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 bulkscore=0 spamscore=0 suspectscore=0 mlxlogscore=606 impostorscore=0 malwarescore=0 adultscore=0 phishscore=0 priorityscore=1501 clxscore=1015 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305160094 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,RCVD_IN_MSPIKE_H2,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 List-Id: Add support in PowerPC to use sysconf (_SC_SIGSTKSZ) to set SIGSTKSZ and MINSIGSTKSZ similar to x86. The minimum signal stack size derived from AT_MINSIGSTKSZ, which is the minimum number of bytes of free stack space required in order to gurantee successful, non-nested handling of a single signal whose handler is an empty function. The kernel commit 2896b2dff49d0377e4372f470dcddbcb26f2be59 implements AT_MINSIGSTKSZ AUXV entry, allowing userspace to dynamically size stack allocations. --- .../unix/sysv/linux/powerpc/bits/sigstksz.h | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 sysdeps/unix/sysv/linux/powerpc/bits/sigstksz.h diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/sigstksz.h b/sysdeps/unix/sysv/linux/powerpc/bits/sigstksz.h new file mode 100644 index 0000000000..399a49c1b0 --- /dev/null +++ b/sysdeps/unix/sysv/linux/powerpc/bits/sigstksz.h @@ -0,0 +1,33 @@ +/* Definition of MINSIGSTKSZ and SIGSTKSZ. Linux/PowerPC version. + Copyright (C) 2023 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SIGNAL_H +# error "Never include directly; use instead." +#endif + +#if defined __USE_DYNAMIC_STACK_SIZE && __USE_DYNAMIC_STACK_SIZE +# include + +/* Default stack size for a signal handler: sysconf (SC_SIGSTKSZ). */ +# undef SIGSTKSZ +# define SIGSTKSZ sysconf (_SC_SIGSTKSZ) + +/* Minimum stack size for a signal handler: SIGSTKSZ/4. */ +# undef MINSIGSTKSZ +# define MINSIGSTKSZ (SIGSTKSZ >> 2) +#endif -- 2.37.2