From nobody Tue Feb 14 17:52:03 2023 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 4PGTLD13Phz3pmfd; Tue, 14 Feb 2023 17:52:04 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGTLD0bRxz3QGT; Tue, 14 Feb 2023 17:52:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676397124; 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=x03YNmMOFSLUieF64JUHl9JFusqjLg+kmUlbRe1JdoE=; b=mCiYp1MmMXfVTZnvtpoeKXEuhk8DTKR7Yt+16gGrMlwCnnqSHGpzOuToTsczU6exsLoxR9 xgalWq6b5bdfDR3RdXlv0giV5wRuCSJcypXOCVwHuasoycBtKbKdFQe+Sm+5lycJLMa71F SrpcZlR/PtO4zrjAZHZ0ub0CqUzAHx84y1LIEgDM9v1V5tRpkoG+VeUpNFNRtz6raCJ/BR vnctn8dvfGE+iTyMENKJSw8jy2KMmsKhTRDX/SI9DlbTkCZCQkwC4Y9c42rLqSCFFD8IFe eGm80RAkBW3aZhdrRg4qddGk2hWSbFfGuBY6BGykFCkZ6ETiaIHIb/2hTJE6Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676397124; 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=x03YNmMOFSLUieF64JUHl9JFusqjLg+kmUlbRe1JdoE=; b=nEck96hE7GMJZ97KUXlDQi+1+UCVtKXX/daANXIjTWrUQYQGpzczfI+/jMrH8nXBLaBTWu LXLbfffNT/FuCd9IW4fpImyclbDWH+zrqFkot7hOzEETk6/f/nL7I3nq05M8DQFRGkwFFN Cy95l5MflqNbI7gjtMyE/PJivvFvzf0ozAR9EuudSl+U8bbJOnOTe0MX6n/cdMQk7xmz7n 3v38ISv0RWb1OGUHZux9i1VgxSkF3v/E35VNWiHdDnXo1yKrSwGIH+/rFgYvb6dHZFbpge bQ0Hf4NMaiySDLgqIyNfwjMMnIUQWN1yryWYRZMRvzfMAmdwMKiIbzayecUItg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676397124; a=rsa-sha256; cv=none; b=T1mxOcHOh5rYzgF1lGpjULXNzuWbDsLqU4wL0Lcz5Swe115hE1bgNdfBDyVgzxSl+U6okO AITcdZu1zm1W+TeGhPFsMh3M19XtMRBg5CClJJAIsvGhqZytx81p1LKOaJpY2F4qMxF3qz dk1gBG40x1KasLsPimZT6wI1fb26D7wKRFnROfqioP1nyUEWuasnrrmi07nhL/+1Uwh/oG nk6RrHnqRuj1OuTLH1ir6Nk0wZlIwM9J/0nZgr/iw4J0vtZoxGU1/ZmgFdaeees634tlHb ibw2LVyUEDNgwF1ygc+85Bdt82sQwbK7HK/P/7VpCiYtx75d9p6gQnb+vGikEg== 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 4PGTLC6m9dz17b5; Tue, 14 Feb 2023 17:52:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31EHq3Ng044090; Tue, 14 Feb 2023 17:52:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EHq3wK044089; Tue, 14 Feb 2023 17:52:03 GMT (envelope-from git) Date: Tue, 14 Feb 2023 17:52:03 GMT Message-Id: <202302141752.31EHq3wK044089@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: 6f23df1ae7f6 - main - sys/_endian.h: Move powerpc workaround into _endian.h 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 6f23df1ae7f6ec3cd06a15c87f0aaaa770b2941b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6f23df1ae7f6ec3cd06a15c87f0aaaa770b2941b commit 6f23df1ae7f6ec3cd06a15c87f0aaaa770b2941b Author: Warner Losh AuthorDate: 2023-02-14 17:48:05 +0000 Commit: Warner Losh CommitDate: 2023-02-14 17:51:21 +0000 sys/_endian.h: Move powerpc workaround into _endian.h Powerpc compilers often define _BIG_ENDIAN or _LITTLE_ENDIAN depending on the byte order of the target. This interfers with the endian.h and sys/endian.h APIs which expect those two to be 4321 or 1234. Unconditionally undefine these two before we define them to work around this issue. By including endian.h, the programmer is saying they want this API not the native one. This matches historic practice as well. Fixes: e35448a901aa Sponsored by: Netflix Noticed by: powerpc, powerpc64 CI jobs --- sys/sys/_endian.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/sys/_endian.h b/sys/sys/_endian.h index ff909f532663..7ac39386e2e1 100644 --- a/sys/sys/_endian.h +++ b/sys/sys/_endian.h @@ -41,9 +41,13 @@ /* * Definitions for byte order, according to byte significance from low - * address to high. + * address to high. We undefine any prior definition of them because + * powerpc compilers define _LITTLE_ENDIAN and _BIG_ENDIAN to mean + * something else. */ +#undef _LITTLE_ENDIAN #define _LITTLE_ENDIAN __ORDER_LITTLE_ENDIAN__ /* LSB first: 1234 */ +#undef _BIG_ENDIAN #define _BIG_ENDIAN __ORDER_BIG_ENDIAN__ /* MSB first: 4321 */ #define _PDP_ENDIAN __ORDER_PDP_ENDIAN__ /* LSB first in word, * MSW first in long: 3412 */