From nobody Tue Nov 18 04:45:49 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4d9X9n4rFQz6HbfG; Tue, 18 Nov 2025 04:45:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4d9X9n46Wtz3jlF; Tue, 18 Nov 2025 04:45:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763441149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rorzYHOFvE8yVsGnyq1AZk4XtVHJqsSt/CmQwzpLhT4=; b=YwXIDJ6P+5pfoF7Iu8J1DZT6vMS01UpFfCMDFdYSC4ggHNpn8usCnEcxWWzI6Hn7MVPrnH rbxfTGw/5xOQY2WPg+IhNz8jMA6Dhog1493/18YgonGsUtPAJsbQhWK6PgJbFCR8RZMa02 +IiVVYhLMFpRr0o0F9OcG4/ytJH0d7mkFJ1QZyJ1SZA4mxMJQ82C0BnQuST0fNzepcNDZd pbcGukAhe5OtvWMnY7o2ctqnVpFIRcSCTGFcqYY4Rgoy30fltZqSAlPslDU0y6Pp6ndbYG Ng7vZaXyoK36CNC3pSl+MU/1z2GKKqcJDQJNUWoU1C/puvjGQhFmHUIMYPR7Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763441149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rorzYHOFvE8yVsGnyq1AZk4XtVHJqsSt/CmQwzpLhT4=; b=MfteutG2EX4eiTfXKb0wMMCmRQaLjtQ7OcJRXCT/TRCgIfDbiRudJAFnSP8gD34hQpjj6d 6boSUXGPeOBvk2ZF7qbo4G+Bdb3NzslTE+OdMwGyNvm5oIaPvuw5Wj2YrwFv7opJQTLW6q 59gjlfvXWqBB/rms3jo5xNz5VJty4Epo8dz2LNHH6lCJUFWPtP/PC7lXc7Rm3AUBAq4FFw fQSeGyFFbyF+u+JwP2qxfTUBrNVRIyxDiwfcNYSsh1sFFFiuRtzzIo7zufbbVmz7UfL7gd uovtEpq6geXEqcC4PH1B5JmBt0FORcrAFP57Lh8DfHskZtGwirlr3mj1CVIDuw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1763441149; a=rsa-sha256; cv=none; b=PbokTx4seXW+o7ItVKI/4ti+8XaFMZzOFD/ozVfDzOurpMWUQqY6nZky/0X3HBwIqSdMZo WPvX6tItk1gO6zyAjfNOQ3LTGsZy4wnYpIAxs68liZSu5ZURHvnoV+Th9W907VoJObP9QB 26JW1MvvMF+NOjWGxuEhyTR77h0H5YRWXn7hVzJGjua0nxgEvQFxW0zaCINH1/5Q2IsFVG EcanFE1k9XX8CrpdqVwi4Za1NGYES5yXskj+Wm8K45pMFW6O+Yg73UWkiJo1evaOm0hFgT 4BZmkl/Ceb5GUDEBZOxtn2v5P+6bANXyT32EZ0g3/PyVeryW6j9osUQYHTY9Jw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4d9X9n3T48zgcB; Tue, 18 Nov 2025 04:45:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5AI4jnwv085914; Tue, 18 Nov 2025 04:45:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5AI4jnYK085911; Tue, 18 Nov 2025 04:45:49 GMT (envelope-from git) Date: Tue, 18 Nov 2025 04:45:49 GMT Message-Id: <202511180445.5AI4jnYK085911@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 396b32e801d6 - main - stand: Add back missing EFIAPI define List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 396b32e801d615954750162a616b4e9174b39916 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=396b32e801d615954750162a616b4e9174b39916 commit 396b32e801d615954750162a616b4e9174b39916 Author: Warner Losh AuthorDate: 2025-11-18 04:44:07 +0000 Commit: Warner Losh CommitDate: 2025-11-18 04:45:59 +0000 stand: Add back missing EFIAPI define EFIAPI has to be defined correctly for amd64, or things won't boot because it uses a different API than we normally use. Normally, this only affects amd64, since all the other archs are basically nothing. Tested on: amd64, aarch64 and armv7 (the frist two by markj and I with differnet test setups). Fixes: 43b8edb32051 Sponsored by: Netflix Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D53799 --- sys/sys/efi-edk2.h | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/sys/sys/efi-edk2.h b/sys/sys/efi-edk2.h index 513c56549803..b27b26bd613c 100644 --- a/sys/sys/efi-edk2.h +++ b/sys/sys/efi-edk2.h @@ -41,7 +41,20 @@ typedef void VOID; /* We can't actually call this stuff, so snip out API syntactic sugar */ #define INTERFACE_DECL(x) struct x +#ifdef _STANDALONE +#if defined(__amd64__) +#define EFIAPI __attribute__((ms_abi)) +#endif +#ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options + #ifdef _MSC_EXTENSIONS + #define EFIAPI __cdecl // Force C calling convention for Microsoft C compiler + #else + #define EFIAPI // Substitute expresion to force C calling convention + #endif +#endif +#else #define EFIAPI +#endif #define IN #define OUT #define CONST const @@ -64,11 +77,13 @@ typedef void VOID; #define PACKED /* - * Since we're not compiling for the UEFI boot time (which use ms abi - * conventions), tell EDK2 to define VA_START correctly. For the boot - * loader, this likely needs to be different. + * For userland and the kernel, we're not compiling for the UEFI boot time + * (which use ms abi conventions on amd64), tell EDK2 to define VA_START + * correctly. For the boot loader, we can't do that, so don't. */ +#ifndef _STANDALONE #define NO_MSABI_VA_FUNCS 1 +#endif /* * Finally, we need to define the processor we are in EDK2 terms.