From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Permerror (SPF Permanent Error: More than 10 MX records returned) identity=mailfrom; client-ip=134.134.136.31; helo=mga06.intel.com; envelope-from=liming.gao@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 E6B272214E321 for ; Mon, 11 Dec 2017 06:31:22 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Dec 2017 06:35:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,391,1508828400"; d="scan'208";a="157732001" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga004.jf.intel.com with ESMTP; 11 Dec 2017 06:35:59 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 11 Dec 2017 06:35:59 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.152]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.93]) with mapi id 14.03.0319.002; Mon, 11 Dec 2017 22:35:57 +0800 From: "Gao, Liming" To: Zenith432 , "edk2-devel@lists.01.org" CC: "Kinney, Michael D" Thread-Topic: [PATCH] MdePkg: correct and clarify documentation of VA_LIST in Base.h Thread-Index: AQHTcc2oEbJQTIdKPkW5zHb7ASLP2qM+NmtQ Date: Mon, 11 Dec 2017 14:35:56 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E18FDF5@SHSMSX104.ccr.corp.intel.com> References: <1667068483.2112668.1512898346914.ref@mail.yahoo.com> <1667068483.2112668.1512898346914@mail.yahoo.com> <4A89E2EF3DFEDB4C8BFDE51014F606A14E18E2A8@SHSMSX104.ccr.corp.intel.com> <2dfbe819-78d5-e328-dd10-9c614e901d05@users.sourceforge.net> In-Reply-To: <2dfbe819-78d5-e328-dd10-9c614e901d05@users.sourceforge.net> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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] MdePkg: correct and clarify documentation of VA_LIST in Base.h 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: Mon, 11 Dec 2017 14:31:23 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi,=20 I see you and Laszlo are still in discussion on GCC behavior. Because the= re is one bug in GCC compiler, the following functions in edk2 must be EFIA= PI. Right? - functions that have a variable argument list and call VA_START / VA_END - functions that call VA_COPY Thanks Liming > -----Original Message----- > From: Zenith432 [mailto:zenith432@users.sourceforge.net] > Sent: Sunday, December 10, 2017 11:43 PM > To: Gao, Liming ; edk2-devel@lists.01.org > Cc: Kinney, Michael D > Subject: Re: [PATCH] MdePkg: correct and clarify documentation of VA_LIST= in Base.h >=20 > On 10/12/2017 03:53 PM, Gao, Liming wrote: > > Could you add bug 457 link in the commit message? > --- > Subject: [PATCH] MdePkg: correct and clarify documentation of VA_LIST in = Base.h >=20 > This is to resolve bug 457. > https://bugzilla.tianocore.org/show_bug.cgi?id=3D457 >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Zenith432 > --- > MdePkg/Include/Base.h | 24 ++++++++++++++++++++---- > 1 file changed, 20 insertions(+), 4 deletions(-) >=20 > diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h > index 02140a5a..19f36872 100644 > --- a/MdePkg/Include/Base.h > +++ b/MdePkg/Include/Base.h > @@ -560,13 +560,14 @@ struct _LIST_ENTRY { > // VA_LIST - typedef for argument list. > // VA_START (VA_LIST Marker, argument before the ...) - Init Marker f= or use. > // VA_END (VA_LIST Marker) - Clear Marker > -// VA_ARG (VA_LIST Marker, var arg size) - Use Marker to get an argumen= t from > -// the ... list. You must know the size and pass it in this macro. > +// VA_ARG (VA_LIST Marker, var arg type) - Use Marker to get an argumen= t from > +// the ... list. You must know the type and pass it in this macro. > // VA_COPY (VA_LIST Dest, VA_LIST Start) - Initialize Dest as a copy = of Start. > // > -// example: > +// Example: > // > // UINTN > +// EFIAPI > // ExampleVarArg ( > // IN UINTN NumberOfArgs, > // ... > @@ -582,7 +583,7 @@ struct _LIST_ENTRY { > // VA_START (Marker, NumberOfArgs); > // for (Index =3D 0, Result =3D 0; Index < NumberOfArgs; Index++) { > // // > -// // The ... list is a series of UINTN values, so average them up. > +// // The ... list is a series of UINTN values, so sum them up. > // // > // Result +=3D VA_ARG (Marker, UINTN); > // } > @@ -591,6 +592,21 @@ struct _LIST_ENTRY { > // return Result > // } > // > +// Notes: > +// > +// This set of macros is intended to support variadic functions that > +// use the EFIAPI calling convention. Variadic functions that use a > +// native calling convention should use stdarg.h. > +// In particular: > +// -- VA_START may only be used in a variadic EFIAPI function. > +// -- va_start may only be used in a variadic native function. > +// -- VA_START, VA_END, VA_ARG and VA_COPY may only be used on a VA_LIS= T. > +// -- va_start, va_end, va_arg and va_copy may only be used on a va_lis= t. > +// -- Both VA_LIST or va_list may be passed as arguments to functions > +// of either EFIAPI or native calling conventions. > +// -- VA_END, VA_ARG, VA_COPY, va_end, va_arg, and va_copy may be used > +// in functions of either calling conventions. > +// >=20 > /** > Return the size of argument that has been aligned to sizeof (UINTN). > -- > 2.14.3