From patchwork Tue Jan 15 08:23:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 155638 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp4610401jaa; Tue, 15 Jan 2019 00:23:55 -0800 (PST) X-Google-Smtp-Source: ALg8bN6MlKlBdqP7Xlcnjobi7bCiDIiems/BNR/yu67yLs+0wy1cEbvBabyCqexkPe7XAhofPP8D X-Received: by 2002:a62:5fc4:: with SMTP id t187mr2836318pfb.66.1547540635484; Tue, 15 Jan 2019 00:23:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547540635; cv=none; d=google.com; s=arc-20160816; b=PHjRLYXFHquzR4CtTnrZ0aRq9emjWkVYlLt+Oc5o0G2EcNK4/Duyf3agPbYM+LzfgY zQN6sSjFTOqy50J6QKyp0qjKAisA5ibzEJB7uc/3ak8gIKbZqr7J65KdLNy2jXfMZCaW QSzze1A7MDVQy1PAHLEwsmGoGAhp3PGHmIufkOh546Gz/3J6I7GLRymGv8d/D2vzlOoM eCeugH/doU0P6nfMYXTwzxdaTj5zJQglpkstZPoRWifNRi+3y0W5Vz3uu0H1apJYLjBU wjH2OneED6KMnZIooIr0tNRgSk2MbtiASB24BwF0kK0uwlBY7h3MUY0FBjuiluHuidtX PfCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=QNF71L27HaQem3Vv62p4efyGKctLWVx5oP8aoln7X6k=; b=ICHe88RuUXydJGtRXqf1mGlfM3DgkHY+vfWeEnIGrvSNI3SfDCQBRsUEPygN/18q4C nIYFV3z0McHz8B91F4wnn0vTxj1mDVdEmEfIxQcfAzsPWg7QivzKuysav0oc/Z4aHbgF HvpNcfm5JbTT0qCfSe4QtXUbdWvT6D37br5OxLBcmEhw49YrDPW1MnRfam/lhUZMRvbA M+7J95lcwZE8UFS/lZcHGJBE9f39wvpfWWGHK+rV47xZz2NPVvLMoQWVO7y38FhUA+nT BF3c9EIrEoJpj2eF5HimpyKb2uCyrkxLsbxnbm/23QpiNzoy6p5wenOVyi9+CSwJyIDX eerw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=bbudpCLu; 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 gn8si2538854plb.264.2019.01.15.00.23.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Jan 2019 00:23:55 -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=bbudpCLu; 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 151C3211B76B0; Tue, 15 Jan 2019 00:23:55 -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::435; helo=mail-wr1-x435.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) (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 86779211B736F for ; Tue, 15 Jan 2019 00:23:52 -0800 (PST) Received: by mail-wr1-x435.google.com with SMTP id j2so1904219wrw.1 for ; Tue, 15 Jan 2019 00:23:52 -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:in-reply-to:references; bh=NQ/0UQ8gKyD+SRkfqPOaA43HhuxSQALpz22XRXitgq0=; b=bbudpCLu1BzYBGA3Iij1/fSZDt/w0/lgn1SW8Vu1z38Yb0znNyjyBZoXDWROG+HRJX 0NwtLCY97Xsy1RqAHa8NtnxaFDdoMpLch0o4BByO1teLGlCJOyikSVuS0BnkA3tKQLVO HmkiMLzyyxKR3hggylnMn9URe9uxuQT5Bg9qU= 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:in-reply-to :references; bh=NQ/0UQ8gKyD+SRkfqPOaA43HhuxSQALpz22XRXitgq0=; b=pXzvIho9A1de2xxwq1CFHScc3L8Wfs0YXp3b/bqkSbbaNXXHdb5101sKVcbY/XuUDK aRM2H8s5G2VKP3jUGGLT2vFWl2YYanpUaMGL0ouk31J9zi3Bz2CE61Jsr2duUSFfdIPf b56I9txbUDhrOCLbo7fon0+4ASe8LmyZnYzHgoqDKZncLlNvjgdlKhor1RuCz8IKhgwU hGBPTkkBPC3sEJoIZmRvO3YyNKhI5NGd62vuFAeXbDxv3zknzGHqgc5iG1aFk/ZLhrOZ Nzo7GteHeg1SBVM7N8LIeX/pxVqvAFvBbak0RdB96fjhja02XQANKgvgT86e4lQfshua RdHw== X-Gm-Message-State: AJcUukc8HLM2R07IVzTh7IssQV5GMySKCRMn5MbvOSQZE+A+a/S7BMzJ inl9t5rILbsJ3PlZKD0CuTGkEZYBscwjYA== X-Received: by 2002:adf:f9cb:: with SMTP id w11mr1907260wrr.201.1547540630266; Tue, 15 Jan 2019 00:23:50 -0800 (PST) Received: from dogfood.home ([2a01:cb1d:112:6f00:c8d1:b905:1bdd:adb6]) by smtp.gmail.com with ESMTPSA id 67sm120697983wra.37.2019.01.15.00.23.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Jan 2019 00:23:49 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Tue, 15 Jan 2019 09:23:41 +0100 Message-Id: <20190115082345.3711-2-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190115082345.3711-1-ard.biesheuvel@linaro.org> References: <20190115082345.3711-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH v2 1/5] ArmPkg/DebugAgentSymbolsBaseLib: remove exception handling 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: , Cc: lersek@redhat.com MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" DebugAgentSymbolsBaseLib is an optional library that is in charge of extracting debug headers from SEC and PEI_CORE images in memory so the filename and the offset in memory can be reported via the UART, allowing a developer to load debugging symbols into his debugger. Interestingly enough, DebugAgentSymbolsBaseLib is also in charge of exception handling before this duty is taken over by either the PEI core, or the CPU DXE driver when running under PrePi. Since exceptions are not actually handled at all on AArch64, and simply routed to the DefaultExceptionHandlerLib (for which a special version has been created to be usable this early), let's get rid of this dubious functionality altogether. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel Reviewed-by: Leif Lindholm --- ArmPkg/Library/DebugAgentSymbolsBaseLib/AArch64/DebugAgentException.S | 96 ------- ArmPkg/Library/DebugAgentSymbolsBaseLib/Arm/DebugAgentException.S | 277 -------------------- ArmPkg/Library/DebugAgentSymbolsBaseLib/Arm/DebugAgentException.asm | 273 ------------------- ArmPkg/Library/DebugAgentSymbolsBaseLib/DebugAgentSymbolsBaseLib.c | 7 - ArmPkg/Library/DebugAgentSymbolsBaseLib/DebugAgentSymbolsBaseLib.inf | 9 - 5 files changed, 662 deletions(-) -- 2.17.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/ArmPkg/Library/DebugAgentSymbolsBaseLib/AArch64/DebugAgentException.S b/ArmPkg/Library/DebugAgentSymbolsBaseLib/AArch64/DebugAgentException.S deleted file mode 100644 index f33a07a19bad..000000000000 --- a/ArmPkg/Library/DebugAgentSymbolsBaseLib/AArch64/DebugAgentException.S +++ /dev/null @@ -1,96 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.
-# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -#------------------------------------------------------------------------------ - -#include - -GCC_ASM_IMPORT(DefaultExceptionHandler) - -.text -VECTOR_BASE(DebugAgentVectorTable) - -// -// Current EL with SP0 : 0x0 - 0x180 -// -VECTOR_ENTRY(DebugAgentVectorTable, ARM_VECTOR_CUR_SP0_SYNC) -ASM_PFX(SynchronousExceptionSP0): - b ASM_PFX(SynchronousExceptionSP0) - -VECTOR_ENTRY(DebugAgentVectorTable, ARM_VECTOR_CUR_SP0_IRQ) -ASM_PFX(IrqSP0): - b ASM_PFX(IrqSP0) - -VECTOR_ENTRY(DebugAgentVectorTable, ARM_VECTOR_CUR_SP0_FIQ) -ASM_PFX(FiqSP0): - b ASM_PFX(FiqSP0) - -VECTOR_ENTRY(DebugAgentVectorTable, ARM_VECTOR_CUR_SP0_SERR) -ASM_PFX(SErrorSP0): - b ASM_PFX(SErrorSP0) - -// -// Current EL with SPx: 0x200 - 0x380 -// -VECTOR_ENTRY(DebugAgentVectorTable, ARM_VECTOR_CUR_SPx_SYNC) -ASM_PFX(SynchronousExceptionSPx): - b ASM_PFX(SynchronousExceptionSPx) - -VECTOR_ENTRY(DebugAgentVectorTable, ARM_VECTOR_CUR_SPx_IRQ) -ASM_PFX(IrqSPx): - b ASM_PFX(IrqSPx) - -VECTOR_ENTRY(DebugAgentVectorTable, ARM_VECTOR_CUR_SPx_FIQ) -ASM_PFX(FiqSPx): - b ASM_PFX(FiqSPx) - -VECTOR_ENTRY(DebugAgentVectorTable, ARM_VECTOR_CUR_SPx_SERR) -ASM_PFX(SErrorSPx): - b ASM_PFX(SErrorSPx) - -/* Lower EL using AArch64 : 0x400 - 0x580 */ -VECTOR_ENTRY(DebugAgentVectorTable, ARM_VECTOR_LOW_A64_SYNC) -ASM_PFX(SynchronousExceptionA64): - b ASM_PFX(SynchronousExceptionA64) - -VECTOR_ENTRY(DebugAgentVectorTable, ARM_VECTOR_LOW_A64_IRQ) -ASM_PFX(IrqA64): - b ASM_PFX(IrqA64) - -VECTOR_ENTRY(DebugAgentVectorTable, ARM_VECTOR_LOW_A64_FIQ) -ASM_PFX(FiqA64): - b ASM_PFX(FiqA64) - -VECTOR_ENTRY(DebugAgentVectorTable, ARM_VECTOR_LOW_A64_SERR) -ASM_PFX(SErrorA64): - b ASM_PFX(SErrorA64) - -// -// Lower EL using AArch32 : 0x600 - 0x780 -// -VECTOR_ENTRY(DebugAgentVectorTable, ARM_VECTOR_LOW_A32_SYNC) -ASM_PFX(SynchronousExceptionA32): - b ASM_PFX(SynchronousExceptionA32) - -VECTOR_ENTRY(DebugAgentVectorTable, ARM_VECTOR_LOW_A32_IRQ) -ASM_PFX(IrqA32): - b ASM_PFX(IrqA32) - -VECTOR_ENTRY(DebugAgentVectorTable, ARM_VECTOR_LOW_A32_FIQ) -ASM_PFX(FiqA32): - b ASM_PFX(FiqA32) - -VECTOR_ENTRY(DebugAgentVectorTable, ARM_VECTOR_LOW_A32_SERR) -ASM_PFX(SErrorA32): - b ASM_PFX(SErrorA32) - -VECTOR_END(DebugAgentVectorTable) diff --git a/ArmPkg/Library/DebugAgentSymbolsBaseLib/Arm/DebugAgentException.S b/ArmPkg/Library/DebugAgentSymbolsBaseLib/Arm/DebugAgentException.S deleted file mode 100644 index 215181460803..000000000000 --- a/ArmPkg/Library/DebugAgentSymbolsBaseLib/Arm/DebugAgentException.S +++ /dev/null @@ -1,277 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.
-# Copyright (c) 2011 - 2012, ARM Ltd. All rights reserved.
-# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -#------------------------------------------------------------------------------ - -#include - -/* - -This is the stack constructed by the exception handler (low address to high address) - # R0 - IFAR is EFI_SYSTEM_CONTEXT for ARM - Reg Offset - === ====== - R0 0x00 # stmfd SP!,{R0-R12} - R1 0x04 - R2 0x08 - R3 0x0c - R4 0x10 - R5 0x14 - R6 0x18 - R7 0x1c - R8 0x20 - R9 0x24 - R10 0x28 - R11 0x2c - R12 0x30 - SP 0x34 # reserved via adding 0x20 (32) to the SP - LR 0x38 - PC 0x3c - CPSR 0x40 - DFSR 0x44 - DFAR 0x48 - IFSR 0x4c - IFAR 0x50 - - LR 0x54 # SVC Link register (we need to restore it) - - LR 0x58 # pushed by srsfd - CPSR 0x5c - - */ - -GCC_ASM_EXPORT(DebugAgentVectorTable) -GCC_ASM_IMPORT(DefaultExceptionHandler) - -.text -.syntax unified -#if !defined(__APPLE__) -.fpu neon @ makes vpush/vpop assemble -#endif -.align 5 - - -// -// This code gets copied to the ARM vector table -// ExceptionHandlersStart - ExceptionHandlersEnd gets copied -// -ASM_PFX(DebugAgentVectorTable): - b ASM_PFX(ResetEntry) - b ASM_PFX(UndefinedInstructionEntry) - b ASM_PFX(SoftwareInterruptEntry) - b ASM_PFX(PrefetchAbortEntry) - b ASM_PFX(DataAbortEntry) - b ASM_PFX(ReservedExceptionEntry) - b ASM_PFX(IrqEntry) - b ASM_PFX(FiqEntry) - -ASM_PFX(ResetEntry): - srsdb #0x13! @ Store return state on SVC stack - @ We are already in SVC mode - - stmfd SP!,{LR} @ Store the link register for the current mode - sub SP,SP,#0x20 @ Save space for SP, LR, PC, IFAR - CPSR - stmfd SP!,{R0-R12} @ Store the register state - - mov R0,#0 @ ExceptionType - ldr R1,ASM_PFX(CommonExceptionEntry) - bx R1 - -ASM_PFX(UndefinedInstructionEntry): - sub LR, LR, #4 @ Only -2 for Thumb, adjust in CommonExceptionEntry - srsdb #0x13! @ Store return state on SVC stack - cps #0x13 @ Switch to SVC for common stack - stmfd SP!,{LR} @ Store the link register for the current mode - sub SP,SP,#0x20 @ Save space for SP, LR, PC, IFAR - CPSR - stmfd SP!,{R0-R12} @ Store the register state - - mov R0,#1 @ ExceptionType - ldr R1,ASM_PFX(CommonExceptionEntry) - bx R1 - -ASM_PFX(SoftwareInterruptEntry): - sub LR, LR, #4 @ Only -2 for Thumb, adjust in CommonExceptionEntry - srsdb #0x13! @ Store return state on SVC stack - @ We are already in SVC mode - stmfd SP!,{LR} @ Store the link register for the current mode - sub SP,SP,#0x20 @ Save space for SP, LR, PC, IFAR - CPSR - stmfd SP!,{R0-R12} @ Store the register state - - mov R0,#2 @ ExceptionType - ldr R1,ASM_PFX(CommonExceptionEntry) - bx R1 - -ASM_PFX(PrefetchAbortEntry): - sub LR,LR,#4 - srsdb #0x13! @ Store return state on SVC stack - cps #0x13 @ Switch to SVC for common stack - stmfd SP!,{LR} @ Store the link register for the current mode - sub SP,SP,#0x20 @ Save space for SP, LR, PC, IFAR - CPSR - stmfd SP!,{R0-R12} @ Store the register state - - mov R0,#3 @ ExceptionType - ldr R1,ASM_PFX(CommonExceptionEntry) - bx R1 - -ASM_PFX(DataAbortEntry): - sub LR,LR,#8 - srsdb #0x13! @ Store return state on SVC stack - cps #0x13 @ Switch to SVC for common stack - stmfd SP!,{LR} @ Store the link register for the current mode - sub SP,SP,#0x20 @ Save space for SP, LR, PC, IFAR - CPSR - stmfd SP!,{R0-R12} @ Store the register state - - mov R0,#4 - ldr R1,ASM_PFX(CommonExceptionEntry) - bx R1 - -ASM_PFX(ReservedExceptionEntry): - srsdb #0x13! @ Store return state on SVC stack - cps #0x13 @ Switch to SVC for common stack - stmfd SP!,{LR} @ Store the link register for the current mode - sub SP,SP,#0x20 @ Save space for SP, LR, PC, IFAR - CPSR - stmfd SP!,{R0-R12} @ Store the register state - - mov R0,#5 - ldr R1,ASM_PFX(CommonExceptionEntry) - bx R1 - -ASM_PFX(IrqEntry): - sub LR,LR,#4 - srsdb #0x13! @ Store return state on SVC stack - cps #0x13 @ Switch to SVC for common stack - stmfd SP!,{LR} @ Store the link register for the current mode - sub SP,SP,#0x20 @ Save space for SP, LR, PC, IFAR - CPSR - stmfd SP!,{R0-R12} @ Store the register state - - mov R0,#6 @ ExceptionType - ldr R1,ASM_PFX(CommonExceptionEntry) - bx R1 - -ASM_PFX(FiqEntry): - sub LR,LR,#4 - srsdb #0x13! @ Store return state on SVC stack - cps #0x13 @ Switch to SVC for common stack - stmfd SP!,{LR} @ Store the link register for the current mode - sub SP,SP,#0x20 @ Save space for SP, LR, PC, IFAR - CPSR - stmfd SP!,{R0-R12} @ Store the register state - @ Since we have already switch to SVC R8_fiq - R12_fiq - @ never get used or saved - mov R0,#7 @ ExceptionType - ldr R1,ASM_PFX(CommonExceptionEntry) - bx R1 - -// -// This gets patched by the C code that patches in the vector table -// -ASM_PFX(CommonExceptionEntry): - .word ASM_PFX(AsmCommonExceptionEntry) - -ASM_PFX(ExceptionHandlersEnd): - -// -// This code runs from CpuDxe driver loaded address. It is patched into -// CommonExceptionEntry. -// -ASM_PFX(AsmCommonExceptionEntry): - mrc p15, 0, R1, c6, c0, 2 @ Read IFAR - str R1, [SP, #0x50] @ Store it in EFI_SYSTEM_CONTEXT_ARM.IFAR - - mrc p15, 0, R1, c5, c0, 1 @ Read IFSR - str R1, [SP, #0x4c] @ Store it in EFI_SYSTEM_CONTEXT_ARM.IFSR - - mrc p15, 0, R1, c6, c0, 0 @ Read DFAR - str R1, [SP, #0x48] @ Store it in EFI_SYSTEM_CONTEXT_ARM.DFAR - - mrc p15, 0, R1, c5, c0, 0 @ Read DFSR - str R1, [SP, #0x44] @ Store it in EFI_SYSTEM_CONTEXT_ARM.DFSR - - ldr R1, [SP, #0x5c] @ srsdb saved pre-exception CPSR on the stack - str R1, [SP, #0x40] @ Store it in EFI_SYSTEM_CONTEXT_ARM.CPSR - - add R2, SP, #0x38 @ Make R2 point to EFI_SYSTEM_CONTEXT_ARM.LR - and R3, R1, #0x1f @ Check CPSR to see if User or System Mode - cmp R3, #0x1f @ if ((CPSR == 0x10) || (CPSR == 0x1df)) - cmpne R3, #0x10 @ - stmdaeq R2, {lr}^ @ save unbanked lr - @ else - stmdane R2, {lr} @ save SVC lr - - - ldr R5, [SP, #0x58] @ PC is the LR pushed by srsfd - @ Check to see if we have to adjust for Thumb entry - sub r4, r0, #1 @ if (ExceptionType == 1 || ExceptionType ==2)) { - cmp r4, #1 @ // UND & SVC have different LR adjust for Thumb - bhi NoAdjustNeeded - - tst r1, #0x20 @ if ((CPSR & T)) == T) { // Thumb Mode on entry - addne R5, R5, #2 @ PC += 2@ - str R5,[SP,#0x58] @ Update LR value pused by srsfd - -NoAdjustNeeded: - - str R5, [SP, #0x3c] @ Store it in EFI_SYSTEM_CONTEXT_ARM.PC - - sub R1, SP, #0x60 @ We pused 0x60 bytes on the stack - str R1, [SP, #0x34] @ Store it in EFI_SYSTEM_CONTEXT_ARM.SP - - @ R0 is ExceptionType - mov R1,SP @ R1 is SystemContext - -#if (FixedPcdGet32(PcdVFPEnabled)) - vpush {d0-d15} @ save vstm registers in case they are used in optimizations -#endif - -/* -VOID -EFIAPI -DefaultExceptionHandler ( - IN EFI_EXCEPTION_TYPE ExceptionType, R0 - IN OUT EFI_SYSTEM_CONTEXT SystemContext R1 - ) - -*/ - blx ASM_PFX(DefaultExceptionHandler) @ Call exception handler - -#if (FixedPcdGet32(PcdVFPEnabled)) - vpop {d0-d15} -#endif - - ldr R1, [SP, #0x4c] @ Restore EFI_SYSTEM_CONTEXT_ARM.IFSR - mcr p15, 0, R1, c5, c0, 1 @ Write IFSR - - ldr R1, [SP, #0x44] @ sRestore EFI_SYSTEM_CONTEXT_ARM.DFSR - mcr p15, 0, R1, c5, c0, 0 @ Write DFSR - - ldr R1,[SP,#0x3c] @ EFI_SYSTEM_CONTEXT_ARM.PC - str R1,[SP,#0x58] @ Store it back to srsfd stack slot so it can be restored - - ldr R1,[SP,#0x40] @ EFI_SYSTEM_CONTEXT_ARM.CPSR - str R1,[SP,#0x5c] @ Store it back to srsfd stack slot so it can be restored - - add R3, SP, #0x54 @ Make R3 point to SVC LR saved on entry - add R2, SP, #0x38 @ Make R2 point to EFI_SYSTEM_CONTEXT_ARM.LR - and R1, R1, #0x1f @ Check to see if User or System Mode - cmp R1, #0x1f @ if ((CPSR == 0x10) || (CPSR == 0x1f)) - cmpne R1, #0x10 @ - ldmibeq R2, {lr}^ @ restore unbanked lr - @ else - ldmibne R3, {lr} @ restore SVC lr, via ldmfd SP!, {LR} - - ldmfd SP!,{R0-R12} @ Restore general purpose registers - @ Exception handler can not change SP - - add SP,SP,#0x20 @ Clear out the remaining stack space - ldmfd SP!,{LR} @ restore the link register for this context - rfefd SP! @ return from exception via srsfd stack slot - diff --git a/ArmPkg/Library/DebugAgentSymbolsBaseLib/Arm/DebugAgentException.asm b/ArmPkg/Library/DebugAgentSymbolsBaseLib/Arm/DebugAgentException.asm deleted file mode 100644 index cf59447bed10..000000000000 --- a/ArmPkg/Library/DebugAgentSymbolsBaseLib/Arm/DebugAgentException.asm +++ /dev/null @@ -1,273 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.
-// Copyright (c) 2011 - 2012, ARM Ltd. All rights reserved.
-// -// This program and the accompanying materials -// are licensed and made available under the terms and conditions of the BSD License -// which accompanies this distribution. The full text of the license may be found at -// http://opensource.org/licenses/bsd-license.php -// -// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -// -//------------------------------------------------------------------------------ - -#include - -/* - -This is the stack constructed by the exception handler (low address to high address) - # R0 - IFAR is EFI_SYSTEM_CONTEXT for ARM - Reg Offset - === ====== - R0 0x00 # stmfd SP!,{R0-R12} - R1 0x04 - R2 0x08 - R3 0x0c - R4 0x10 - R5 0x14 - R6 0x18 - R7 0x1c - R8 0x20 - R9 0x24 - R10 0x28 - R11 0x2c - R12 0x30 - SP 0x34 # reserved via adding 0x20 (32) to the SP - LR 0x38 - PC 0x3c - CPSR 0x40 - DFSR 0x44 - DFAR 0x48 - IFSR 0x4c - IFAR 0x50 - - LR 0x54 # SVC Link register (we need to restore it) - - LR 0x58 # pushed by srsfd - CPSR 0x5c - - */ - - EXPORT DebugAgentVectorTable - IMPORT DefaultExceptionHandler - - PRESERVE8 - AREA DebugAgentException, CODE, READONLY, CODEALIGN, ALIGN=5 - -// -// This code gets copied to the ARM vector table -// ExceptionHandlersStart - ExceptionHandlersEnd gets copied -// -DebugAgentVectorTable FUNCTION - b ResetEntry - b UndefinedInstructionEntry - b SoftwareInterruptEntry - b PrefetchAbortEntry - b DataAbortEntry - b ReservedExceptionEntry - b IrqEntry - b FiqEntry - ENDFUNC - -ResetEntry - srsfd #0x13! ; Store return state on SVC stack - ; We are already in SVC mode - stmfd SP!,{LR} ; Store the link register for the current mode - sub SP,SP,#0x20 ; Save space for SP, LR, PC, IFAR - CPSR - stmfd SP!,{R0-R12} ; Store the register state - - mov R0,#0 ; ExceptionType - ldr R1,CommonExceptionEntry - bx R1 - -UndefinedInstructionEntry - sub LR, LR, #4 ; Only -2 for Thumb, adjust in CommonExceptionEntry - srsfd #0x13! ; Store return state on SVC stack - cps #0x13 ; Switch to SVC for common stack - stmfd SP!,{LR} ; Store the link register for the current mode - sub SP,SP,#0x20 ; Save space for SP, LR, PC, IFAR - CPSR - stmfd SP!,{R0-R12} ; Store the register state - - mov R0,#1 ; ExceptionType - ldr R1,CommonExceptionEntry; - bx R1 - -SoftwareInterruptEntry - sub LR, LR, #4 ; Only -2 for Thumb, adjust in CommonExceptionEntry - srsfd #0x13! ; Store return state on SVC stack - ; We are already in SVC mode - stmfd SP!,{LR} ; Store the link register for the current mode - sub SP,SP,#0x20 ; Save space for SP, LR, PC, IFAR - CPSR - stmfd SP!,{R0-R12} ; Store the register state - - mov R0,#2 ; ExceptionType - ldr R1,CommonExceptionEntry - bx R1 - -PrefetchAbortEntry - sub LR,LR,#4 - srsfd #0x13! ; Store return state on SVC stack - cps #0x13 ; Switch to SVC for common stack - stmfd SP!,{LR} ; Store the link register for the current mode - sub SP,SP,#0x20 ; Save space for SP, LR, PC, IFAR - CPSR - stmfd SP!,{R0-R12} ; Store the register state - - mov R0,#3 ; ExceptionType - ldr R1,CommonExceptionEntry - bx R1 - -DataAbortEntry - sub LR,LR,#8 - srsfd #0x13! ; Store return state on SVC stack - cps #0x13 ; Switch to SVC for common stack - stmfd SP!,{LR} ; Store the link register for the current mode - sub SP,SP,#0x20 ; Save space for SP, LR, PC, IFAR - CPSR - stmfd SP!,{R0-R12} ; Store the register state - - mov R0,#4 ; ExceptionType - ldr R1,CommonExceptionEntry - bx R1 - -ReservedExceptionEntry - srsfd #0x13! ; Store return state on SVC stack - cps #0x13 ; Switch to SVC for common stack - stmfd SP!,{LR} ; Store the link register for the current mode - sub SP,SP,#0x20 ; Save space for SP, LR, PC, IFAR - CPSR - stmfd SP!,{R0-R12} ; Store the register state - - mov R0,#5 ; ExceptionType - ldr R1,CommonExceptionEntry - bx R1 - -IrqEntry - sub LR,LR,#4 - srsfd #0x13! ; Store return state on SVC stack - cps #0x13 ; Switch to SVC for common stack - stmfd SP!,{LR} ; Store the link register for the current mode - sub SP,SP,#0x20 ; Save space for SP, LR, PC, IFAR - CPSR - stmfd SP!,{R0-R12} ; Store the register state - - mov R0,#6 ; ExceptionType - ldr R1,CommonExceptionEntry - bx R1 - -FiqEntry - sub LR,LR,#4 - srsfd #0x13! ; Store return state on SVC stack - cps #0x13 ; Switch to SVC for common stack - stmfd SP!,{LR} ; Store the link register for the current mode - sub SP,SP,#0x20 ; Save space for SP, LR, PC, IFAR - CPSR - stmfd SP!,{R0-R12} ; Store the register state - ; Since we have already switch to SVC R8_fiq - R12_fiq - ; never get used or saved - mov R0,#7 ; ExceptionType - ldr R1,CommonExceptionEntry - bx R1 - -// -// This gets patched by the C code that patches in the vector table -// -CommonExceptionEntry - dcd AsmCommonExceptionEntry - -ExceptionHandlersEnd - -// -// This code runs from CpuDxe driver loaded address. It is patched into -// CommonExceptionEntry. -// -AsmCommonExceptionEntry - mrc p15, 0, R1, c6, c0, 2 ; Read IFAR - str R1, [SP, #0x50] ; Store it in EFI_SYSTEM_CONTEXT_ARM.IFAR - - mrc p15, 0, R1, c5, c0, 1 ; Read IFSR - str R1, [SP, #0x4c] ; Store it in EFI_SYSTEM_CONTEXT_ARM.IFSR - - mrc p15, 0, R1, c6, c0, 0 ; Read DFAR - str R1, [SP, #0x48] ; Store it in EFI_SYSTEM_CONTEXT_ARM.DFAR - - mrc p15, 0, R1, c5, c0, 0 ; Read DFSR - str R1, [SP, #0x44] ; Store it in EFI_SYSTEM_CONTEXT_ARM.DFSR - - ldr R1, [SP, #0x5c] ; srsfd saved pre-exception CPSR on the stack - str R1, [SP, #0x40] ; Store it in EFI_SYSTEM_CONTEXT_ARM.CPSR - - add R2, SP, #0x38 ; Make R2 point to EFI_SYSTEM_CONTEXT_ARM.LR - 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 - ; else - stmneed R2, {lr} ; save SVC lr - - - ldr R5, [SP, #0x58] ; PC is the LR pushed by srsfd - ; Check to see if we have to adjust for Thumb entry - sub r4, r0, #1 ; if (ExceptionType == 1 || ExceptionType ==2)) { - cmp r4, #1 ; // UND & SVC have different LR adjust for Thumb - bhi NoAdjustNeeded - - tst r1, #0x20 ; if ((CPSR & T)) == T) { // Thumb Mode on entry - addne R5, R5, #2 ; PC += 2; - str R5,[SP,#0x58] ; Update LR value pused by srsfd - -NoAdjustNeeded - - str R5, [SP, #0x3c] ; Store it in EFI_SYSTEM_CONTEXT_ARM.PC - - sub R1, SP, #0x60 ; We pused 0x60 bytes on the stack - str R1, [SP, #0x34] ; Store it in EFI_SYSTEM_CONTEXT_ARM.SP - - ; R0 is ExceptionType - mov R1,SP ; R1 is SystemContext - -#if (FixedPcdGet32(PcdVFPEnabled)) - vpush {d0-d15} ; save vstm registers in case they are used in optimizations -#endif - -/* -VOID -EFIAPI -DefaultExceptionHandler ( - IN EFI_EXCEPTION_TYPE ExceptionType, R0 - IN OUT EFI_SYSTEM_CONTEXT SystemContext R1 - ) - -*/ - blx DefaultExceptionHandler ; Call exception handler - -#if (FixedPcdGet32(PcdVFPEnabled)) - vpop {d0-d15} -#endif - - ldr R1, [SP, #0x4c] ; Restore EFI_SYSTEM_CONTEXT_ARM.IFSR - mcr p15, 0, R1, c5, c0, 1 ; Write IFSR - - ldr R1, [SP, #0x44] ; sRestore EFI_SYSTEM_CONTEXT_ARM.DFSR - mcr p15, 0, R1, c5, c0, 0 ; Write DFSR - - ldr R1,[SP,#0x3c] ; EFI_SYSTEM_CONTEXT_ARM.PC - str R1,[SP,#0x58] ; Store it back to srsfd stack slot so it can be restored - - ldr R1,[SP,#0x40] ; EFI_SYSTEM_CONTEXT_ARM.CPSR - str R1,[SP,#0x5c] ; Store it back to srsfd stack slot so it can be restored - - add R3, SP, #0x54 ; Make R3 point to SVC LR saved on entry - add R2, SP, #0x38 ; Make R2 point to EFI_SYSTEM_CONTEXT_ARM.LR - 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 - ; else - ldmneed R3, {lr} ; restore SVC lr, via ldmfd SP!, {LR} - - ldmfd SP!,{R0-R12} ; Restore general purpose registers - ; Exception handler can not change SP - - add SP,SP,#0x20 ; Clear out the remaining stack space - ldmfd SP!,{LR} ; restore the link register for this context - rfefd SP! ; return from exception via srsfd stack slot - - END diff --git a/ArmPkg/Library/DebugAgentSymbolsBaseLib/DebugAgentSymbolsBaseLib.c b/ArmPkg/Library/DebugAgentSymbolsBaseLib/DebugAgentSymbolsBaseLib.c index 9c0cf0de38e1..f47f4250d1e8 100644 --- a/ArmPkg/Library/DebugAgentSymbolsBaseLib/DebugAgentSymbolsBaseLib.c +++ b/ArmPkg/Library/DebugAgentSymbolsBaseLib/DebugAgentSymbolsBaseLib.c @@ -14,7 +14,6 @@ **/ #include -#include #include #include #include @@ -283,12 +282,6 @@ InitializeDebugAgent ( EFI_FFS_FILE_HEADER *FfsHeader; PE_COFF_LOADER_IMAGE_CONTEXT ImageContext; - // Now we've got UART, check the Debug Agent Vector Table - // Note: The AArch64 Vector table must be 2k-byte aligned - if this assertion fails ensure - // 'Align=4K' is defined into your FDF for this module. - ASSERT (((UINTN)DebugAgentVectorTable & ARM_VECTOR_TABLE_ALIGNMENT) == 0); - ArmWriteVBar ((UINTN)DebugAgentVectorTable); - // We use InitFlag to know if DebugAgent has been initialized from // Sec (DEBUG_AGENT_INIT_PREMEM_SEC) or PrePi (DEBUG_AGENT_INIT_POSTMEM_SEC) // modules diff --git a/ArmPkg/Library/DebugAgentSymbolsBaseLib/DebugAgentSymbolsBaseLib.inf b/ArmPkg/Library/DebugAgentSymbolsBaseLib/DebugAgentSymbolsBaseLib.inf index 6b784f749b5e..671c1b6474b2 100644 --- a/ArmPkg/Library/DebugAgentSymbolsBaseLib/DebugAgentSymbolsBaseLib.inf +++ b/ArmPkg/Library/DebugAgentSymbolsBaseLib/DebugAgentSymbolsBaseLib.inf @@ -22,22 +22,13 @@ [Defines] [Sources.common] DebugAgentSymbolsBaseLib.c -[Sources.ARM] - Arm/DebugAgentException.asm | RVCT - Arm/DebugAgentException.S | GCC - -[Sources.AARCH64] - AArch64/DebugAgentException.S - [Packages] MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec ArmPkg/ArmPkg.dec [LibraryClasses] - ArmLib DebugLib - DefaultExceptionHandlerLib PcdLib PeCoffExtraActionLib PeCoffLib From patchwork Tue Jan 15 08:23:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 155639 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp4610437jaa; Tue, 15 Jan 2019 00:23:58 -0800 (PST) X-Google-Smtp-Source: ALg8bN5IJ4D1nhd7hb4YvOBKs8gFyEaLXkVVK7DnjRzZEFDTPQvP+WPPcVoCuNWfJaz0OmGeCs9t X-Received: by 2002:a17:902:8e8a:: with SMTP id bg10mr2865294plb.192.1547540638385; Tue, 15 Jan 2019 00:23:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547540638; cv=none; d=google.com; s=arc-20160816; b=VK8mlgvlrURmJpSlA4NsFLTihSsmRlSyGenPIItdsUxoGAF9JcmRNJAMkEqyTxY8X0 S/IOYylP+9jrYo420QZ+nhoE7acqR3mfVTI6+Thcw5GqLjAduMQknkvMdBYzZt1ADNjw OamCLgtqeyZGAgKgH2qjes/3cht3pZpjIEKVfNxcGjOWlyJbjzHmf01rUYfIWqV9OHD7 FhmVPnfOatiMHLZKkQ9MXsGkTz14BHvmYoo5xfmlf8cGi8heOOV70+n0HoFVUxJCVnPh xSJuUOYYCb7Aw5DVKF/3JEiQ3Z2EYXMcGmcTfOHWu+3SC9HXCt09UkALLNrt/819FI/+ 2eFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=f9bGeibz9kHBYqO16j5Ko8xldx4UckNull/qeHUidAE=; b=q4VQN5WcelB69hGMtD1I44paOwGl4Nq40mSCxWLHDB9GXMX4Mvhd1eJUMrVUrD2tEK E9SusiB3CiyYTZsd463jOC1fwFD5a2tABRzVKJs0+WXRcwXuShh6ebg2TyJFLYI2fntR twM5DVf2nntlRBmskwelEbCb1gd01Iaev+JHoS6xxbKqOmHzk/ZkXK4A6UG0sGmfKBih Glxf4wn8694DGKU2hDEAaVl1F70d64Pn9JWmk6peSxFZTP5Hz8ZsFlPZZxYFbFjsicpD 31VCffmYL4X49lP9x5seBsT4uWnh7QTxS2RK5ekt3x+y3x19J48jjfp850/sXLb6N/O0 3mOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=diKWNVIA; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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. [198.145.21.10]) by mx.google.com with ESMTPS id c191si2765665pfg.72.2019.01.15.00.23.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Jan 2019 00:23:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=diKWNVIA; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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 4C8FA211B63F0; Tue, 15 Jan 2019 00:23:55 -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::343; helo=mail-wm1-x343.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) (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 2F3A62194D3B9 for ; Tue, 15 Jan 2019 00:23:53 -0800 (PST) Received: by mail-wm1-x343.google.com with SMTP id m22so2223449wml.3 for ; Tue, 15 Jan 2019 00:23:53 -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:in-reply-to:references; bh=Z4vSWhqIVcVjyNodCJc2oMV0u1Q1ngbvjudj+Z1VlaM=; b=diKWNVIAMgMzgmORsqh189i3iSPR1+c8e2672+lTjTwJNTxr9E9FQ+yULoJZcdRXW3 4gFvTvyIqVDi6idDImLr6WzFcXmJFnHHz3qc73+hDPpDLGoNcoYxgg8AyFYqB72G9baq KD/xbjbIZwB9PRetX8T+ycQiC1Igq9ocojHH4= 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:in-reply-to :references; bh=Z4vSWhqIVcVjyNodCJc2oMV0u1Q1ngbvjudj+Z1VlaM=; b=D9MbYJazxtYbGAmH86p/JDfXCZ1Qxnwa66pcIWGhJMOG8WWheSkEAHZeP1O9Dh6nZR vS4snHo/qMLwRxzNlQl5rTFqr5I6oJMv2pStYofQdI9CVat/SNMAfADylaHUJBr01StA P+XNOc9qWtvBNnUrkutnM1x6qj+tuu0DJ4+k146Sr/A1gU09nZehHNnpr9azlpvqbVyc q5PPFv3asi2CLpsBD/S/joD/ZWTyh6AewRq0oBi0Njz0MpOps6H1GLfAeaqomq7dbb56 PK9b5mYKSzJnADAyxVGkxHg+0cVgl+YkNA3k10hRM/c/GFlkpYoKa284kMpMnA4WMaeQ KgEQ== X-Gm-Message-State: AJcUukfAf+A/XgskNQO+A2CPPBrAG13wJo2urEjkq40ZsXmFa7Lq+YQa ks940QNMXzkyBszE0JrZ2dyHiWU9UOf0+g== X-Received: by 2002:a1c:dc02:: with SMTP id t2mr2236923wmg.78.1547540631458; Tue, 15 Jan 2019 00:23:51 -0800 (PST) Received: from dogfood.home ([2a01:cb1d:112:6f00:c8d1:b905:1bdd:adb6]) by smtp.gmail.com with ESMTPSA id 67sm120697983wra.37.2019.01.15.00.23.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Jan 2019 00:23:50 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Tue, 15 Jan 2019 09:23:42 +0100 Message-Id: <20190115082345.3711-3-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190115082345.3711-1-ard.biesheuvel@linaro.org> References: <20190115082345.3711-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH v2 2/5] ArmPkg/DefaultExceptionHandlerLib: declare the permitted usage context 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: , Cc: lersek@redhat.com MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Declare that this library is only usable in the context of DXE core or a DXE driver. Set the MODULE_TYPE to BASE: this only affects the prototype of the constructor (if present) but doesn't actually restrict the usage context otherwise. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel Reviewed-by: Leif Lindholm --- ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLib.inf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.17.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLib.inf b/ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLib.inf index f5421b1240a1..7609f82d89a1 100644 --- a/ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLib.inf +++ b/ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLib.inf @@ -17,9 +17,9 @@ [Defines] INF_VERSION = 0x00010005 BASE_NAME = DefaultExceptionHandlerLib FILE_GUID = EACDB354-DF1A-4AF9-A171-499737ED818F - MODULE_TYPE = UEFI_DRIVER + MODULE_TYPE = BASE VERSION_STRING = 1.0 - LIBRARY_CLASS = DefaultExceptionHandlerLib + LIBRARY_CLASS = DefaultExceptionHandlerLib|DXE_CORE DXE_DRIVER [Sources.common] DefaultExceptionHandlerUefi.c From patchwork Tue Jan 15 08:23:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 155640 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp4610472jaa; Tue, 15 Jan 2019 00:24:01 -0800 (PST) X-Google-Smtp-Source: ALg8bN4+4cBx34tzq+JBM3hCCXyGgNGbIleKx2panEQtCiCejsWh2qSksbpJVbIPvTm1FSYiIDSM X-Received: by 2002:a63:2905:: with SMTP id p5mr2766680pgp.178.1547540641388; Tue, 15 Jan 2019 00:24:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547540641; cv=none; d=google.com; s=arc-20160816; b=uAAr35YMLzHydcI90hSnaPI0cAqheVJIqvtUmeGWPBja4E6KDnpRCJHIzKLAjm86OB EcMkdpxiHJGOTOM1Yp0dZlK9t0dQKT05qkh+q4bqmtoORKOSB2MzxOHb6FKg7zEF7Yej T1gmvFaED9hiJ4pWoJvn3Tv19SEp8S8iSsIj6RdB/lBUefK4dID0moR61eMplk3w8oVv 80WjSA0LE7UeXtiqTaMHKsRzj189u4PJMlYIIoxp7QJryruZU5825ib6S6cLNHjQa1V1 O4adPUSwUhuLMrRq3yLy2KNaag/lpFVsA7Q6oxbdPnsj4WzkkedG9jdfruptV7OFwCsV mm/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=Ps3weY+Z/DkzGySrSYoiebPZOwVlToDXS/5D3H9ozLM=; b=x/RBC6QRVqyOtEYSZyx28ycRYynGcMKohTEWJWE4j1OCC6N6nPl6jZ8CyhwBrKSyRK X+1vBLuBCqwN7nyv0z3OOMOoI4x6cBlpTIQC7gTLV6W1sdcSh3OEaQCg66zEMvlxVlWO s1D4iHvaJkehOA8eO+v5/ID+H8yR60nukDXX2BNf3u/fwxRZ+8Y1/Jqvq2h43NCstsC5 qbMCs/+eDRHNGMCieUstcLWEPUCuW7gJfFYQRsa4eAoD+/mtxNxHLmlK0y9DKiNY4bl3 7TFJYWwXx/nlLhglemJZKdkAiAwDlfPTQAV/OshPBv6cY62Og9iYVUxGzHne+nKAXMtk 5EKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=aNKAnY5u; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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. [198.145.21.10]) by mx.google.com with ESMTPS id m3si2689999pld.331.2019.01.15.00.24.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Jan 2019 00:24:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=aNKAnY5u; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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 78DF0211B76B7; Tue, 15 Jan 2019 00:23:56 -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::344; helo=mail-wm1-x344.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) (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 72597211B76AF for ; Tue, 15 Jan 2019 00:23:54 -0800 (PST) Received: by mail-wm1-x344.google.com with SMTP id t200so2247260wmt.0 for ; Tue, 15 Jan 2019 00:23:54 -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:in-reply-to:references; bh=F6ZXRQl8ZIbJtijRo7pDBH01qF4YYZwq5oyvyEM1K+c=; b=aNKAnY5uL53mkiH5illy2ApONfzBZGqyRwEcb+oABHMbcgN3ZObN+sMm8Cza8CGqvy S+V7qrWwhLTzSDTxBrE2lW5IDrLUxrrL30Z9yrx2Wq/ZF27A1nzP3KSTmqgRQYZjd8lh DHQjNy2PdfpNRuTPNsFNb5Vap8O3uNDYDp3Tw= 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:in-reply-to :references; bh=F6ZXRQl8ZIbJtijRo7pDBH01qF4YYZwq5oyvyEM1K+c=; b=l0VoSrjWLVxd51FHylKHljdtZDBhIt3Gwj9vWUg9i0zI/CRmCZj1K+/hHweo3Ppa2m 6X+8a85tfauUQHRFkCVFD+uIelFBK3TIRkYyuzd5s6yxC4rHvzTOZ47MQOK1Cx2hsmUg 8r1b1l3dpJ2hNlZzQfU6ddyPGJcEp1JjwZScCDmS445NnssdPTORvnYpCeS6ATeTRq1T b375gwK9VMlzZ0OmTcRCPeAEH9K6AnsvTLG5YKmYJrD368m3Re/lcxCTY2RAEKfrbWIW wrHgn2E34G2YpoTuX3dHUr+qtHtvK1gsEHu7c3XsSEkiaUGPxbvkoLVtxM1hMng1s4su aKyA== X-Gm-Message-State: AJcUukfM90UJH5BxX8wJ9zDu19FfEcoRYgM0h+y4OjupHpdeqQoxSWXn gp40735yZupXynLd3QoUZ6Ce4GlpBrxb4g== X-Received: by 2002:a7b:c04e:: with SMTP id u14mr2093821wmc.133.1547540632697; Tue, 15 Jan 2019 00:23:52 -0800 (PST) Received: from dogfood.home ([2a01:cb1d:112:6f00:c8d1:b905:1bdd:adb6]) by smtp.gmail.com with ESMTPSA id 67sm120697983wra.37.2019.01.15.00.23.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Jan 2019 00:23:51 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Tue, 15 Jan 2019 09:23:43 +0100 Message-Id: <20190115082345.3711-4-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190115082345.3711-1-ard.biesheuvel@linaro.org> References: <20190115082345.3711-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH v2 3/5] ArmVirtPkg: drop reference to ArmPkg/DefaultExceptionHandlerLibBase 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: , Cc: lersek@redhat.com MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Drop the reference to ArmPkg/DefaultExceptionHandlerLibBase, which is no longer used anywhere now that DebugAgentSymbolsBaseLib no longer incorporates a vector table and exception handling. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel Reviewed-by: Leif Lindholm --- ArmVirtPkg/ArmVirt.dsc.inc | 1 - 1 file changed, 1 deletion(-) -- 2.17.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Laszlo Ersek diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc index 89c2db074711..c47955be940c 100644 --- a/ArmVirtPkg/ArmVirt.dsc.inc +++ b/ArmVirtPkg/ArmVirt.dsc.inc @@ -174,7 +174,6 @@ [LibraryClasses.common.SEC] BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf DebugAgentLib|ArmPkg/Library/DebugAgentSymbolsBaseLib/DebugAgentSymbolsBaseLib.inf - DefaultExceptionHandlerLib|ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLibBase.inf SerialPortLib|ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.inf HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf From patchwork Tue Jan 15 08:23:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 155641 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp4610521jaa; Tue, 15 Jan 2019 00:24:04 -0800 (PST) X-Google-Smtp-Source: ALg8bN4V6vuPKI4YpLbNe9tXRM8t8WHsf4o982C2U2v0BwBzofsG5nB9Xn1WXy5E5Ch8/UVNeUQV X-Received: by 2002:a63:4384:: with SMTP id q126mr2723181pga.160.1547540644598; Tue, 15 Jan 2019 00:24:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547540644; cv=none; d=google.com; s=arc-20160816; b=bK2kZ7WF95T2Qn04MRH4BYK+r8Qh7kB8d9sbIbNCjets8xAIrJzsx14wQOmQx8CzdA 0l4s9T4V4/q88+iUBQiiBRUozulVp7RbjHS24dFpVi4EdFT+MwRq7awUnj/Stqw8QvAR ntkROLAfuMcEnolyRb+ZOZ5N/8UjklXImLAjI0UkcJjqYIiM1XXz6PLn2gZOOz7OjUFv iROJGdEN3CcilB0sCNu7cYCpkaOpCptmNi4TKCRF4svS3Sp1Oy4zekHo8b+R6PXWeWoN PJ96Co+1lZCne60G5ag1bSHpJdNn/+uOJgr3egd1RS0fGn5/24hujieLV5b76VKF8ICx dvuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=PLV6tzgMU/mVm2m7Aye1tCJ9FAYJHig/r7UKWDCuR2Y=; b=k1mFyT6BiXg7cyOkjaM/eZFt5S1kM1UjSrmB7aWVTt36GeV55Ja89F6AsoVYXonGML x5Dp+tcxUyW1EhfZpixOix7apBCg6QR26aZ7w/qstjZkKqzyJHc8j9EMFJtuihucm7iU gnv0qHzeCOEOsreHExgk6zMmJRfG0tD+pxHg/K7m7ijS5d2j3wyyaEsioJXjQXmCjzxX btFd7rG1pHbDVuXNwFRPmK9cR/ebKrBMtMpLyn0Q/ofaXJzi5CPAe8RqGC27LcEvU+mb OJfHOSG0vBmEl/KZRQ6N8rvKEKph+WMA5rYRVN2kp12fbA8hWESLsimft8lB1TKgJIp8 lkxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=YgBITAAo; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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. [198.145.21.10]) by mx.google.com with ESMTPS id 85si2707590pfc.145.2019.01.15.00.24.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Jan 2019 00:24:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=YgBITAAo; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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 A6F5A211B76BA; Tue, 15 Jan 2019 00:23:57 -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::444; helo=mail-wr1-x444.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) (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 34D42211B76B3 for ; Tue, 15 Jan 2019 00:23:56 -0800 (PST) Received: by mail-wr1-x444.google.com with SMTP id t6so1814263wrr.12 for ; Tue, 15 Jan 2019 00:23:56 -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:in-reply-to:references; bh=2sHqlUcN5wH6/SDkWch0EhAGg9DFWmC+GP6FSbLeXUo=; b=YgBITAAoOeCEhwO5lGbMQxFCNO1WAwee/2UaJWmbDgQkka9koiJVv8KfdOFuXY/UtE EXUxSqh0HaWgcc5YlCY9b8dazBdpnYynbMCJjx2a+IxkmjSnRlCb6nxnFq45rP17RKnC oWCIAppGFnhY0tplmGQVLjkrE/yNaHvUpcIZI= 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:in-reply-to :references; bh=2sHqlUcN5wH6/SDkWch0EhAGg9DFWmC+GP6FSbLeXUo=; b=jV8YJ0zZlAnXmgP2k8IZUZw8mE/bFmRxea0AP3cNCMW0OFAMpRJ6MevGTcZBx+gk92 qn3k7HxJlKWDrrSZLdB0tws/HLUPeLAtQSWc6qIPv+mnP+3dBqVsry3W62px3DhEfMym WduGAWiGmuYmaCaf7zee4EABcREcyH2E0+bi+5dqWGNQFw6r3EEfmIa/MQnA1I0IQxAK allUjeBqh//HnnYpwkqVui19WpeXihrnxWbSBt3GtFwK+iGSdRKGPVegoQ9o4SZSzSFt Kmjtm1xnIavjRQ2xGhmTBKyBTaKrvhzIB4sQSR0GDeBc/fHPvRzlmis16qj7k3hDJKgx leDQ== X-Gm-Message-State: AJcUukcPb/2nUhGmeoO20XSeXS7aXb7s4CxtgnQ1FfR+xR6iGmSe5efZ FDbmt9auanEprdRpawrlUrSm0Cl+5XmlhQ== X-Received: by 2002:a5d:5607:: with SMTP id l7mr1982999wrv.25.1547540634345; Tue, 15 Jan 2019 00:23:54 -0800 (PST) Received: from dogfood.home ([2a01:cb1d:112:6f00:c8d1:b905:1bdd:adb6]) by smtp.gmail.com with ESMTPSA id 67sm120697983wra.37.2019.01.15.00.23.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Jan 2019 00:23:53 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Tue, 15 Jan 2019 09:23:44 +0100 Message-Id: <20190115082345.3711-5-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190115082345.3711-1-ard.biesheuvel@linaro.org> References: <20190115082345.3711-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH v2 4/5] ArmPkg/DefaultExceptionHandlerLib: drop BASE variant 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: , Cc: lersek@redhat.com MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Drop the redundant BASE variant, which is no longer used anywhere now that DebugAgentSymbolsBaseLib no longer incorporates a vector table and exception handling. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel Reviewed-by: Leif Lindholm --- ArmPkg/ArmPkg.dsc | 1 - ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerBase.c | 35 --------------- ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLibBase.inf | 45 -------------------- 3 files changed, 81 deletions(-) -- 2.17.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/ArmPkg/ArmPkg.dsc b/ArmPkg/ArmPkg.dsc index 5d83c18b143e..d9f9935d70b6 100644 --- a/ArmPkg/ArmPkg.dsc +++ b/ArmPkg/ArmPkg.dsc @@ -141,7 +141,6 @@ [Components.common] ArmPkg/Library/ArmGicArchSecLib/ArmGicArchSecLib.inf ArmPkg/Library/ArmLib/ArmBaseLib.inf ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf - ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLibBase.inf ArmPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf diff --git a/ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerBase.c b/ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerBase.c deleted file mode 100644 index 4a54298b1189..000000000000 --- a/ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerBase.c +++ /dev/null @@ -1,35 +0,0 @@ -/** @file - - Copyright (c) 2012, ARM Ltd. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#include - -/** - - @param FaultAddress Address to find PE/COFF image for. - @param ImageBase Return load address of found image - @param PeCoffSizeOfHeaders Return the size of the PE/COFF header for the image that was found - - @retval NULL FaultAddress not in a loaded PE/COFF image. - @retval Path and file name of PE/COFF image. - -**/ -CHAR8 * -GetImageName ( - IN UINTN FaultAddress, - OUT UINTN *ImageBase, - OUT UINTN *PeCoffSizeOfHeaders - ) -{ - return NULL; -} diff --git a/ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLibBase.inf b/ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLibBase.inf deleted file mode 100644 index b53a5e89f507..000000000000 --- a/ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLibBase.inf +++ /dev/null @@ -1,45 +0,0 @@ -#/** @file -# -# Copyright (c) 2012, ARM Ltd. All rights reserved.
-# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# -#**/ - -[Defines] - INF_VERSION = 0x00010005 - BASE_NAME = DefaultExceptionHandlerBaseLib - FILE_GUID = 3d5261d5-5eb7-4559-98e7-475aa9d0dc42 - MODULE_TYPE = BASE - VERSION_STRING = 1.0 - LIBRARY_CLASS = DefaultExceptionHandlerLib - -[Sources.common] - DefaultExceptionHandlerBase.c - -[Sources.ARM] - Arm/DefaultExceptionHandler.c - -[Sources.AARCH64] - AArch64/DefaultExceptionHandler.c - -[Packages] - MdePkg/MdePkg.dec - ArmPkg/ArmPkg.dec - -[LibraryClasses] - BaseLib - PrintLib - DebugLib - PeCoffGetEntryPointLib - ArmDisassemblerLib - SerialPortLib - -[Guids] - gEfiDebugImageInfoTableGuid From patchwork Tue Jan 15 08:23:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 155642 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp4610561jaa; Tue, 15 Jan 2019 00:24:08 -0800 (PST) X-Google-Smtp-Source: ALg8bN6W92MmFEY0qmLJOp6/QlHylffdB2o4Pwa3b0VzxCGVBpn7xd9car7E8JW/L+Hieqr1vDB6 X-Received: by 2002:a17:902:2868:: with SMTP id e95mr2833603plb.317.1547540648032; Tue, 15 Jan 2019 00:24:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547540648; cv=none; d=google.com; s=arc-20160816; b=h7c4bISv/XGFzfQJkVptughp0mRbtj5SxcDfx4ybntl705TDDdB2Wg3f0ANnc3SaKJ RH/9MY1/IMT/hSleMhXvvpjWWATAXik7lyIkya0UMaJjpska0XrvW+QEeKLIFyfXWH3t nMqcItkky+Ee6Lmir4vbaAGC7UQ6/P/gI84tjhuJSBJGRYHnstVQt277ZqakR/h6+szj ZTCA2NB+gPcTqkWWg5fL4uKy0bvLB+5lnjCkXA9DRL16xGeDntlGlmY+4sIP3cY8JLkV NS68d0KthhFcnt0FBFnm1+bFrJ6eZX0T2QOLEGtzV2h4pC2143enVgESp8Hifh3ICxqm aUzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=SLe6HRXOWnculvGTjywzr3cj3Sa3e8qKF7EHx5j/o7w=; b=eZz8jFt18PhXvr/53JJZb9MopZlsMLK8rbxchDEIqiQNASv5VGVFpSmMn1hc9gCEPD 6X4+EtqDspnEtM0Jf3zcYl5ONKa/eExBBrkd6ot/6MsCAsF//f6vLOni5dlY2mBJJWut E8ZOa529rkQlyZIT/qc4UfQiXE6lWufZ3PcMRJ2rl6xTKgT0HN1V/DAjM2pEfKwG0loK QrysVRyga9zoPCvb0bemXwmK8pU9Nt9pruRk63BjB8XT5A+mB2mz4c39sMPExILI7wI0 nbD2SlGAGRff1cB8vut262kCNxvxoo0e4keVWLxJ8mjYlX245+aUoBVugFkF7VnTqa5N S6kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=dqDFbgFq; 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 37si2800417pgw.590.2019.01.15.00.24.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Jan 2019 00:24:08 -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=dqDFbgFq; 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 D6BA7211B76BD; Tue, 15 Jan 2019 00:23:58 -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::341; helo=mail-wm1-x341.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) (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 7DC74211B76A7 for ; Tue, 15 Jan 2019 00:23:57 -0800 (PST) Received: by mail-wm1-x341.google.com with SMTP id d15so2308446wmb.3 for ; Tue, 15 Jan 2019 00:23:57 -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:in-reply-to:references; bh=YiypyNMMmOSf8bB5ZyIMVodp+7p6fxpofMHLnAaOZ3c=; b=dqDFbgFqKMWr4m7FyH+S6NJ+igd2DLUM28/idDAKzV4NbxiWcAxh5ojdGFI7Zk/q/j YEuC0y8sn77razcELu6t4Y7m6Dk5x0BELdIbGlpJF6y94ocVNWOGwsg+rVjpU8ERgUAA Zf6e21dXiNmKtGjL+GdxAnItH+dALvY+eonC8= 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:in-reply-to :references; bh=YiypyNMMmOSf8bB5ZyIMVodp+7p6fxpofMHLnAaOZ3c=; b=Kf3KNPV65sOAX9UigbR9GG0QGngt5WuHc6Um0s+KjZ842WgYCS5sc4g6JeF1swYOb1 YJyJckW4t9eik0I7/16bZWceQ8JBgbaySndzEP563esWFz0TgPOZg4awHgcyaVCspii0 zBwgFpcI4kGYP53q+Lkq6jgAeLnc4rFG7QAWgFMWsrsYDuzEALv75eM67h6CQAdRJ4f6 Hvqq0N4qbiaX5lcx4nDclwJCnG9t77GBe+zmBnySXpIFRhkXoNJcJHA7Yc9qBYbPOqDP xPFpyTSMUej0MTbU61buWys9Kx0KJtGu5Y7uVAwm0jnBtSPImto0UZzP2ELM3/i3O27W JLmQ== X-Gm-Message-State: AJcUukcLcTZlicam+OFO7Tofe2RvugLK7DBq3Cc6QVa1BvzfXuH17RI1 0aYcTfzV1jIupZiiiCNYAQmqMEn5JxKy5w== X-Received: by 2002:a1c:b687:: with SMTP id g129mr2265181wmf.59.1547540635649; Tue, 15 Jan 2019 00:23:55 -0800 (PST) Received: from dogfood.home ([2a01:cb1d:112:6f00:c8d1:b905:1bdd:adb6]) by smtp.gmail.com with ESMTPSA id 67sm120697983wra.37.2019.01.15.00.23.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Jan 2019 00:23:54 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Tue, 15 Jan 2019 09:23:45 +0100 Message-Id: <20190115082345.3711-6-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190115082345.3711-1-ard.biesheuvel@linaro.org> References: <20190115082345.3711-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH v2 5/5] ArmPkg/DefaultExceptionHandlerLib: use console if available 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: , Cc: lersek@redhat.com MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Print the minimal 'exception occurred' message to the console instead of straight to the serial port if the console is available. This makes such messages visible on systems where the console is graphical and the serial is not connected. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel Reviewed-by: Leif Lindholm --- ArmPkg/Library/DefaultExceptionHandlerLib/AArch64/DefaultExceptionHandler.c | 12 ++++++++++-- ArmPkg/Library/DefaultExceptionHandlerLib/Arm/DefaultExceptionHandler.c | 7 ++++++- ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLib.inf | 1 + 3 files changed, 17 insertions(+), 3 deletions(-) -- 2.17.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Acked-by: Laszlo Ersek diff --git a/ArmPkg/Library/DefaultExceptionHandlerLib/AArch64/DefaultExceptionHandler.c b/ArmPkg/Library/DefaultExceptionHandlerLib/AArch64/DefaultExceptionHandler.c index 1024bf48c63d..362acd5ba6d2 100644 --- a/ArmPkg/Library/DefaultExceptionHandlerLib/AArch64/DefaultExceptionHandler.c +++ b/ArmPkg/Library/DefaultExceptionHandlerLib/AArch64/DefaultExceptionHandler.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -159,14 +160,21 @@ DefaultExceptionHandler ( INT32 Offset; if (mRecursiveException) { - CharCount = AsciiSPrint (Buffer, sizeof (Buffer),"\nRecursive exception occurred while dumping the CPU state\n"); - SerialPortWrite ((UINT8 *) Buffer, CharCount); + STATIC CHAR8 CONST Message[] = "\nRecursive exception occurred while dumping the CPU state\n"; + + SerialPortWrite ((UINT8 *)Message, AsciiStrLen (Message)); + if (gST->ConOut != NULL) { + AsciiPrint (Message); + } CpuDeadLoop (); } mRecursiveException = TRUE; CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"\n\n%a Exception at 0x%016lx\n", gExceptionTypeString[ExceptionType], SystemContext.SystemContextAArch64->ELR); SerialPortWrite ((UINT8 *) Buffer, CharCount); + if (gST->ConOut != NULL) { + AsciiPrint (Buffer); + } DEBUG_CODE_BEGIN (); CHAR8 *Pdb, *PrevPdb; diff --git a/ArmPkg/Library/DefaultExceptionHandlerLib/Arm/DefaultExceptionHandler.c b/ArmPkg/Library/DefaultExceptionHandlerLib/Arm/DefaultExceptionHandler.c index cc79cb2fa301..a79f73725aed 100644 --- a/ArmPkg/Library/DefaultExceptionHandlerLib/Arm/DefaultExceptionHandler.c +++ b/ArmPkg/Library/DefaultExceptionHandlerLib/Arm/DefaultExceptionHandler.c @@ -21,6 +21,7 @@ #include #include #include +#include #include @@ -194,7 +195,11 @@ DefaultExceptionHandler ( CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"\n%a Exception PC at 0x%08x CPSR 0x%08x ", gExceptionTypeString[ExceptionType], SystemContext.SystemContextArm->PC, SystemContext.SystemContextArm->CPSR); - SerialPortWrite ((UINT8 *) Buffer, CharCount); + if (gST->ConOut != NULL) { + AsciiPrint (Buffer); + } else { + SerialPortWrite ((UINT8 *)Buffer, CharCount); + } DEBUG_CODE_BEGIN (); CHAR8 *Pdb; diff --git a/ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLib.inf b/ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLib.inf index 7609f82d89a1..6bc48714c9dc 100644 --- a/ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLib.inf +++ b/ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLib.inf @@ -42,6 +42,7 @@ [LibraryClasses] PeCoffGetEntryPointLib ArmDisassemblerLib SerialPortLib + UefiBootServicesTableLib [Guids] gEfiDebugImageInfoTableGuid