From nobody Sat Nov 2 12:16:12 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1491053149606979.0908974425519; Sat, 1 Apr 2017 06:25:49 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 91386219392F9; Sat, 1 Apr 2017 06:25:39 -0700 (PDT) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E4CD1219392EC for ; Sat, 1 Apr 2017 06:25:38 -0700 (PDT) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP; 01 Apr 2017 06:25:38 -0700 Received: from jfan12-desk.ccr.corp.intel.com ([10.239.158.57]) by fmsmga004.fm.intel.com with ESMTP; 01 Apr 2017 06:25:37 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,257,1486454400"; d="scan'208";a="242805990" From: Jeff Fan To: edk2-devel@lists.01.org Date: Sat, 1 Apr 2017 21:25:26 +0800 Message-Id: <20170401132530.8340-6-jeff.fan@intel.com> X-Mailer: git-send-email 2.9.3.windows.2 In-Reply-To: <20170401132530.8340-1-jeff.fan@intel.com> References: <20170401132530.8340-1-jeff.fan@intel.com> Subject: [edk2] [PATCH 5/9] UefiCpuPkg/CpuExceptionHandlerLib: Add DumpCpuContext() implementation X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Kinney , Feng Tian , Jiewen Yao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Cc: Jiewen Yao Cc: Michael Kinney Cc: Feng Tian Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan --- .../CpuExceptionHandlerLib/CpuExceptionCommon.h | 1 + .../Ia32/ArchExceptionHandler.c | 24 +++++++++++++++++-= ---- .../X64/ArchExceptionHandler.c | 17 ++++++++++++++- 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h= b/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h index 0047ad6..5b3a9b9 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h @@ -24,6 +24,7 @@ #include #include #include +#include =20 #define CPU_EXCEPTION_NUM 32 #define CPU_INTERRUPT_NUM 256 diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ArchExceptionHa= ndler.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ArchExceptionHandl= er.c index d3b26d3..59ed058 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ArchExceptionHandler.c +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ArchExceptionHandler.c @@ -108,13 +108,14 @@ ArchRestoreExceptionContext ( } =20 /** - Display CPU information. + Display processor context. =20 - @param ExceptionType Exception type. - @param SystemContext Pointer to EFI_SYSTEM_CONTEXT. + @param[in] ExceptionType Exception type. + @param[in] SystemContext Processor context to be display. **/ VOID -DumpImageAndCpuContent ( +EFIAPI +DumpCpuContext ( IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_SYSTEM_CONTEXT SystemContext ) @@ -195,10 +196,23 @@ DumpImageAndCpuContent ( "FXSAVE_STATE - %08x\n", &SystemContext.SystemContextIa32->FxSaveState ); +} =20 +/** + Display CPU information. + + @param ExceptionType Exception type. + @param SystemContext Pointer to EFI_SYSTEM_CONTEXT. +**/ +VOID +DumpImageAndCpuContent ( + IN EFI_EXCEPTION_TYPE ExceptionType, + IN EFI_SYSTEM_CONTEXT SystemContext + ) +{ + DumpCpuContext (ExceptionType, SystemContext); // // Find module image base and module entry point by EIP // DumpModuleImageInfo (SystemContext.SystemContextIa32->Eip); - } diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ArchExceptionHan= dler.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ArchExceptionHandler= .c index 9cd2cc2..5199559 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ArchExceptionHandler.c +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ArchExceptionHandler.c @@ -119,7 +119,8 @@ ArchRestoreExceptionContext ( @param SystemContext Pointer to EFI_SYSTEM_CONTEXT. **/ VOID -DumpImageAndCpuContent ( +EFIAPI +DumpCpuContext ( IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_SYSTEM_CONTEXT SystemContext ) @@ -227,7 +228,21 @@ DumpImageAndCpuContent ( "FXSAVE_STATE - %016lx\n", &SystemContext.SystemContextX64->FxSaveState ); +} =20 +/** + Display CPU information. + + @param ExceptionType Exception type. + @param SystemContext Pointer to EFI_SYSTEM_CONTEXT. +**/ +VOID +DumpImageAndCpuContent ( + IN EFI_EXCEPTION_TYPE ExceptionType, + IN EFI_SYSTEM_CONTEXT SystemContext + ) +{ + DumpCpuContext (ExceptionType, SystemContext); // // Find module image base and module entry point by RIP // --=20 2.9.3.windows.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel