From nobody Wed Apr 23 21:35:58 2025 X-Original-To: dev-commits-src-main@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 4ZjXTq2ZTGz5swCN; Wed, 23 Apr 2025 21:35:59 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZjXTp6Cvkz45B9; Wed, 23 Apr 2025 21:35:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1745444158; 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=vhC2oM5z9TKZhPSlJiiB8Ike2e65r+FekJu8lDCAD5Y=; b=qJP1ARMLlDmW60gg+/8MG63Pa1kvd1XNWYHiGQ3KI81uiQw3bQs+3jvCoMjQhjxXY6FHZd vZqTw14nmKLP9onLOKABwDYYbsiqUhA/KMgazDdCs7bTDfk05k2FfgSYNN4u2ydedBFtjV qonBxhHJTlhnOxZGYt+6vHjWmqpCxdIYpLZEt2ggXVK4UhqM8DxWO/zA17zqkUKke6w2QV MAjKqRpwdSnGYZ9wlS8qXbw+KRdWY3jd9MRcPMgRg526Th1V5GI/4Na+tDCossXarvCpiw V9NPNNGrmtkurr9t+MbLbBn60fVAJdss+1cCyoeW5wXJodhi32zJHNi1vIbL3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1745444158; a=rsa-sha256; cv=none; b=xPsoEb7+gtrkuGqf5QBkPYngChd2lXmKwu79DNnkd4XQMF8jChUcvsTMVp8dhqum/QRIMo kO8M+1VpAMDjZFZQAA6T6uGXnudIXOHUNIxS9JZmoWo/O89ZZQRp59cSkFCNRXgK9J2EEf hroxwtve8zYykJn6HERqKKNhiWH7aWR0CnpDNwIvkv1C0uZ+CA1GrAxFFRK1h26Kk/bPtE IJl0rExHB72BcMYx2o7dXnBVEdEiuxmcqAnrqrn/9CqlTln2JbrXA6BrimybuBwY2gTzlI 73SSpRmVIcysHiMhBkPVU622CEb6+cW19U3QWBNEpDl/9QewgccqAacEYnOhpA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1745444158; 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=vhC2oM5z9TKZhPSlJiiB8Ike2e65r+FekJu8lDCAD5Y=; b=FHbFcOcSU3F+78C9onHNSV0kGHwdKyKBlEvCXgDKN7t4uBiViRTde9Bec2lDfpXoF3nTSW 09gdf3BYify2XBbZnN64zFRE1AWI+tDjU7opy0LI0Av697CtcUJY0lsTDbr0tYE/mAhf3S bUSvFB6gEN2wjcEZ7cSwR6V2i/ZzrGKAz3ntuGK2TpTcqo6pmFaMObNj7yluP44IvfrEM6 1Fw+l9mKMdd5UbpTkAo9qY9gJlHRG8Vy9QMhXcbLMf2kZMeMfzyMyDS5CQJmr8Xu7fhoy8 dV3+b9TpXUb+jWLpqgyU13C7EO1zgyo9WQ5Jb66KShNhqB90ve+QzA75LyJn5g== 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 4ZjXTp5g0Rz5rN; Wed, 23 Apr 2025 21:35:58 +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 53NLZwCi064005; Wed, 23 Apr 2025 21:35:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 53NLZwYS064002; Wed, 23 Apr 2025 21:35:58 GMT (envelope-from git) Date: Wed, 23 Apr 2025 21:35:58 GMT Message-Id: <202504232135.53NLZwYS064002@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: 99984e4b41c4 - main - edk2: #ifdef out STATIC_ASSERTS when !_STANDALONE List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 99984e4b41c4ac792c812f1d5b48997e9ac0188f Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=99984e4b41c4ac792c812f1d5b48997e9ac0188f commit 99984e4b41c4ac792c812f1d5b48997e9ac0188f Author: Warner Losh AuthorDate: 2025-04-23 21:31:11 +0000 Commit: Warner Losh CommitDate: 2025-04-23 21:31:11 +0000 edk2: #ifdef out STATIC_ASSERTS when !_STANDALONE All FreeBSD ABIs do not conform to the EDK2 preconditions (except boot loader). These asserts test those things. Since the code from EDK2 that we use does not depend on L" and L' details, commenting them out is fine. Note: This was not in the update since I had to redo it too many times due to lost races and it was a tricky update. Sponsored by: Netflix --- sys/contrib/edk2/Include/Base.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/contrib/edk2/Include/Base.h b/sys/contrib/edk2/Include/Base.h index 6989b10f9e0b..e3d03a9cc5ab 100644 --- a/sys/contrib/edk2/Include/Base.h +++ b/sys/contrib/edk2/Include/Base.h @@ -824,8 +824,15 @@ STATIC_ASSERT (sizeof (INT64) == 8, "sizeof (INT64) does not meet UEFI Specifi STATIC_ASSERT (sizeof (UINT64) == 8, "sizeof (UINT64) does not meet UEFI Specification Data Type requirements"); STATIC_ASSERT (sizeof (CHAR8) == 1, "sizeof (CHAR8) does not meet UEFI Specification Data Type requirements"); STATIC_ASSERT (sizeof (CHAR16) == 2, "sizeof (CHAR16) does not meet UEFI Specification Data Type requirements"); +/* + * FreeBSD uses these headers in userland wher the following two assertions + * fail, but it also takes lengths to never use either of these constructs. The + * boot loader, however, uses them and needs these assertionst o be correct. + */ +#ifdef _STANDALONE STATIC_ASSERT (sizeof (L'A') == 2, "sizeof (L'A') does not meet UEFI Specification Data Type requirements"); STATIC_ASSERT (sizeof (L"A") == 4, "sizeof (L\"A\") does not meet UEFI Specification Data Type requirements"); +#endif STATIC_ASSERT (ALIGNOF (BOOLEAN) == sizeof (BOOLEAN), "Alignment of BOOLEAN does not meet UEFI Specification Data Type requirements"); STATIC_ASSERT (ALIGNOF (INT8) == sizeof (INT8), "Alignment of INT8 does not meet UEFI Specification Data Type requirements");