From nobody Thu Feb 16 16:54:48 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 4PHgzD6dfvz3rB01; Thu, 16 Feb 2023 16:54:48 +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 4PHgzD5wYRz46fx; Thu, 16 Feb 2023 16:54:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676566488; 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=AVnmioQWt0EmQTMDr7Da44ZDaxsyG1NqPUDLFgY4Xi8=; b=k2cpdjDvuKnbl8W5mJvX/vvL9DPliN5PJ0+XJf8vLfv3EQdcDSs5BxhNwkyQ43IHbImM9k U+pKrwYC00c+zBkXfPwN/1hgpBK7iAnzTEHLGNYpdOUFH984QEaxGLVlZdPbLGRgCIfRod bN8BIRR02hZpgzG8zNnIWOvtoh7eQBdpWdaotbbJyTipAmFlbsI/9F8fRoOG0neOntyqxq 23igQZ4vgp1y7M08d3C5NR6UXzb4moUpGiSE8VavM3m2PfyZ4QQ2Oenk6Jisap9jfuL5aF EOAizyy+1VSnWn3aNsy0qQG7H6vVTWuGWsKUJbx7W+EliRS1UkBiDqC95B6FEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676566488; 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=AVnmioQWt0EmQTMDr7Da44ZDaxsyG1NqPUDLFgY4Xi8=; b=wUBo0wSdcjR+jge8Nd7qQnreDu0L7K9apRn1CBuuEVDmQ+QcnpmXeMoHd2GePYB4AhYKVe oTky3U0NZ0SyRoNzC0rDPel+q/JYQtxwXG4SYfVMgD3/QWpJgy8MJvxm14MNTVJnFXROdu 9B1a21T9PpxtOSPGOMgabnMm63VHrnI9rOcOM+Agradbwiv9kwz4qEudNkeRuBuqLmkK+T 3dL8ncwVLZqqZ5xm43T4Zml/IRO2poFf/XZmKJNAKB+Sv5IzfPix0rLIMr/Ay3XXJBkWph pwOOznhN3ZGIS2mvOHxXwFgpTqzp3EN/5BGrZsNI8FZrn+OvvdSLz1sN1CZdfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676566488; a=rsa-sha256; cv=none; b=IVsFJDSiYUyOktOhEwxEitLaeD5NCtqxECBClkAYhka7T4TwpbXNkMTpPmtg/cFnx6mYt4 s+EVvTxAt4VXL9H36ZELq+iEDhKT+7MIB45i8FZG53/UR4OCP128TEgdCyBn1n6lnHNS8M 06BSZ/EweT4DY5brkFooceltHgJ8DcfsfYBar/pZ7H7XK5LsYP1z35fyw45p3vsP0IAQ4o LcZoTy8isIsRBJjUpvaH1geKJeP0DU5D6BTka2VtgvGAWJh4O5L/j2Ua/zBok28WWcmQ/c FKZGNsTw3Ba7pOMXa3LVZcVj97nyXYVX9jRkcGACRgu+fwgPWB/s0wKMLjNYoA== 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 4PHgzD4vDfz19nY; Thu, 16 Feb 2023 16:54:48 +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 31GGsmOj085733; Thu, 16 Feb 2023 16:54:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31GGsmCP085732; Thu, 16 Feb 2023 16:54:48 GMT (envelope-from git) Date: Thu, 16 Feb 2023 16:54:48 GMT Message-Id: <202302161654.31GGsmCP085732@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 07e39710b170 - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 07e39710b170859ef6a57185f9a775973f3eeffe Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=07e39710b170859ef6a57185f9a775973f3eeffe commit 07e39710b170859ef6a57185f9a775973f3eeffe Author: Warner Losh AuthorDate: 2023-02-16 16:36:03 +0000 Commit: Warner Losh CommitDate: 2023-02-16 16:52:07 +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 (cherry picked from commit 6f23df1ae7f6ec3cd06a15c87f0aaaa770b2941b) --- 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 */