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.20; helo=mga02.intel.com; envelope-from=jiewen.yao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 C3DA12035BB16 for ; Wed, 22 Nov 2017 20:03:41 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Nov 2017 20:07:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,440,1505804400"; d="scan'208";a="6026147" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga001.fm.intel.com with ESMTP; 22 Nov 2017 20:07:58 -0800 Received: from fmsmsx121.amr.corp.intel.com (10.18.125.36) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 22 Nov 2017 20:07:57 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx121.amr.corp.intel.com (10.18.125.36) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 22 Nov 2017 20:07:57 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.175]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.213]) with mapi id 14.03.0319.002; Thu, 23 Nov 2017 12:07:55 +0800 From: "Yao, Jiewen" To: "Wang, Jian J" , "edk2-devel@lists.01.org" CC: "Dong, Eric" , "Zeng, Star" Thread-Topic: [edk2] [PATCH v2 2/8] MdeModulePkg/CpuExceptionHandlerLib.h: Add a new API Thread-Index: AQHTY25XPccsS3pbF0+ZLNSwuUi7RKMhWaZQ Date: Thu, 23 Nov 2017 04:07:54 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503AA29099@shsmsx102.ccr.corp.intel.com> References: <20171122084548.6564-1-jian.j.wang@intel.com> <20171122084548.6564-3-jian.j.wang@intel.com> In-Reply-To: <20171122084548.6564-3-jian.j.wang@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZWU5Nzc2MzAtZDg4YS00NjlmLTk2MWItNGM3MTk1M2I0YjliIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJDcmNwdEYwUzlsUHQzZTFZMVliZ2hPaVlBOGhVQlhsYXpuMDJ2MndvQnNTelpsVGxoVXZ6Zmt2MEZyeUhYUXllIn0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [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: Thu, 23 Nov 2017 04:03:42 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi I am a little worried about the way to use VOID * to pass arch dependent da= ta. Can we define it clearly in each ARCH in the header file, and use a UNION t= o include all arch? I think both the caller and the callee need parse it. As such, VOID * is no= t a good way. Thank you Yao Jiewen > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ji= an J > Wang > Sent: Wednesday, November 22, 2017 4:46 PM > To: edk2-devel@lists.01.org > Cc: Yao, Jiewen ; Dong, Eric ; > Zeng, Star > Subject: [edk2] [PATCH v2 2/8] MdeModulePkg/CpuExceptionHandlerLib.h: Add > a new API >=20 > > v2: > > Add prototype definition of InitializeCpuExceptionStackSwitchHandler= s() >=20 > A new API InitializeCpuExceptionStackSwitchHandlers() is introduced to su= pport > initializing exception handlers being able to switch stack. StackSwitchDa= ta is > arch dependent and required by IA32 processor to convey resources reserve= d in > advance. This is necessary because the CpuExceptionHandlerLib will be lin= ked > in different phases, in which there's no common way to reserve resources. >=20 > EFI_STATUS > EFIAPI > InitializeCpuExceptionStackSwitchHandlers ( > IN VOID *StackSwitchData OPTIONAL > ); >=20 > 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(+) >=20 > 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 > ); >=20 > +/** > + 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 defa= ult > interrupt/exception handlers. >=20 > -- > 2.14.1.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel