From nobody Mon Jun 26 12:08:47 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 4QqRTD2dJLz4k6st; Mon, 26 Jun 2023 12:08: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 4QqRTD0W4wz3jgj; Mon, 26 Jun 2023 12:08:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687781328; 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=1ljpnzsmSlYEMqXDF7S8xFOJaQap9TW67LndjXiql+o=; b=Wlwy4GO+wuaQzWPqAZo4mqLf6gnkUEcQNXyzrwzR5Sp7Eq4Q+rhWG4wTtTGT1bqvkRVRDU fgAXZHvkk7ip6KalvHV7L0nkUBRmnblVuDOtiDKqOmdeSkUxsAF3cukodfGMps3MryfCH3 rwUiobL6OSileC0Ozaltqk/l9WKDxKxG3mqaXOkLr24RoCViVkBFDMEx486i1lL5kMAZ5U 5A3bWaIZM6DDVPxQi6fd/BqUAR25+IEaFmNExYx6vfWb512rEiDuXt7usAsHQURtWWl35C lBpxgt5d/FM58kwTdOxA1+yhaG93bEDtZ25SG61t+o4K3SkwBqBxEXJGdxfXSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687781328; 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=1ljpnzsmSlYEMqXDF7S8xFOJaQap9TW67LndjXiql+o=; b=d9PqqxJJmoe7znqGWsAJB7UPYci4Dsm6vIm/vOXh7sEUgCP2QcW7Q1K3K6Sy8bWGhp6TAV 7ZZ1G9pdAbYg//fupRdUPun3NiDNE0NO4GGWenZCDoLrkDWdNEj0Yj1EwmCtwDivXDfVQf 9M3Nk3aotLfkJXmyBYE5tMj+uKB102bVfPXEh1M689XxeovFngMko0amGoLiIJy6U9VhV0 0edska1LOfI6eS4QVLkBif5F3mozqpe930PbVEjH6go+CMkYDLIjZbXdl4zj9HlegUzxBO GCGK+illE5bumfCGquwlKVZB0K/LQtvutjgCSxpKgbA6RU+B0Oq2gxZGz7zebA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687781328; a=rsa-sha256; cv=none; b=ILTBu1yJVKcxTs1z+tDdjzpgtTRDIW1Utcl7+dJLSTGd229/qwkI09ylmrYJ4YlHxAs3IC nzC8qByHtrtxFE/T0KBicqNVz5vA+tUN2doHwGXDwa1QR4Hc5aiJFTyDTD29C7BsoQTY5g RZbolRpC6WX6N2e4Cjl3BmofMh5cKDcUEF6JOo16jWY2COKHnB/KJBaeZNoOY2yQZdzfhA FzXu+xH4GTO0KYdGski8E3k70QZcInNw2EygSqvTHPEvmpKQEMlveKJOfpQpDn0DPtQzN8 ys7ZtemuYsufZc8Ql9UfE1CiG0JAudQHYqcjZAGTzby20Rpa7BOzBeCFZp0zIg== 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 4QqRTC6kwMz17db; Mon, 26 Jun 2023 12:08:47 +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 35QC8ltS083307; Mon, 26 Jun 2023 12:08:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35QC8lMc083306; Mon, 26 Jun 2023 12:08:47 GMT (envelope-from git) Date: Mon, 26 Jun 2023 12:08:47 GMT Message-Id: <202306261208.35QC8lMc083306@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: d5881640664c - stable/13 - LinuxKPI: add put_unaligned_le16() and get_unaligned_be64() 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d5881640664cf8740b48888397b90eae32f4fd01 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=d5881640664cf8740b48888397b90eae32f4fd01 commit d5881640664cf8740b48888397b90eae32f4fd01 Author: Bjoern A. Zeeb AuthorDate: 2023-05-20 00:52:27 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-06-26 09:17:32 +0000 LinuxKPI: add put_unaligned_le16() and get_unaligned_be64() Add the two new functions needed by wireless drivers by the same implementation pattern we did for different sizes. Sponsored by: The FreeBSD Foundation Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D40174 (cherry picked from commit ae1e336e05171b80123bf6db7457f19c174accc4) --- sys/compat/linuxkpi/common/include/asm/unaligned.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/asm/unaligned.h b/sys/compat/linuxkpi/common/include/asm/unaligned.h index 8a001ec38c3d..c13089b2c5f4 100644 --- a/sys/compat/linuxkpi/common/include/asm/unaligned.h +++ b/sys/compat/linuxkpi/common/include/asm/unaligned.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2020 The FreeBSD Foundation + * Copyright (c) 2020,2023 The FreeBSD Foundation * * This software was developed by Björn Zeeb under sponsorship from * the FreeBSD Foundation. @@ -50,6 +50,15 @@ get_unaligned_le32(const void *p) return (le32_to_cpup((const __le32 *)p)); } +static __inline void +put_unaligned_le16(__le16 v, void *p) +{ + __le16 x; + + x = cpu_to_le16(v); + memcpy(p, &x, sizeof(x)); +} + static __inline void put_unaligned_le32(__le32 v, void *p) { @@ -82,4 +91,11 @@ get_unaligned_be32(const void *p) return (be32_to_cpup((const __be32 *)p)); } +static __inline uint64_t +get_unaligned_be64(const void *p) +{ + + return (be64_to_cpup((const __be64 *)p)); +} + #endif /* _LINUXKPI_ASM_UNALIGNED_H */