| Message ID | 20260612155306.173235-1-christophe.lyon@arm.com |
|---|---|
| State | New |
| Headers |
Return-Path: <newlib-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 908184BA79AC for <patchwork@sourceware.org>; Fri, 12 Jun 2026 15:55:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 908184BA79AC Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=dXB9jGrs; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=dXB9jGrs X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from PA4PR04CU001.outbound.protection.outlook.com (mail-francecentralazon11013070.outbound.protection.outlook.com [40.107.162.70]) by sourceware.org (Postfix) with ESMTPS id 4AE5E4BA2E05 for <newlib@sourceware.org>; Fri, 12 Jun 2026 15:54:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4AE5E4BA2E05 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4AE5E4BA2E05 Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=40.107.162.70 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1781279665; cv=pass; b=AQxWudhdkZSjq3cLL+X48OsOOgIiyrWZdz3w30JbpK8bCyvFBs9T6x1HXsh/P8yYPLjY2aRI1qlvos8/5IoReYtMZsvcr6gd+0ZE7WVZABfF1KWliaG/RyUooqORn2u1vGtmIpoNEn2z4eJNOBYDd8nL3ZgqyFgQtjLvTLcmVLg= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1781279665; c=relaxed/simple; bh=mN9+m3lBJu/dpbqU3t4WqPG0fbnoccxu2twZf/2uN74=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=W9lJxAz1dYj8Oxghw1H0sAsoLoUO1bDdwI4sM09NBysJFrg80BMyJAaGbeI8qG9XHyuXmFPmwowHEAMEGl7wp+M8z6inu0Y4oKPgKfctd5JQCFHkyUfytZGwVILW1zkXDSH4/oeVfqT9gfmZFPPTyzJ2fUH4cCqqrt133y8zsNU= ARC-Authentication-Results: i=3; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=dXB9jGrs; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=dXB9jGrs DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4AE5E4BA2E05 ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=wWKe0PwinpZXgDSgW5LKbYEMyLH8xNVB7y+F1PSuAf2YIguKYlG87oPogaRA0Gx3J4l+T2TPJg3KqlRme40KEplPdC7T4b0alIZ1wxoCz60QgWFb9ARPZH+LI7Wc3yn14UPcKOlMh/vuzuAvZuLMYiI3GcH7HyVPBBFKEKLHPmguRFyTDHl8FpQZzdNqq5jLyCAijDPTKrrOH8ebZLwjdNcX6GE2lGuRm4U1hKqYplD9tpxDCon1qD5R9Up+vq8wUY8mHOnuPxbowVLsF1X6QR7LkBdbC8b9R14JyZqCcHCjTLYWzoEvZ+E4cUoEt11VqWTHOfWH/hgkBR25VISPiQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=iIUGyLBQC9sJoV7HpLjy0v/t0v15vsMYHX3uA4VwFs0=; b=gnER7dRgV6vU1qMTNpSeJQwqR45oe0Wp31Re6iF9zmZv1t38BhKFXc2/oIHYQu+eji1L55yL+EXd56A4EOBo35Bbnkn5JCLgJGzdO7TKvrwSht3DqldymCkw2ZlIavNNISLJK2eA4XnLEC7rxRMxivfmfgpAiG73ZyoWKRq91+0jV2/z2dKpkZmLtS/abtwQMRU6FgODvNM9HDzLGr5z6J1TzUNWaImJBrpHa26Trp0IplfedQcCsnnQQpcuYF5arRJusLS3KFynEMYSemVuc08jLPpGzUkYpppDv2keYhUk5Hegd0/Jrqp/F9ErIswoJiuE6rheWbLBwwFpaZ6jUw== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iIUGyLBQC9sJoV7HpLjy0v/t0v15vsMYHX3uA4VwFs0=; b=dXB9jGrsNoNbkYSHqU1k8yMpZexDFtueu3kBIOsF8YVD77sdwuhlSwHKFY6XnOC5qd6O6YYY1gMny9gSs0hDdlsSORWR2+xVu1EHJmgwXSP0o/4oj0UhekNEGJ9Kp8zLdD6uvIazWCfIMiXstB79ItRC/ZLyVm4qBuQzhCfaeWY= Received: from DU7P195CA0030.EURP195.PROD.OUTLOOK.COM (2603:10a6:10:54d::17) by AM8PR08MB6516.eurprd08.prod.outlook.com (2603:10a6:20b:363::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.113.14; Fri, 12 Jun 2026 15:54:14 +0000 Received: from DU2PEPF00028D07.eurprd03.prod.outlook.com (2603:10a6:10:54d:cafe::5) by DU7P195CA0030.outlook.office365.com (2603:10a6:10:54d::17) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.113.14 via Frontend Transport; Fri, 12 Jun 2026 15:54:14 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 4.158.2.129) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=arm.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 4.158.2.129 as permitted sender) receiver=protection.outlook.com; client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by DU2PEPF00028D07.mail.protection.outlook.com (10.167.242.167) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.92.5 via Frontend Transport; Fri, 12 Jun 2026 15:54:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BgFOJvPGzRRqPXX/mozioDHPY9NHU6mlSxCnobsJxNWCalYYQW3szrMPXFigWndfSnasclEbFRVDjRjgOL9JC0cnmINklPGCPzUzyz/vPZKdCKKAJHLJiNarkdchYY6mOwWHS4leJpL8ACKUYRn+eZ9ZIj1Bj6p6epPSTz6UYfoLma6DzyDzJUa8z8hqLsxUXRQHjrNw6Kp4WCzJBMzcGXz2x/oJpNmJxwxJCU/BaLr71/Do6GJh7FkZFAxsrCCpDvrwUotaXvvX7NLzbaA0oNQUQSwKNb/m5iMf4xXfbMNTO2w4DfaWfdxogqqAZ+VCny+LtOMgfSTqMynyENCD5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=iIUGyLBQC9sJoV7HpLjy0v/t0v15vsMYHX3uA4VwFs0=; b=bSWmzNd6qh0io48noaz2l7sEWXhRIrt05HJ0RSWKtvypjgP4LCBl9xVS3gy9Ll7hpntTShw+j8qQbpgljtcAKJJpDy3oK0qagwayIc+k8sGaRQb55AUG2jRYryNyXpd83G5TsasJrZbom4OtM75sdcelmpMJ7fN6b/R6O5CFMm8Y2UpI4EjSqQlEg47S4Vz5sIuOJf2frB30A5ncCYT+YYgTELyolZiP110avGJHF6l/NhAZ3/i9scJyVPGsq4IFRy3D4UschMXXDQ55er3323pQz+fO/L8gu/GYqZA6hEhpIniwMS8OxuH8u6rcWaZqk7jSuUW6TtMd5IDGqxuZog== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 172.205.89.229) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iIUGyLBQC9sJoV7HpLjy0v/t0v15vsMYHX3uA4VwFs0=; b=dXB9jGrsNoNbkYSHqU1k8yMpZexDFtueu3kBIOsF8YVD77sdwuhlSwHKFY6XnOC5qd6O6YYY1gMny9gSs0hDdlsSORWR2+xVu1EHJmgwXSP0o/4oj0UhekNEGJ9Kp8zLdD6uvIazWCfIMiXstB79ItRC/ZLyVm4qBuQzhCfaeWY= Received: from DU6P191CA0010.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:540::7) by GV2PR08MB9926.eurprd08.prod.outlook.com (2603:10a6:150:c1::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.113.13; Fri, 12 Jun 2026 15:53:09 +0000 Received: from DU6PEPF0000A7E2.eurprd02.prod.outlook.com (2603:10a6:10:540:cafe::70) by DU6P191CA0010.outlook.office365.com (2603:10a6:10:540::7) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.113.14 via Frontend Transport; Fri, 12 Jun 2026 15:53:09 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 172.205.89.229) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 172.205.89.229 as permitted sender) receiver=protection.outlook.com; client-ip=172.205.89.229; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (172.205.89.229) by DU6PEPF0000A7E2.mail.protection.outlook.com (10.167.8.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.113.7 via Frontend Transport; Fri, 12 Jun 2026 15:53:09 +0000 Received: from AZ-NEU-EX04.Arm.com (10.240.25.138) by AZ-NEU-EX04.Arm.com (10.240.25.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.29; Fri, 12 Jun 2026 15:53:09 +0000 Received: from e129018.arm.com (10.57.29.89) by mail.arm.com (10.240.25.138) with Microsoft SMTP Server id 15.2.2562.29 via Frontend Transport; Fri, 12 Jun 2026 15:53:08 +0000 From: Christophe Lyon <christophe.lyon@arm.com> To: <newlib@sourceware.org> CC: <richard.earnshaw@arm.com>, <andre.simoesdiasvieira@arm.com>, "Christophe Lyon" <christophe.lyon@arm.com> Subject: [PATCH] libgloss: arm: Add hardfault handler for M-profile Date: Fri, 12 Jun 2026 17:53:06 +0200 Message-ID: <20260612155306.173235-1-christophe.lyon@arm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DU6PEPF0000A7E2:EE_|GV2PR08MB9926:EE_|DU2PEPF00028D07:EE_|AM8PR08MB6516:EE_ X-MS-Office365-Filtering-Correlation-Id: faed8fbc-614f-48e3-89c9-08dec89ad9e1 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|36860700016|82310400026|1800799024|376014|23010399003|18002099003|11063799006|3023799007|56012099006; X-Microsoft-Antispam-Message-Info-Original: yJPa0S1Kq4MaP81CgWWPfufHRROyCdXL0WfzLf9NLm1Z6todkXuFVGfccGnmM55FBmRO9lrDISLcJrxy43uAoi3txVQzdxlfj+IizrtwQA+kYyU2pva4E6FZ8WbBZ5Mmxr6aMOdSDZCPk61GsFvvoOLP/i/q9+t/9mg1a4BtIZhNy0NSrf4czl29jyvAx3fXBBCTt3wpJ51jj3sdEXlHuC+1SkObhVilNGRL6dPULIW0p9eUY6/Wa9xjAF/g9aqLQA6LQU+Au/yJeuKM6MmYqtrIJC5Du022ZiuJl/GX/lIT+iASyLhcS5B1EuVKB0yytkOhdgYo/rFSBIwVJDNCTJHaio8nQlEL9ahGndXteaSfXAJAv02fWpKicjmRbatN6Wjt+FEOQFOFhAW4/ce3rC5A9LXFuH5CsjEkbBJoIPsCbeKe78xd9jeCITxluBJsdWkHQ3/Qb3an/SEw4BCVhUWhogsGs5F3Gxz35ZgMFwKChTpgiFXx2710/6FehXPBcTNmb+3K4almlAHlxv34xheK+/a/pzW9Wy4PO/Fv6f1SE7oEuF+nnJkcgrlVTJ1fL6gzFhpu+z5jbSv5W0WJWR4Ds4ElOr/ADAaVewd3/7g8oQ7M4z9QgMh67ccpq7eEuBf6VVyFJI8RCv38Hmnr8KJdBof6ErnwCvasLHup6X4nxfg0grSEV93X8urGP7/on726X6JDTftgiFVzWGBwqRfhqOhZSH79ttkkHOClGtE= X-Forefront-Antispam-Report-Untrusted: CIP:172.205.89.229; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(36860700016)(82310400026)(1800799024)(376014)(23010399003)(18002099003)(11063799006)(3023799007)(56012099006); DIR:OUT; SFP:1101; X-Exchange-RoutingPolicyChecked: nsPf6maUkSL5nsxTwLax7JwOkUuRauqwHDfBfl8xXYq0GT/yTDaMIdjO7i06EbqInXgI8z1Yqda3FZSOVGFSO4UbeRpRkLUGioVvu/LzqiY/RiY0wdqWrrgXsWdkrFY+LVqJeULouPkvfkC5seGsdb+tygm1KWf80uxS9AlF55cKQCcZSBKnTy3kNVTh8rc6aA3MjYiz1NWk5N5RPPNcP2VXtKpei++e3yzMV+vbtGDQuur+zTePWQ9BuDBx62I72Lmqy7Wg8DOhGsxN1eiNOuYGA3/IEpK1Zln9ZXG4ISbmm6iSCIzyaTPM75F7CsT6rH3Xl4Ma2wysqJaffmwhDA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB9926 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DU2PEPF00028D07.eurprd03.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: d2c27a51-2b10-4f48-693d-08dec89ab3ad X-Microsoft-Antispam: BCL:0; ARA:13230040|23010399003|14060799003|35042699022|376014|1800799024|82310400026|36860700016|56012099006|3023799007|11063799006|18002099003; X-Microsoft-Antispam-Message-Info: wAzYEe538CPHDJ56wC+sXv3K8N+l1x+cVbgjRr5IgqV5Kz4mswEzJklQgZEivZCi0UEaolWT0GjrnIf28GTG/BLfTzR/rEiIFqdEsQzi4MiY0KnG2A7XOUwV8gbEpi9khsAoQ7yIJIjsj6G0hndi/oPQbwxzqjQLHKy3rSYF5lpkYYmV9Z0f7iRf5lPxKPK2bGKs2I3M8tYjDXFOcT4E9u7pibJ7IDNNazk/zY0h4R6lNxyS5zvTIlIQrnf3iiOqxn3LuuQUSvtkFgYPpeXY1RONsNEjwrWpgJ8KLyqTQKCkcVXx4QDQq/adrh95eRz+0khrwSxT3o2RRvV8R7Jfykd4Twk+48O2RKUC2TieIywA1yzxxRbKxgbFkZyU652/KOfRWkginqAZsPmYRR8gcDYvEYKVzHotunMirwObVVIBxaHhP0hQ0+iRHpupv6WDK5uFW4tFcFeVdf6s8AeTnyTuF1dm8oREqsevcNWo58hue/TcuVy5yGMKQKSixJl5v0HIGaWKFCAyt9iGjP6N/vsPfQeRcMJdkn0rzccVxPueAD+ZdigxA/QQZj//RO9atjicyTjQCY/W9YETBcsKgfbJGWkCMsJRIPvW9dLWmy0x2vzFpFGAiL0AByWrKmGqLtUzPwmuX4jYWV5W3aF7lCSUVZqzB3gfYRHpkhayvNSeG/Ogs/K/eoRWdxGQFENuzpBqGRPO/JcYYNY1o+XtVLM0m/lgWKF3omkmlTLbc8E= X-Forefront-Antispam-Report: CIP:4.158.2.129; CTRY:GB; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:outbound-uk1.az.dlp.m.darktrace.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(23010399003)(14060799003)(35042699022)(376014)(1800799024)(82310400026)(36860700016)(56012099006)(3023799007)(11063799006)(18002099003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: H+UskU240R5ByK3Y/JLF3yntGaG29E4nCQCxi+DiE7aLti7ZEuBmQRe5yF9I8OlQAWTMSxFUKoS/hhZskaI49Nja0bJYrKcXZtGHicZHaCiUjo/LN6eCoDTSwrWzAX0pL034eZQONU175FpF9prBeiMGRAa/YGVp6LbwZ+rCHQrKgVAekTFCDo5pEF+2cy097IwIu7m/CIax6gK96WY6F6xFWC3pV/WVP4El9vY+QwPrlYsLmeYX60bufKYkoOo3e8uWR4ESJS5l5egX1/nwFkZUtMcCwt7cp9WgPkK2KNO2ITB8eUpFwdzTm3C4CDeV/i7/xmip4+RVjlpl+FC8or8vD2tdgtwpHn/YzwHsf+M/CvAiK6m6/TLg6sNt0LICpKZq2XzhG/ZVBtcqXVmkasHCWzloblAjN5vIawh2jDbUmXor7N/pCBNUBTAfaqTM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jun 2026 15:54:13.8785 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: faed8fbc-614f-48e3-89c9-08dec89ad9e1 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[4.158.2.129]; Helo=[outbound-uk1.az.dlp.m.darktrace.com] X-MS-Exchange-CrossTenant-AuthSource: DU2PEPF00028D07.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB6516 X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Newlib mailing list <newlib.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/newlib>, <mailto:newlib-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/newlib/> List-Post: <mailto:newlib@sourceware.org> List-Help: <mailto:newlib-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/newlib>, <mailto:newlib-request@sourceware.org?subject=subscribe> Errors-To: newlib-bounces~patchwork=sourceware.org@sourceware.org |
| Series |
libgloss: arm: Add hardfault handler for M-profile
|
|
Commit Message
Christophe Lyon
June 12, 2026, 3:53 p.m. UTC
After reaching a hardfault, the simulator enters an infinite loop unless we map the handler to 'abort'. The patch adds this minimal setup for M-profile in libgloss/arm/cpu-init/rdimon-aem.S and introduces the new libgloss/arm/elf-mprofile-mps2.specs to add the mapping to the right memory address. 2026-05-29 Andre Vieira <andre.simoesdiasvieira@arm.com> Christophe Lyon <christophe.lyon@arm.com> libgloss/ * Makefile.in: Add entry for arm/mprofile-mps2.specs. * arm/Makefile.inc: Add entry for mprofile-mps2.specs. * arm/cpu-init/rdimon-aem.S: Update comment. Add hardfault handler. * arm/elf-mprofile-mps2.specs: New file. --- libgloss/Makefile.in | 1 + libgloss/arm/Makefile.inc | 3 ++- libgloss/arm/cpu-init/rdimon-aem.S | 11 +++++++++-- libgloss/arm/elf-mprofile-mps2.specs | 26 ++++++++++++++++++++++++++ 4 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 libgloss/arm/elf-mprofile-mps2.specs
Comments
On 12/06/2026 16:53, Christophe Lyon wrote: > After reaching a hardfault, the simulator enters an infinite loop > unless we map the handler to 'abort'. > > The patch adds this minimal setup for M-profile in > libgloss/arm/cpu-init/rdimon-aem.S and introduces the new > libgloss/arm/elf-mprofile-mps2.specs to add the mapping to the right > memory address. > > 2026-05-29 Andre Vieira <andre.simoesdiasvieira@arm.com> > Christophe Lyon <christophe.lyon@arm.com> > > libgloss/ > * Makefile.in: Add entry for arm/mprofile-mps2.specs. > * arm/Makefile.inc: Add entry for mprofile-mps2.specs. > * arm/cpu-init/rdimon-aem.S: Update comment. Add hardfault > handler. > * arm/elf-mprofile-mps2.specs: New file. > --- > libgloss/Makefile.in | 1 + > libgloss/arm/Makefile.inc | 3 ++- > libgloss/arm/cpu-init/rdimon-aem.S | 11 +++++++++-- > libgloss/arm/elf-mprofile-mps2.specs | 26 ++++++++++++++++++++++++++ > 4 files changed, 38 insertions(+), 3 deletions(-) > create mode 100644 libgloss/arm/elf-mprofile-mps2.specs > > diff --git a/libgloss/Makefile.in b/libgloss/Makefile.in > index 5146a7880..c03ea4e6b 100644 > --- a/libgloss/Makefile.in > +++ b/libgloss/Makefile.in > @@ -2255,6 +2255,7 @@ TEXINFO_TEX = ../texinfo/texinfo.tex > @CONFIG_ARM_TRUE@ arm/aprofile-validation-v2m.specs \ > @CONFIG_ARM_TRUE@ arm/aprofile-ve-v2m.specs \ > @CONFIG_ARM_TRUE@ arm/aprofile-ve.specs arm/pid.specs \ > +@CONFIG_ARM_TRUE@ arm/mprofile-mps2.specs \ > @CONFIG_ARM_TRUE@ arm/iq80310.specs > @CONFIG_ARM_TRUE@arm_libgloss_linux_a_SOURCES = \ > @CONFIG_ARM_TRUE@ arm/linux-syscalls0.c \ > diff --git a/libgloss/arm/Makefile.inc b/libgloss/arm/Makefile.inc > index 41fce3c99..5c740edcb 100644 > --- a/libgloss/arm/Makefile.inc > +++ b/libgloss/arm/Makefile.inc > @@ -47,7 +47,8 @@ multilibtool_LIBRARIES += %D%/librdpmon.a > %D%/aprofile-validation.specs \ > %D%/aprofile-validation-v2m.specs \ > %D%/aprofile-ve-v2m.specs \ > - %D%/aprofile-ve.specs > + %D%/aprofile-ve.specs \ > + %D%/mprofile-mps2.specs > multilibtool_DATA += \ > %D%/rdimon-crt0.o \ > %D%/rdimon-crt0-v2m.o > diff --git a/libgloss/arm/cpu-init/rdimon-aem.S b/libgloss/arm/cpu-init/rdimon-aem.S > index 2aacbeba9..c960924d4 100644 > --- a/libgloss/arm/cpu-init/rdimon-aem.S > +++ b/libgloss/arm/cpu-init/rdimon-aem.S It looks to me as though there's no shared code in this file compared to the a-profile variant, which makes me think that perhaps they should just be separate files, rather than munged together when there's no commonality beyond 'this is startup code'. Personally, I think it would be better to rename the existing file as something like rdimon-aem-a.S and then add a new one (say, rdimon-aem-m.S) for the m-profile code. > @@ -25,7 +25,9 @@ > > /* This file gives a basic initialisation of a Cortex-A series core. It is > the bare minimum required to get Cortex-A core running with a semihosting > - interface. > + interface. For M-profile we only define a hardfault handler, required to > + prevent the simulator from entering into an infinite loop. The comments > + below apply to A-profile only. If I've missed something and this code does belong in this file, then this whole comment needs properly restructuring. There should be a single top-level comment that just says something like "Provide the basic CPU initialization for Armv7 and later CPUs. We currently support A-profile and M-profile. Then the profile-specific details should be moved inside the relevant ifdef sections. It would be good to get rid of the reference to 'Cortex-A' here as well (replace it with A-profile) as there's nothing here that is specific to Arm's Cortex-* products: this is defined by the architecture. Finally, if you're keeping this in one place, the copyright dates at the top of the file need updating. > > It sets up a basic 1:1 phsyical address to virtual address mapping; > turns the MMU on; enables branch prediction; activates any integrated > @@ -539,4 +541,9 @@ is_a15_a7: > page_tables: > PT7(0x1c0e) > > -#endif //#if defined(__ARM_ARCH_7A__) || __ARM_ARCH_PROFILE == 'A' > +#elif (__ARM_ARCH_PROFILE == 'M') > + /* On M-profile, call abort in case of hardfault: this causes the simulator to > + abort execution instead of going into an infinite loop. */ > + .section .hardfault_handler_addr, "a" > + .word abort > +#endif //#if defined(__ARM_ARCH_7A__) || (__ARM_ARCH_PROFILE == 'A') > diff --git a/libgloss/arm/elf-mprofile-mps2.specs b/libgloss/arm/elf-mprofile-mps2.specs > new file mode 100644 > index 000000000..edaf71917 > --- /dev/null > +++ b/libgloss/arm/elf-mprofile-mps2.specs > @@ -0,0 +1,26 @@ > +# rdimon.specs > +# > +# Spec file for AArch32 M profile baremetal newlib with version 2 of > +# the AngelAPI semi-hosting using the SVC trap instruction. > +# > +# This version supports extensibility through an extension mechanism. > + > +%rename link_gcc_c_sequence rdimon_link_gcc_c_sequence > + > +%rename link old_link > + > +*link: > +--section-start=.hardfault_handler_addr=0xc %(old_link) > + > +*rdimon_libc: > +%{!specs=nano.specs:-lc} %{specs=nano.specs:-lc_nano} > + > +*rdimon_libgloss: > +%{!specs=nano.specs:-lrdimon} %{specs=nano.specs:-lrdimon_nano} > + > +*link_gcc_c_sequence: > +%(rdimon_link_gcc_c_sequence) --start-group %G %(rdimon_libc) %(rdimon_libgloss) --end-group > + > +*startfile: > +crti%O%s crtbegin%O%s cpu-init/rdimon-aem.o%s %{!pg:rdimon-crt0%O%s} %{pg:rdimon-crt0%O%s} > +
On 6/22/26 12:48, Richard Earnshaw wrote: > On 12/06/2026 16:53, Christophe Lyon wrote: >> After reaching a hardfault, the simulator enters an infinite loop >> unless we map the handler to 'abort'. >> >> The patch adds this minimal setup for M-profile in >> libgloss/arm/cpu-init/rdimon-aem.S and introduces the new >> libgloss/arm/elf-mprofile-mps2.specs to add the mapping to the right >> memory address. >> >> 2026-05-29 Andre Vieira <andre.simoesdiasvieira@arm.com> >> Christophe Lyon <christophe.lyon@arm.com> >> >> libgloss/ >> * Makefile.in: Add entry for arm/mprofile-mps2.specs. >> * arm/Makefile.inc: Add entry for mprofile-mps2.specs. >> * arm/cpu-init/rdimon-aem.S: Update comment. Add hardfault >> handler. >> * arm/elf-mprofile-mps2.specs: New file. >> --- >> libgloss/Makefile.in | 1 + >> libgloss/arm/Makefile.inc | 3 ++- >> libgloss/arm/cpu-init/rdimon-aem.S | 11 +++++++++-- >> libgloss/arm/elf-mprofile-mps2.specs | 26 ++++++++++++++++++++++++++ >> 4 files changed, 38 insertions(+), 3 deletions(-) >> create mode 100644 libgloss/arm/elf-mprofile-mps2.specs >> >> diff --git a/libgloss/Makefile.in b/libgloss/Makefile.in >> index 5146a7880..c03ea4e6b 100644 >> --- a/libgloss/Makefile.in >> +++ b/libgloss/Makefile.in >> @@ -2255,6 +2255,7 @@ TEXINFO_TEX = ../texinfo/texinfo.tex >> @CONFIG_ARM_TRUE@ arm/aprofile-validation-v2m.specs \ >> @CONFIG_ARM_TRUE@ arm/aprofile-ve-v2m.specs \ >> @CONFIG_ARM_TRUE@ arm/aprofile-ve.specs arm/pid.specs \ >> +@CONFIG_ARM_TRUE@ arm/mprofile-mps2.specs \ >> @CONFIG_ARM_TRUE@ arm/iq80310.specs >> @CONFIG_ARM_TRUE@arm_libgloss_linux_a_SOURCES = \ >> @CONFIG_ARM_TRUE@ arm/linux-syscalls0.c \ >> diff --git a/libgloss/arm/Makefile.inc b/libgloss/arm/Makefile.inc >> index 41fce3c99..5c740edcb 100644 >> --- a/libgloss/arm/Makefile.inc >> +++ b/libgloss/arm/Makefile.inc >> @@ -47,7 +47,8 @@ multilibtool_LIBRARIES += %D%/librdpmon.a >> %D%/aprofile-validation.specs \ >> %D%/aprofile-validation-v2m.specs \ >> %D%/aprofile-ve-v2m.specs \ >> - %D%/aprofile-ve.specs >> + %D%/aprofile-ve.specs \ >> + %D%/mprofile-mps2.specs >> multilibtool_DATA += \ >> %D%/rdimon-crt0.o \ >> %D%/rdimon-crt0-v2m.o >> diff --git a/libgloss/arm/cpu-init/rdimon-aem.S b/libgloss/arm/cpu- >> init/rdimon-aem.S >> index 2aacbeba9..c960924d4 100644 >> --- a/libgloss/arm/cpu-init/rdimon-aem.S >> +++ b/libgloss/arm/cpu-init/rdimon-aem.S > It looks to me as though there's no shared code in this file compared to > the a-profile variant, which makes me think that perhaps they should > just be separate files, rather than munged together when there's no > commonality beyond 'this is startup code'. > > Personally, I think it would be better to rename the existing file as > something like rdimon-aem-a.S and then add a new one (say, rdimon-aem- > m.S) for the m-profile code. > Indeed, before this patch the code is specific to A-profile, and this patch adds a section dedicated to M-profile (no nothing common with A-profile). I think having 2 files makes sense but seems tricky to handle at Makefile level (wrt multilibs). So maybe: - rename rdi-mon-aem.S into rdimon-aem-a.S, and re-create rdi-mon-aem.S which only includes rdimon-aem-a.S - add rdimon-aem-m.S and make rdi-mon-aem.S include it unconditionally This way we have 2 separate source files, but no change to the build system and multilib support >> @@ -25,7 +25,9 @@ >> /* This file gives a basic initialisation of a Cortex-A series >> core. It is >> the bare minimum required to get Cortex-A core running with a >> semihosting >> - interface. >> + interface. For M-profile we only define a hardfault handler, >> required to >> + prevent the simulator from entering into an infinite loop. The >> comments >> + below apply to A-profile only. > > If I've missed something and this code does belong in this file, then > this whole comment needs properly restructuring. There should be a > single top-level comment that just says something like "Provide the > basic CPU initialization for Armv7 and later CPUs. We currently support > A-profile and M-profile. Then the profile-specific details should be > moved inside the relevant ifdef sections. It would be good to get rid > of the reference to 'Cortex-A' here as well (replace it with A-profile) > as there's nothing here that is specific to Arm's Cortex-* products: > this is defined by the architecture. If I move rdimon-aem.S into rdimon-aem-a.S, I can probably make some small adjustments to this comment (and not add mentions of M-profile). This comment has been unmodified since ... 2013! > > Finally, if you're keeping this in one place, the copyright dates at the > top of the file need updating. > >> It sets up a basic 1:1 phsyical address to virtual address mapping; >> turns the MMU on; enables branch prediction; activates any >> integrated >> @@ -539,4 +541,9 @@ is_a15_a7: >> page_tables: >> PT7(0x1c0e) >> -#endif //#if defined(__ARM_ARCH_7A__) || __ARM_ARCH_PROFILE == 'A' >> +#elif (__ARM_ARCH_PROFILE == 'M') >> + /* On M-profile, call abort in case of hardfault: this causes the >> simulator to >> + abort execution instead of going into an infinite loop. */ >> + .section .hardfault_handler_addr, "a" >> + .word abort >> +#endif //#if defined(__ARM_ARCH_7A__) || (__ARM_ARCH_PROFILE == 'A') >> diff --git a/libgloss/arm/elf-mprofile-mps2.specs b/libgloss/arm/elf- >> mprofile-mps2.specs >> new file mode 100644 >> index 000000000..edaf71917 >> --- /dev/null >> +++ b/libgloss/arm/elf-mprofile-mps2.specs >> @@ -0,0 +1,26 @@ >> +# rdimon.specs >> +# >> +# Spec file for AArch32 M profile baremetal newlib with version 2 of >> +# the AngelAPI semi-hosting using the SVC trap instruction. >> +# >> +# This version supports extensibility through an extension mechanism. >> + >> +%rename link_gcc_c_sequence rdimon_link_gcc_c_sequence >> + >> +%rename link old_link >> + >> +*link: >> +--section-start=.hardfault_handler_addr=0xc %(old_link) >> + >> +*rdimon_libc: >> +%{!specs=nano.specs:-lc} %{specs=nano.specs:-lc_nano} >> + >> +*rdimon_libgloss: >> +%{!specs=nano.specs:-lrdimon} %{specs=nano.specs:-lrdimon_nano} >> + >> +*link_gcc_c_sequence: >> +%(rdimon_link_gcc_c_sequence) --start-group %G %(rdimon_libc) >> %(rdimon_libgloss) --end-group >> + >> +*startfile: >> +crti%O%s crtbegin%O%s cpu-init/rdimon-aem.o%s %{!pg:rdimon-crt0%O%s} >> %{pg:rdimon-crt0%O%s} >> + >
I have sent an updated version as part of a new series (now 3 patches): https://sourceware.org/pipermail/newlib/2026/022515.html On 6/22/26 15:25, Christophe Lyon wrote: > > > On 6/22/26 12:48, Richard Earnshaw wrote: >> On 12/06/2026 16:53, Christophe Lyon wrote: >>> After reaching a hardfault, the simulator enters an infinite loop >>> unless we map the handler to 'abort'. >>> >>> The patch adds this minimal setup for M-profile in >>> libgloss/arm/cpu-init/rdimon-aem.S and introduces the new >>> libgloss/arm/elf-mprofile-mps2.specs to add the mapping to the right >>> memory address. >>> >>> 2026-05-29 Andre Vieira <andre.simoesdiasvieira@arm.com> >>> Christophe Lyon <christophe.lyon@arm.com> >>> >>> libgloss/ >>> * Makefile.in: Add entry for arm/mprofile-mps2.specs. >>> * arm/Makefile.inc: Add entry for mprofile-mps2.specs. >>> * arm/cpu-init/rdimon-aem.S: Update comment. Add hardfault >>> handler. >>> * arm/elf-mprofile-mps2.specs: New file. >>> --- >>> libgloss/Makefile.in | 1 + >>> libgloss/arm/Makefile.inc | 3 ++- >>> libgloss/arm/cpu-init/rdimon-aem.S | 11 +++++++++-- >>> libgloss/arm/elf-mprofile-mps2.specs | 26 ++++++++++++++++++++++++++ >>> 4 files changed, 38 insertions(+), 3 deletions(-) >>> create mode 100644 libgloss/arm/elf-mprofile-mps2.specs >>> >>> diff --git a/libgloss/Makefile.in b/libgloss/Makefile.in >>> index 5146a7880..c03ea4e6b 100644 >>> --- a/libgloss/Makefile.in >>> +++ b/libgloss/Makefile.in >>> @@ -2255,6 +2255,7 @@ TEXINFO_TEX = ../texinfo/texinfo.tex >>> @CONFIG_ARM_TRUE@ arm/aprofile-validation-v2m.specs \ >>> @CONFIG_ARM_TRUE@ arm/aprofile-ve-v2m.specs \ >>> @CONFIG_ARM_TRUE@ arm/aprofile-ve.specs arm/pid.specs \ >>> +@CONFIG_ARM_TRUE@ arm/mprofile-mps2.specs \ >>> @CONFIG_ARM_TRUE@ arm/iq80310.specs >>> @CONFIG_ARM_TRUE@arm_libgloss_linux_a_SOURCES = \ >>> @CONFIG_ARM_TRUE@ arm/linux-syscalls0.c \ >>> diff --git a/libgloss/arm/Makefile.inc b/libgloss/arm/Makefile.inc >>> index 41fce3c99..5c740edcb 100644 >>> --- a/libgloss/arm/Makefile.inc >>> +++ b/libgloss/arm/Makefile.inc >>> @@ -47,7 +47,8 @@ multilibtool_LIBRARIES += %D%/librdpmon.a >>> %D%/aprofile-validation.specs \ >>> %D%/aprofile-validation-v2m.specs \ >>> %D%/aprofile-ve-v2m.specs \ >>> - %D%/aprofile-ve.specs >>> + %D%/aprofile-ve.specs \ >>> + %D%/mprofile-mps2.specs >>> multilibtool_DATA += \ >>> %D%/rdimon-crt0.o \ >>> %D%/rdimon-crt0-v2m.o >>> diff --git a/libgloss/arm/cpu-init/rdimon-aem.S b/libgloss/arm/cpu- >>> init/rdimon-aem.S >>> index 2aacbeba9..c960924d4 100644 >>> --- a/libgloss/arm/cpu-init/rdimon-aem.S >>> +++ b/libgloss/arm/cpu-init/rdimon-aem.S >> It looks to me as though there's no shared code in this file compared >> to the a-profile variant, which makes me think that perhaps they >> should just be separate files, rather than munged together when >> there's no commonality beyond 'this is startup code'. > > > Personally, I think it would be better to rename the existing file as >> something like rdimon-aem-a.S and then add a new one (say, rdimon-aem- >> m.S) for the m-profile code. >> > Indeed, before this patch the code is specific to A-profile, and this > patch adds a section dedicated to M-profile (no nothing common with A- > profile). > I think having 2 files makes sense but seems tricky to handle at > Makefile level (wrt multilibs). > So maybe: > - rename rdi-mon-aem.S into rdimon-aem-a.S, and re-create rdi-mon-aem.S > which only includes rdimon-aem-a.S > - add rdimon-aem-m.S and make rdi-mon-aem.S include it unconditionally > > This way we have 2 separate source files, but no change to the build > system and multilib support > > >>> @@ -25,7 +25,9 @@ >>> /* This file gives a basic initialisation of a Cortex-A series >>> core. It is >>> the bare minimum required to get Cortex-A core running with a >>> semihosting >>> - interface. >>> + interface. For M-profile we only define a hardfault handler, >>> required to >>> + prevent the simulator from entering into an infinite loop. The >>> comments >>> + below apply to A-profile only. >> >> If I've missed something and this code does belong in this file, then >> this whole comment needs properly restructuring. There should be a >> single top-level comment that just says something like "Provide the >> basic CPU initialization for Armv7 and later CPUs. We currently >> support A-profile and M-profile. Then the profile-specific details >> should be moved inside the relevant ifdef sections. It would be good >> to get rid of the reference to 'Cortex-A' here as well (replace it >> with A-profile) as there's nothing here that is specific to Arm's >> Cortex-* products: this is defined by the architecture. > > If I move rdimon-aem.S into rdimon-aem-a.S, I can probably make some > small adjustments to this comment (and not add mentions of M-profile). > This comment has been unmodified since ... 2013! >> >> Finally, if you're keeping this in one place, the copyright dates at >> the top of the file need updating. >> >>> It sets up a basic 1:1 phsyical address to virtual address mapping; >>> turns the MMU on; enables branch prediction; activates any >>> integrated >>> @@ -539,4 +541,9 @@ is_a15_a7: >>> page_tables: >>> PT7(0x1c0e) >>> -#endif //#if defined(__ARM_ARCH_7A__) || __ARM_ARCH_PROFILE == 'A' >>> +#elif (__ARM_ARCH_PROFILE == 'M') >>> + /* On M-profile, call abort in case of hardfault: this causes >>> the simulator to >>> + abort execution instead of going into an infinite loop. */ >>> + .section .hardfault_handler_addr, "a" >>> + .word abort >>> +#endif //#if defined(__ARM_ARCH_7A__) || (__ARM_ARCH_PROFILE == 'A') >>> diff --git a/libgloss/arm/elf-mprofile-mps2.specs b/libgloss/arm/elf- >>> mprofile-mps2.specs >>> new file mode 100644 >>> index 000000000..edaf71917 >>> --- /dev/null >>> +++ b/libgloss/arm/elf-mprofile-mps2.specs >>> @@ -0,0 +1,26 @@ >>> +# rdimon.specs >>> +# >>> +# Spec file for AArch32 M profile baremetal newlib with version 2 of >>> +# the AngelAPI semi-hosting using the SVC trap instruction. >>> +# >>> +# This version supports extensibility through an extension mechanism. >>> + >>> +%rename link_gcc_c_sequence rdimon_link_gcc_c_sequence >>> + >>> +%rename link old_link >>> + >>> +*link: >>> +--section-start=.hardfault_handler_addr=0xc %(old_link) >>> + >>> +*rdimon_libc: >>> +%{!specs=nano.specs:-lc} %{specs=nano.specs:-lc_nano} >>> + >>> +*rdimon_libgloss: >>> +%{!specs=nano.specs:-lrdimon} %{specs=nano.specs:-lrdimon_nano} >>> + >>> +*link_gcc_c_sequence: >>> +%(rdimon_link_gcc_c_sequence) --start-group %G %(rdimon_libc) >>> %(rdimon_libgloss) --end-group >>> + >>> +*startfile: >>> +crti%O%s crtbegin%O%s cpu-init/rdimon-aem.o%s %{!pg:rdimon-crt0%O%s} >>> %{pg:rdimon-crt0%O%s} >>> + >> >
This series is OK. Thanks R. On 12/06/2026 16:53, Christophe Lyon wrote: > After reaching a hardfault, the simulator enters an infinite loop > unless we map the handler to 'abort'. > > The patch adds this minimal setup for M-profile in > libgloss/arm/cpu-init/rdimon-aem.S and introduces the new > libgloss/arm/elf-mprofile-mps2.specs to add the mapping to the right > memory address. > > 2026-05-29 Andre Vieira <andre.simoesdiasvieira@arm.com> > Christophe Lyon <christophe.lyon@arm.com> > > libgloss/ > * Makefile.in: Add entry for arm/mprofile-mps2.specs. > * arm/Makefile.inc: Add entry for mprofile-mps2.specs. > * arm/cpu-init/rdimon-aem.S: Update comment. Add hardfault > handler. > * arm/elf-mprofile-mps2.specs: New file. > --- > libgloss/Makefile.in | 1 + > libgloss/arm/Makefile.inc | 3 ++- > libgloss/arm/cpu-init/rdimon-aem.S | 11 +++++++++-- > libgloss/arm/elf-mprofile-mps2.specs | 26 ++++++++++++++++++++++++++ > 4 files changed, 38 insertions(+), 3 deletions(-) > create mode 100644 libgloss/arm/elf-mprofile-mps2.specs > > diff --git a/libgloss/Makefile.in b/libgloss/Makefile.in > index 5146a7880..c03ea4e6b 100644 > --- a/libgloss/Makefile.in > +++ b/libgloss/Makefile.in > @@ -2255,6 +2255,7 @@ TEXINFO_TEX = ../texinfo/texinfo.tex > @CONFIG_ARM_TRUE@ arm/aprofile-validation-v2m.specs \ > @CONFIG_ARM_TRUE@ arm/aprofile-ve-v2m.specs \ > @CONFIG_ARM_TRUE@ arm/aprofile-ve.specs arm/pid.specs \ > +@CONFIG_ARM_TRUE@ arm/mprofile-mps2.specs \ > @CONFIG_ARM_TRUE@ arm/iq80310.specs > @CONFIG_ARM_TRUE@arm_libgloss_linux_a_SOURCES = \ > @CONFIG_ARM_TRUE@ arm/linux-syscalls0.c \ > diff --git a/libgloss/arm/Makefile.inc b/libgloss/arm/Makefile.inc > index 41fce3c99..5c740edcb 100644 > --- a/libgloss/arm/Makefile.inc > +++ b/libgloss/arm/Makefile.inc > @@ -47,7 +47,8 @@ multilibtool_LIBRARIES += %D%/librdpmon.a > %D%/aprofile-validation.specs \ > %D%/aprofile-validation-v2m.specs \ > %D%/aprofile-ve-v2m.specs \ > - %D%/aprofile-ve.specs > + %D%/aprofile-ve.specs \ > + %D%/mprofile-mps2.specs > multilibtool_DATA += \ > %D%/rdimon-crt0.o \ > %D%/rdimon-crt0-v2m.o > diff --git a/libgloss/arm/cpu-init/rdimon-aem.S b/libgloss/arm/cpu-init/rdimon-aem.S > index 2aacbeba9..c960924d4 100644 > --- a/libgloss/arm/cpu-init/rdimon-aem.S > +++ b/libgloss/arm/cpu-init/rdimon-aem.S > @@ -25,7 +25,9 @@ > > /* This file gives a basic initialisation of a Cortex-A series core. It is > the bare minimum required to get Cortex-A core running with a semihosting > - interface. > + interface. For M-profile we only define a hardfault handler, required to > + prevent the simulator from entering into an infinite loop. The comments > + below apply to A-profile only. > > It sets up a basic 1:1 phsyical address to virtual address mapping; > turns the MMU on; enables branch prediction; activates any integrated > @@ -539,4 +541,9 @@ is_a15_a7: > page_tables: > PT7(0x1c0e) > > -#endif //#if defined(__ARM_ARCH_7A__) || __ARM_ARCH_PROFILE == 'A' > +#elif (__ARM_ARCH_PROFILE == 'M') > + /* On M-profile, call abort in case of hardfault: this causes the simulator to > + abort execution instead of going into an infinite loop. */ > + .section .hardfault_handler_addr, "a" > + .word abort > +#endif //#if defined(__ARM_ARCH_7A__) || (__ARM_ARCH_PROFILE == 'A') > diff --git a/libgloss/arm/elf-mprofile-mps2.specs b/libgloss/arm/elf-mprofile-mps2.specs > new file mode 100644 > index 000000000..edaf71917 > --- /dev/null > +++ b/libgloss/arm/elf-mprofile-mps2.specs > @@ -0,0 +1,26 @@ > +# rdimon.specs > +# > +# Spec file for AArch32 M profile baremetal newlib with version 2 of > +# the AngelAPI semi-hosting using the SVC trap instruction. > +# > +# This version supports extensibility through an extension mechanism. > + > +%rename link_gcc_c_sequence rdimon_link_gcc_c_sequence > + > +%rename link old_link > + > +*link: > +--section-start=.hardfault_handler_addr=0xc %(old_link) > + > +*rdimon_libc: > +%{!specs=nano.specs:-lc} %{specs=nano.specs:-lc_nano} > + > +*rdimon_libgloss: > +%{!specs=nano.specs:-lrdimon} %{specs=nano.specs:-lrdimon_nano} > + > +*link_gcc_c_sequence: > +%(rdimon_link_gcc_c_sequence) --start-group %G %(rdimon_libc) %(rdimon_libgloss) --end-group > + > +*startfile: > +crti%O%s crtbegin%O%s cpu-init/rdimon-aem.o%s %{!pg:rdimon-crt0%O%s} %{pg:rdimon-crt0%O%s} > +
diff --git a/libgloss/Makefile.in b/libgloss/Makefile.in index 5146a7880..c03ea4e6b 100644 --- a/libgloss/Makefile.in +++ b/libgloss/Makefile.in @@ -2255,6 +2255,7 @@ TEXINFO_TEX = ../texinfo/texinfo.tex @CONFIG_ARM_TRUE@ arm/aprofile-validation-v2m.specs \ @CONFIG_ARM_TRUE@ arm/aprofile-ve-v2m.specs \ @CONFIG_ARM_TRUE@ arm/aprofile-ve.specs arm/pid.specs \ +@CONFIG_ARM_TRUE@ arm/mprofile-mps2.specs \ @CONFIG_ARM_TRUE@ arm/iq80310.specs @CONFIG_ARM_TRUE@arm_libgloss_linux_a_SOURCES = \ @CONFIG_ARM_TRUE@ arm/linux-syscalls0.c \ diff --git a/libgloss/arm/Makefile.inc b/libgloss/arm/Makefile.inc index 41fce3c99..5c740edcb 100644 --- a/libgloss/arm/Makefile.inc +++ b/libgloss/arm/Makefile.inc @@ -47,7 +47,8 @@ multilibtool_LIBRARIES += %D%/librdpmon.a %D%/aprofile-validation.specs \ %D%/aprofile-validation-v2m.specs \ %D%/aprofile-ve-v2m.specs \ - %D%/aprofile-ve.specs + %D%/aprofile-ve.specs \ + %D%/mprofile-mps2.specs multilibtool_DATA += \ %D%/rdimon-crt0.o \ %D%/rdimon-crt0-v2m.o diff --git a/libgloss/arm/cpu-init/rdimon-aem.S b/libgloss/arm/cpu-init/rdimon-aem.S index 2aacbeba9..c960924d4 100644 --- a/libgloss/arm/cpu-init/rdimon-aem.S +++ b/libgloss/arm/cpu-init/rdimon-aem.S @@ -25,7 +25,9 @@ /* This file gives a basic initialisation of a Cortex-A series core. It is the bare minimum required to get Cortex-A core running with a semihosting - interface. + interface. For M-profile we only define a hardfault handler, required to + prevent the simulator from entering into an infinite loop. The comments + below apply to A-profile only. It sets up a basic 1:1 phsyical address to virtual address mapping; turns the MMU on; enables branch prediction; activates any integrated @@ -539,4 +541,9 @@ is_a15_a7: page_tables: PT7(0x1c0e) -#endif //#if defined(__ARM_ARCH_7A__) || __ARM_ARCH_PROFILE == 'A' +#elif (__ARM_ARCH_PROFILE == 'M') + /* On M-profile, call abort in case of hardfault: this causes the simulator to + abort execution instead of going into an infinite loop. */ + .section .hardfault_handler_addr, "a" + .word abort +#endif //#if defined(__ARM_ARCH_7A__) || (__ARM_ARCH_PROFILE == 'A') diff --git a/libgloss/arm/elf-mprofile-mps2.specs b/libgloss/arm/elf-mprofile-mps2.specs new file mode 100644 index 000000000..edaf71917 --- /dev/null +++ b/libgloss/arm/elf-mprofile-mps2.specs @@ -0,0 +1,26 @@ +# rdimon.specs +# +# Spec file for AArch32 M profile baremetal newlib with version 2 of +# the AngelAPI semi-hosting using the SVC trap instruction. +# +# This version supports extensibility through an extension mechanism. + +%rename link_gcc_c_sequence rdimon_link_gcc_c_sequence + +%rename link old_link + +*link: +--section-start=.hardfault_handler_addr=0xc %(old_link) + +*rdimon_libc: +%{!specs=nano.specs:-lc} %{specs=nano.specs:-lc_nano} + +*rdimon_libgloss: +%{!specs=nano.specs:-lrdimon} %{specs=nano.specs:-lrdimon_nano} + +*link_gcc_c_sequence: +%(rdimon_link_gcc_c_sequence) --start-group %G %(rdimon_libc) %(rdimon_libgloss) --end-group + +*startfile: +crti%O%s crtbegin%O%s cpu-init/rdimon-aem.o%s %{!pg:rdimon-crt0%O%s} %{pg:rdimon-crt0%O%s} +