From nobody Sat May 20 11:11:09 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 4QNgxp1dFkz4BxJK; Sat, 20 May 2023 11:11:10 +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 4QNgxp195Xz40CS; Sat, 20 May 2023 11:11:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684581070; 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=5iC0hu0GN0DZV4q6vOQKjrFw4PtPCBfT7I3/9TFvaOU=; b=SOUjOupO36pUYrB5Rwp/BJhQHQu3fUlk39R4mZAT+XVc/7PAvnyV/4toHCmBvsSjb93qUD KnQhJhQUVHZz9Ff8PwFcovOKWnM4wKQq1JMQoW5y0CAwBxzg6MX7qHnaCPJfmQm5M45DBy MZ8jWhHgRxyIm/aomlcGgEoLIsK/HMlwcCcSxQAO/Drt0qopYoOBvjTBAokBUhjrl+NxHM Xy7+kOBRMPLuv/E6i5DxrL9toQfjPlKdughNp0/WhbihYqAyZD0t0taQjwDqDwSUpypgCz +s16TVbVGfMHTksu0pBndqNwY+3TGLzZznmbxM7put0zK55+uKdb15C8WOq0kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684581070; 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=5iC0hu0GN0DZV4q6vOQKjrFw4PtPCBfT7I3/9TFvaOU=; b=YlUOlrApM5N7lbIIW2WM+DBmq+qboiznd9OCHo7MC10AibqIqJlDK163OW9udN0wyQvhaj OIE07Aa7xgHj+YcBdCToHvPhSHwNHG+hGYzPxIGe1eRCrotM/V46hXrytVvjxBQxQkx5Ky exdHXEbEIFOcy2PL/qUTKmEuAoWcHqXsYThJVOdEQSMDwkdDzKoMxu5VtIfUK/+K8PUmOl n5XfNn5DzZwGOlGzHJJ/S7Q9oQomMXH5QbZ7cyMD1BCsNtX4YHU3o6OSo2lQU6UCgQhbzK qUeu1odZ10f8Eh7z579HdP+rF1uj0Nlvnp2e0/pCXDHB9bWerfIw2zho3zZbvg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684581070; a=rsa-sha256; cv=none; b=Vi1WeJUgqGljIzHF85xhqNipJuSOHRY+P7saqu3bH/L1oxKjgB7U3a3AIoKg5h+ouVRYO6 MgyRBIXA7CKOLJQ3pElWrEstswgJwugrjVnL9YClFA/mWJN9VSzUhrhLmN9ZKDF7baVklx OEQ/Sn3cEseJO+ss2CPvmoDrgOTzQhBzNNPP1ZSdOyO0EWzYL5/gMGet3TCyCj+9uf1XpR D6Lxysb4f1vwXcIS2tH3DCYWKbYc4K71kXeNoQ/HR4PvJIv0R/722RE+Ee3kMYJ1cRlZtn Cg5wj+UKYfOsyOL26N8OKcRsPpXbAlbeysKq7CYYfS+0gIrMwIMSaRp9M0riRA== 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 4QNgxp0DlWz16mk; Sat, 20 May 2023 11:11:10 +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 34KBB9mT079680; Sat, 20 May 2023 11:11:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34KBB9co079679; Sat, 20 May 2023 11:11:09 GMT (envelope-from git) Date: Sat, 20 May 2023 11:11:09 GMT Message-Id: <202305201111.34KBB9co079679@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: ae1e336e0517 - main - 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/main X-Git-Reftype: branch X-Git-Commit: ae1e336e05171b80123bf6db7457f19c174accc4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=ae1e336e05171b80123bf6db7457f19c174accc4 commit ae1e336e05171b80123bf6db7457f19c174accc4 Author: Bjoern A. Zeeb AuthorDate: 2023-05-20 00:52:27 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-05-20 11:10:31 +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 MFC after: 10 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D40174 --- 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 */