From patchwork Wed Dec 12 09:12:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 153557 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1597780ljp; Wed, 12 Dec 2018 01:12:19 -0800 (PST) X-Google-Smtp-Source: AFSGD/WPx3MgOzGwzBClr9PWX3axZcCCjXE/1zi4bGdtfsoM5bcdbFJo9bvD6/49OuifCiHmoNMt X-Received: by 2002:a62:d148:: with SMTP id t8mr19978050pfl.52.1544605939587; Wed, 12 Dec 2018 01:12:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544605939; cv=none; d=google.com; s=arc-20160816; b=Op28QvVU0hhGbyVW5LalMSEpieg16Z9+X5WDNh/frK2JspziZrA2okFZ89dSeRCJ3Q l0rhkMSzIA2i6s6m0ScXEsXLt3ED/CZpq8KI2Qb/CohEZ/2Q4p+4KzX+Qol8Mpi3k3K5 x51KHSD9MPBKSzl2wFni0EkcpcsihRrdZXQRwoPMJTo2EaXyxzvt09Q+qPpf2gmm89uU KWDJS3f8iTvW1GGVyz7Z8snFJvOQJVieAtgRb+y3Dmb/cX5RH6Jy1PgxjGSvWKjp01ra NfXwwmvxVpq0SwNUctUfMGHoSIU128E2V9U9L/m907u1lTY6/RLaIe8qbFoMOC9kY/7K Nlgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:date:to:from:dkim-signature:delivered-to; bh=iGOZnChwPNZBj9qzBY6o4DM1ss49FHjTaEUQt+ggXLM=; b=m+/oqEYIgbmT+Y2PChViJ8JPwdKfTzDA1sCZFMqvVMSmMncRg1UiaHQJ3Zt9LucXEL KIc6UdlDR1O8B1PjqCtFfp9/VoGxXu428HkNO4Q3vdk1acfe/ssZBeu9jeXvEwqm77CU 0suReJi9VfVESJov2m18BZmwVixjwcuLdM1PQajdn2acphc5DAQ2jaLLkVzvi7PBHpOL b+WgA/OGx3lCJ6aV3pn5rDm1chLSEg25xNWI+XfNVIERefPwca/ge1Oixg0jE1BOitEz KZD8PhSxthlq+SIWL2euanFcsTOMOTvY5RBcE5ajC5SSvRm41n2Vpzi0f5Ofnr9lXR4k IBeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="Iplm/FV2"; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id s11si2222440pgi.324.2018.12.12.01.12.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Dec 2018 01:12:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="Iplm/FV2"; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 5415F2119C886; Wed, 12 Dec 2018 01:12:18 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::442; helo=mail-wr1-x442.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 291FE2119C883 for ; Wed, 12 Dec 2018 01:12:15 -0800 (PST) Received: by mail-wr1-x442.google.com with SMTP id t27so16847993wra.6 for ; Wed, 12 Dec 2018 01:12:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=WlCi7l/SsSI1ICMMcandgBXKXyV/x7fGQtzIjP/OY18=; b=Iplm/FV25pk9SxZT8Yn66FD8id1JuwNcp7tY1/62mlaTayC75lkFLRm0SBzsm6AsIt +KI3vRi34lwG/5xC18ZzE0e60vjCWcbi4S0jdX54UlEgURWpHPvbrv/TIL5eEsSkWxG0 VtSl9QONznHirbPh7DhnkobC7pUGN0TAi1XKo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=WlCi7l/SsSI1ICMMcandgBXKXyV/x7fGQtzIjP/OY18=; b=gF1R7X69B2l/qejB0fEUxl4Tsfpa28AxJ3ZzuqEBzP/0kYzpfjrBccHd56XSmVHTL8 G9irBXc6Z8K9ECFAwA/msN/k68LVed8xseN1ZZoCdQyAZAS+E1id9riqvTZk6Twd6l83 Oomtm9R/lfRA1YLxR8MYaz2fOW4qdps+rEZVuc75MIvH4v0oCI+WC7zTEpVFCNs5haqq nYq1ThLL9+Ag7wSTZCOkdHJToVbQrUiMWUe++n4Rv7TMvmqdzTQubVoXnZHBxsgp3Rr2 HisDQRFWV35/DqR3H0cGZqR2n8ypFClbO2zuRUUL6QN5bGZp+I4hLoQNK2giUY+ueK20 4UOQ== X-Gm-Message-State: AA+aEWYUHJ8d8T7zgWL09l3m6tC68OPtM17k0OkcLSGq67YkW1fgmj4v 3BoMYRoS7k1giNgR38wcgIfUIvppfSVzLw== X-Received: by 2002:adf:c5d3:: with SMTP id v19mr16227367wrg.30.1544605934072; Wed, 12 Dec 2018 01:12:14 -0800 (PST) Received: from harold.home ([2a01:cb1d:112:6f00:1db:abd7:f798:3277]) by smtp.gmail.com with ESMTPSA id v133sm2128278wmf.19.2018.12.12.01.12.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Dec 2018 01:12:13 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Wed, 12 Dec 2018 10:12:11 +0100 Message-Id: <20181212091211.13258-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 Subject: [edk2] [PATCH] EmbeddedPkg/GdbDebugAgent ARM: use modern dialect for ldm/stm instructions X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Clang does not like the legacy 32-bit assembler syntax used in the gdbstub exception handling routines, so update them to something more fashionable. So switch the order of the conditional suffix and the increment/decrement specifier, and use decrement-after (da) and increment-before (ib) as appropriate for an empty descending stack. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- EmbeddedPkg/Library/GdbDebugAgent/Arm/ExceptionSupport.ARMv6.S | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) -- 2.19.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/EmbeddedPkg/Library/GdbDebugAgent/Arm/ExceptionSupport.ARMv6.S b/EmbeddedPkg/Library/GdbDebugAgent/Arm/ExceptionSupport.ARMv6.S index df1543a6d242..924578c7af2f 100644 --- a/EmbeddedPkg/Library/GdbDebugAgent/Arm/ExceptionSupport.ARMv6.S +++ b/EmbeddedPkg/Library/GdbDebugAgent/Arm/ExceptionSupport.ARMv6.S @@ -57,6 +57,7 @@ GCC_ASM_EXPORT(AsmCommonExceptionEntry) GCC_ASM_EXPORT(GdbExceptionHandler) .text +.syntax unified .align 3 @@ -198,9 +199,9 @@ ASM_PFX(AsmCommonExceptionEntry): and R3, R1, #0x1f @ Check CPSR to see if User or System Mode cmp R3, #0x1f @ if ((CPSR == 0x10) || (CPSR == 0x1df)) cmpne R3, #0x10 @ - stmeqed R2, {lr}^ @ save unbanked lr + stmdaeq R2, {lr}^ @ save unbanked lr @ else - stmneed R2, {lr} @ save SVC lr + stmdane R2, {lr} @ save SVC lr ldr R5, [SP, #0x58] @ PC is the LR pushed by srsfd @@ -245,9 +246,9 @@ GdbExceptionHandler ( and R1, R1, #0x1f @ Check to see if User or System Mode cmp R1, #0x1f @ if ((CPSR == 0x10) || (CPSR == 0x1f)) cmpne R1, #0x10 @ - ldmeqed R2, {lr}^ @ restore unbanked lr + ldmibeq R2, {lr}^ @ restore unbanked lr @ else - ldmneed R3, {lr} @ restore SVC lr, via ldmfd SP!, {LR} + ldmibne R3, {lr} @ restore SVC lr, via ldmfd SP!, {LR} ldmfd SP!,{R0-R12} @ Restore general purpose registers @ Exception handler can not change SP