From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (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 D92AD21195BEB for ; Fri, 7 Dec 2018 06:09:46 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A347186663; Fri, 7 Dec 2018 14:09:45 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-122-123.rdu2.redhat.com [10.10.122.123]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7AAA65C1A1; Fri, 7 Dec 2018 14:09:44 +0000 (UTC) To: "Knop, Ryszard" Cc: "edk2-devel@lists.01.org" , Bill Paul , Peter Wiehe References: <201812061446.52228.wpaul@windriver.com> <01F0790E56F0534D8DCAD4AC5838792F618B22C4@irsmsx111.ger.corp.intel.com> From: Laszlo Ersek Message-ID: <8e3a189b-3452-cc00-8213-d73669129afc@redhat.com> Date: Fri, 7 Dec 2018 15:09:43 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <01F0790E56F0534D8DCAD4AC5838792F618B22C4@irsmsx111.ger.corp.intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 07 Dec 2018 14:09:45 +0000 (UTC) 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 14:09:48 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 12/07/18 14:26, Knop, Ryszard wrote: > Hi Laszlo, > Regarding "functions that take variable arguments must be EFIAPI, even if they are STATIC (long story)" - what's the story? :) If I remember correctly, the issue was that the VA_*() macros could not be implemented on gcc -- or, on *all* supported gcc toolchains at the same time, anyway -- such that they'd work in both non-EFIAPI and EFIAPI functions. This held for both manual stack manipulation *and* gcc builtins, in the macros -- the gcc builtins would not auto-adapt (at compile time) to the actual calling convention of the containing function. Therefore, the VA_*() macros had to make a one-time choice (between being usable in EFIAPI vs. non-EFIAPI functions). Given that variable arguments are taken by both some edk2 lib class APIs, and (more importantly) some UEFI services (ex. gBS->InstallMultipleProtocolInterfaces()), VA_*() were made to assume EFIAPI in the containing function. So, I guess, to be more precise, I should say "functions that take variable arguments must be EFIAPI, as long as you want to use VA_*() macros in them". This is my recollection anyway. Thanks Laszlo