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.43; helo=mga05.intel.com; envelope-from=ryszard.knop@intel.com; receiver=edk2-devel@lists.01.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 98CB921196812 for ; Fri, 7 Dec 2018 05:26:20 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Dec 2018 05:26:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,326,1539673200"; d="scan'208";a="108099378" Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by orsmga003.jf.intel.com with ESMTP; 07 Dec 2018 05:26:18 -0800 Received: from irsmsx111.ger.corp.intel.com ([169.254.2.183]) by IRSMSX104.ger.corp.intel.com ([169.254.5.61]) with mapi id 14.03.0415.000; Fri, 7 Dec 2018 13:26:17 +0000 From: "Knop, Ryszard" To: Laszlo Ersek CC: "edk2-devel@lists.01.org" , Bill Paul , Peter Wiehe Thread-Topic: [edk2] edk2 and gnu-efi calling schemes Thread-Index: AQHUjbP6KgqD93dARkyJu4as/WDJVqVyT7+AgADwUoCAAAUPcA== Date: Fri, 7 Dec 2018 13:26:16 +0000 Message-ID: <01F0790E56F0534D8DCAD4AC5838792F618B22C4@irsmsx111.ger.corp.intel.com> References: <201812061446.52228.wpaul@windriver.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNzE4MjZmYTAtZjcxZi00NTI4LWEzYjUtODY1NDhjNDkwMGRjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoicHZIY01sTFR6dUZld1FDTHdZclp1M3Y5TDdoeHk5S2prTTdnZGNONnByU3dsa1MzN1R0RGhuM0V6aThiRHVVVyJ9 x-originating-ip: [163.33.239.181] MIME-Version: 1.0 Subject: Re: edk2 and gnu-efi calling schemes X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Dec 2018 13:26:20 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Laszlo, Regarding "functions that take variable arguments must be EFIAPI, even if t= hey are STATIC (long story)" - what's the story? :) Thanks, Richard. -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Lasz= lo Ersek Sent: Friday, December 7, 2018 14:07 To: Peter Wiehe Cc: edk2-devel@lists.01.org; Bill Paul Subject: Re: [edk2] edk2 and gnu-efi calling schemes On 12/06/18 23:46, Bill Paul wrote: > Of all the gin joints in all the towns in all the world, Peter Wiehe = > had to walk into mine at 14:34 on Thursday 06 December 2018 and say: > = >> OK, another question: >> >> when writing an UEFI application, edk2 and gnu-efi have different = >> 64bit calling schemes. Does that only apply to calling the = >> runtime-library/object file (and inside of the UEFI-application, of = >> course)? Or does the call from application to UEFI differ in both = >> toolkits, too? (If it is the latter, it would mean that the UEFI = >> standard is unprecise!) > = > Both the EDK and GNU EFI obey the same standards when calling UEFI = > APIs. Their exact implementations may differ depending on the = > circumstances. For example, GNU EFI may use the = > __attribute__((ms_abi)) tag to tell the compiler what ABI to use, or = > if the compiler doesn't support this it can fall back to using some = > compatibility wrapper macros (see lib/x86_64/efi_stub.S). Either way, you= end up with the same behavior. > = > Within a given FOO.EFI application, the application code itself can = > get away with using whatever calling convention it wants, right up = > until it needs to call a UEFI firmware routine. At that point, it has = > to follow the conventions spelled out in the UEFI spec. I'd like to add: - in edk2, functions declared in lib class headers have to be EFIAPI; - functions that take variable arguments must be EFIAPI, even if they are STATIC (long story). Thanks Laszlo _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel -------------------------------------------------------------------- Intel Technology Poland sp. z o.o. ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydz= ial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-31= 6 | Kapital zakladowy 200.000 PLN. Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata= i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wi= adomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiek= olwiek przegladanie lub rozpowszechnianie jest zabronione. This e-mail and any attachments may contain confidential material for the s= ole use of the intended recipient(s). If you are not the intended recipient= , please contact the sender and delete all copies; any review or distributi= on by others is strictly prohibited.