From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.120; helo=mga04.intel.com; envelope-from=jian.j.wang@intel.com; receiver=edk2-devel@lists.01.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (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 3EAB82035BB16 for ; Wed, 22 Nov 2017 21:02:40 -0800 (PST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Nov 2017 21:06:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,440,1505804400"; d="scan'208";a="10968464" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga002.jf.intel.com with ESMTP; 22 Nov 2017 21:06:56 -0800 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 22 Nov 2017 21:06:56 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 22 Nov 2017 21:06:55 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.218]) with mapi id 14.03.0319.002; Thu, 23 Nov 2017 13:06:54 +0800 From: "Wang, Jian J" To: "Yao, Jiewen" , "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: AQHTY25XXbL0fc9lbUaieJxKBLEU6qMg1EwAgACV1LA= Date: Thu, 23 Nov 2017 05:06:53 +0000 Message-ID: References: <20171122084548.6564-1-jian.j.wang@intel.com> <20171122084548.6564-3-jian.j.wang@intel.com> <74D8A39837DF1E4DA445A8C0B3885C503AA29099@shsmsx102.ccr.corp.intel.com> In-Reply-To: <74D8A39837DF1E4DA445A8C0B3885C503AA29099@shsmsx102.ccr.corp.intel.com> Accept-Language: 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 05:02:41 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Good idea. I think it should be defined in also in following file besides t= he new API MdeModulePkg\Include\Library\CpuExceptionHandlerLib.h > -----Original Message----- > From: Yao, Jiewen > Sent: Thursday, November 23, 2017 12:08 PM > To: Wang, Jian J ; edk2-devel@lists.01.org > Cc: Dong, Eric ; Zeng, Star > Subject: RE: [edk2] [PATCH v2 2/8] MdeModulePkg/CpuExceptionHandlerLib.h: > Add a new API >=20 > Hi > I am a little worried about the way to use VOID * to pass arch dependent = data. >=20 > Can we define it clearly in each ARCH in the header file, and use a UNION= to > include all arch? >=20 > I think both the caller and the callee need parse it. As such, VOID * is = not a good > way. >=20 > Thank you > Yao Jiewen >=20 > > -----Original Message----- > > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of = Jian > 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 > > > > > v2: > > > Add prototype definition of InitializeCpuExceptionStackSwitchHandl= ers() > > > > A new API InitializeCpuExceptionStackSwitchHandlers() is introduced to > support > > initializing exception handlers being able to switch stack. StackSwitch= Data is > > arch dependent and required by IA32 processor to convey resources reser= ved > in > > advance. This is necessary because the CpuExceptionHandlerLib will be l= inked > > in different phases, in which there's no common way to reserve resource= s. > > > > 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 option= al and > its > > + content depends one the specific arch of CPU. > > + > > + @param[in] StackSwitchData Pointer to data required for setupin= g up > > + stack switch. > > + > > + @retval EFI_SUCCESS The exceptions have been successfull= y > > + 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 de= fault > > interrupt/exception handlers. > > > > -- > > 2.14.1.windows.1 > > > > _______________________________________________ > > edk2-devel mailing list > > edk2-devel@lists.01.org > > https://lists.01.org/mailman/listinfo/edk2-devel