From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.31; helo=mga06.intel.com; envelope-from=jian.j.wang@intel.com; receiver=edk2-devel@lists.01.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 B79E421CF25D5 for ; Wed, 22 Nov 2017 00:41:40 -0800 (PST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Nov 2017 00:45:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,436,1505804400"; d="scan'208";a="176479129" Received: from jwang36-mobl2.ccr.corp.intel.com ([10.239.192.71]) by orsmga005.jf.intel.com with ESMTP; 22 Nov 2017 00:45:55 -0800 From: Jian J Wang To: edk2-devel@lists.01.org Cc: Star Zeng , Eric Dong , Jiewen Yao Date: Wed, 22 Nov 2017 16:45:42 +0800 Message-Id: <20171122084548.6564-3-jian.j.wang@intel.com> X-Mailer: git-send-email 2.14.1.windows.1 In-Reply-To: <20171122084548.6564-1-jian.j.wang@intel.com> References: <20171122084548.6564-1-jian.j.wang@intel.com> Subject: [PATCH v2 2/8] MdeModulePkg/CpuExceptionHandlerLib.h: Add a new API 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: , X-List-Received-Date: Wed, 22 Nov 2017 08:41:40 -0000 > v2: > Add prototype definition of InitializeCpuExceptionStackSwitchHandlers() A new API InitializeCpuExceptionStackSwitchHandlers() is introduced to support initializing exception handlers being able to switch stack. StackSwitchData is arch dependent and required by IA32 processor to convey resources reserved in advance. This is necessary because the CpuExceptionHandlerLib will be linked in different phases, in which there's no common way to reserve resources. EFI_STATUS EFIAPI InitializeCpuExceptionStackSwitchHandlers ( IN VOID *StackSwitchData OPTIONAL ); Cc: Star Zeng Cc: Eric Dong Cc: Jiewen Yao Suggested-by: Ayellet Wolman Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang --- MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h b/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h index 6cd8230127..68de4850e1 100644 --- a/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h +++ b/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h @@ -41,6 +41,24 @@ InitializeCpuExceptionHandlers ( IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL ); +/** + Setup separate stack for given exceptions. StackSwitchData is optional and its + content depends one the specific arch of CPU. + + @param[in] StackSwitchData Pointer to data required for setuping up + stack switch. + + @retval EFI_SUCCESS The exceptions have been successfully + initialized. + @retval EFI_INVALID_PARAMETER StackSwitchData contains invalid content. + +**/ +EFI_STATUS +EFIAPI +InitializeCpuExceptionStackSwitchHandlers ( + IN VOID *StackSwitchData OPTIONAL + ); + /** Initializes all CPU interrupt/exceptions entries and provides the default interrupt/exception handlers. -- 2.14.1.windows.1