From nobody Tue Jan 24 23:28:24 2023 X-Original-To: dev-commits-src-branches@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 4P1jp062kfz3103w; Tue, 24 Jan 2023 23:28:24 +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 4P1jp05KhGz3hw4; Tue, 24 Jan 2023 23:28:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674602904; 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=09w0CL4VBPitVpAT6lG+OduIglI9Ubzlkm2GWVDmjUk=; b=sk8QEYiDrELh01QMm6uu/vPr4r1CiEDqJfjz/2HfTveoIseB9U0j/y/0LjNQihNaz7SrtZ RyhSjAG/HPwi5oSoFouh8xBEYX/+SUmoPYcon1pO021VLYLVKF8VLxQVAENtzLDTACKbAk 8Vvyt9iTJoejoMqn/jfYQBAQxy20os+0HyOOXQQ3NsPtBKInKLQ0otBQdSh46vCXPoorfT nWeOaXK0ZrBSscdHj67XPpGjyXwmXJBNuo9kD/6cFbDRp6CkRk73AFrQp3BHCZJHvd2pZh UeNI/11OFDIW3hOOQRUtreeeev07FycTLm9wZIVd+Nn9KOxq8Euob0nWM/8gjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674602904; 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=09w0CL4VBPitVpAT6lG+OduIglI9Ubzlkm2GWVDmjUk=; b=SfqJrlw4wvaAu9F/s3XUqtP476kV6qwlgSZ3N3A0zn4SpHJD3r9fTLOLJ0jRbvCnF3fJ6q VoFNv2doecebXG6dcUITAXz14FFpNfbrzDK3k1465HJCeoYpQvtqbXk25u2P4B5uCGKP89 DWJ3B1dlvDimkeeb7khjr5FVCc7hZzkJq7WqeO1dd8Dl8ZIgE+sPXVNxf3WBxRBie0m4LO GWYIPD4Xh2Q3qfToRqIpstP1tyrmYebGhIG/p7B2pMqmIPnC4mjZP8BSxjVCkxuOKXMKU3 q1Yeq0+TTevQmLlXgH12EFWkhhNuthwc9r21IWsMDpv9j2DiuHxBhJYTqHSrYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674602904; a=rsa-sha256; cv=none; b=nrWTLjyvntesiRo0EM/VA41aCsn+24z/GIjCTIHZWIWZdUCTvfhdZG1F5TnHvJ5xFSx2W3 C/hpPiNGoV6jGjogmUED6hwyP8eKKF+J9BCbZ1lRWMj/tLuuNXH7zWX4zz/jcW/X/nEVRq GoUv9pHwINgkBqBwH4L0YNxVxv9tRCOe5iGIkmk6iBXBMp54FXVzDPqLYbW1dgMCxYDjvC 40OJZW6Um7tpZssID8IWwvw4I2aE6PVgWDoDs4V0VlWXshdWPNXrF9snyj5vofR1hkOvqb a0hZ5JddiXtSXEuHl3G9+6csZajXLpQYA63mlL1t2Q6v7YxO/4JOAKD+BLl0Nw== 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 4P1jp04MJczSDv; Tue, 24 Jan 2023 23:28:24 +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 30ONSOUp092205; Tue, 24 Jan 2023 23:28:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30ONSOU8092204; Tue, 24 Jan 2023 23:28:24 GMT (envelope-from git) Date: Tue, 24 Jan 2023 23:28:24 GMT Message-Id: <202301242328.30ONSOU8092204@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: 6f3e6234f8be - stable/13 - endian.h: Use the __bswap* versions List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 6f3e6234f8be61d0332409300565790a7cad919c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6f3e6234f8be61d0332409300565790a7cad919c commit 6f3e6234f8be61d0332409300565790a7cad919c Author: Warner Losh AuthorDate: 2021-09-21 04:02:35 +0000 Commit: Warner Losh CommitDate: 2023-01-24 23:26:27 +0000 endian.h: Use the __bswap* versions Make it possible to have all these macros work without bswap* being defined. bswap* is part of the application namespace and applications are free to redefine those functions. Reviewed by: emaste,jhb,markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31964 (cherry picked from commit 44fb3c695f5e672ec00bdef0fa0f13793e6269a1) --- sys/sys/endian.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/sys/sys/endian.h b/sys/sys/endian.h index d070d09ad9f7..faac0458ae2c 100644 --- a/sys/sys/endian.h +++ b/sys/sys/endian.h @@ -67,16 +67,16 @@ typedef __uint64_t uint64_t; * endian to host byte order functions as detailed in byteorder(9). */ #if _BYTE_ORDER == _LITTLE_ENDIAN -#define htobe16(x) bswap16((x)) -#define htobe32(x) bswap32((x)) -#define htobe64(x) bswap64((x)) +#define htobe16(x) __bswap16((x)) +#define htobe32(x) __bswap32((x)) +#define htobe64(x) __bswap64((x)) #define htole16(x) ((uint16_t)(x)) #define htole32(x) ((uint32_t)(x)) #define htole64(x) ((uint64_t)(x)) -#define be16toh(x) bswap16((x)) -#define be32toh(x) bswap32((x)) -#define be64toh(x) bswap64((x)) +#define be16toh(x) __bswap16((x)) +#define be32toh(x) __bswap32((x)) +#define be64toh(x) __bswap64((x)) #define le16toh(x) ((uint16_t)(x)) #define le32toh(x) ((uint32_t)(x)) #define le64toh(x) ((uint64_t)(x)) @@ -84,16 +84,16 @@ typedef __uint64_t uint64_t; #define htobe16(x) ((uint16_t)(x)) #define htobe32(x) ((uint32_t)(x)) #define htobe64(x) ((uint64_t)(x)) -#define htole16(x) bswap16((x)) -#define htole32(x) bswap32((x)) -#define htole64(x) bswap64((x)) +#define htole16(x) __bswap16((x)) +#define htole32(x) __bswap32((x)) +#define htole64(x) __bswap64((x)) #define be16toh(x) ((uint16_t)(x)) #define be32toh(x) ((uint32_t)(x)) #define be64toh(x) ((uint64_t)(x)) -#define le16toh(x) bswap16((x)) -#define le32toh(x) bswap32((x)) -#define le64toh(x) bswap64((x)) +#define le16toh(x) __bswap16((x)) +#define le32toh(x) __bswap32((x)) +#define le64toh(x) __bswap64((x)) #endif /* _BYTE_ORDER == _LITTLE_ENDIAN */ /* Alignment-agnostic encode/decode bytestream to/from little/big endian. */