From nobody Sat Feb 3 13:51:06 2024 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 4TRvDq1Nzlz59R05; Sat, 3 Feb 2024 13:51:07 +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 4TRvDq0mFgz44PM; Sat, 3 Feb 2024 13:51:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706968267; 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=SwKRvYH/bZNBquin1Jmcqc1j3etlu5ZyyyD5jLty7M8=; b=i1nwDSIBh5ETvsv0hVHmIWZgVuZ0jnejgLasLIUtvskssI9AtVLJpzE7tcqEu0rKKH+jgf SlGjRme0aRG0sVFcRrBb6qcg5UGsCglxfzPrhkDuVQSPZl3ou4yYnhv9t+bKU8GQpvYRHR PIar4rAjpeUjsrFeojSG2UTxJWHTnUh1ysxtdOnQwrWtmzOdcVWxsQymZ8SDMFediRr84U K9TTpreg1DR6Vf43YxEtbDwMm/EUztBc/pfPyj9NPr/z+nLUzm4Lxr3BnUU/rbLPJ4nu80 GvaCBYBMVrx4FwEuIgn3G0Y0t6WCmRSClx7DqzSq4nUQm5V9gwk1A8ex9vTv2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706968267; 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=SwKRvYH/bZNBquin1Jmcqc1j3etlu5ZyyyD5jLty7M8=; b=hQYZvqLz9WaBAhWmvOp4Rfp+xmvcfR9ND7OVYxTCK8aqms8xCI9/tl8UYmiPCBcm6wIrze ZO2oUYSioilS7nlGQFUwS7us9VQN++oVWZVIXb9wKsTcdYZWKOr9ezAFCBxyxIC2kynYkP EyjO6FxhqMAt6K3rAFi4ja7VbMWGMrWNfLfel3qnNPodlQxJMtVjb1YMYF8GxdVizvw9LK xIWHv7cEHCExnHetNMP4qq6HfbcshGUdXfUGitdnhZPDv5tLm2fT7hxRTfcg6U0jmlXNhj 332c/430i2Sj1xJvSKfBGcsQw3yOBz5ptFhrUkvzcN30TkfMk5a2BR52fBDZDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706968267; a=rsa-sha256; cv=none; b=coS+8XOLQz/QMnAMomOhg5+gE95AVzzafyUi6hYYZaegZ7NiYoPpAvhZ2e6wuI9TQ7klJ9 7ThU5Fjtab8P0jnRGuj3BZIm77NA3qdJNVRwT6u6+w87jbmNqv6xdt9Yo+Kuun1egZQwQZ QctywQj9TLMe0+qQv6uAzZ2ya8GDs++S2CnhP0HdbJrRsncpwphxioX0nhmblLeSl+trjA ZAz1AyJBVKwnr5sVkuP6CXSj5olJnUnmetUon4xV0yGaImZCRozHK9D3QliHLsLg7nHa5+ d5IfJntjBV1xNtt8GNkwKglwAlLt3vIqTLkGhWf0GX3CgZW/GWziE8KZpv9o0g== 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 4TRvDp6sbqzGh5; Sat, 3 Feb 2024 13:51:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 413Dp6rJ048707; Sat, 3 Feb 2024 13:51:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 413Dp6uh048704; Sat, 3 Feb 2024 13:51:06 GMT (envelope-from git) Date: Sat, 3 Feb 2024 13:51:06 GMT Message-Id: <202402031351.413Dp6uh048704@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: 2d9d35837d8e - main - LinuxKPI: implement memset_after() 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: 2d9d35837d8ea3ee7d7447d63a8755d45ec2fd96 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=2d9d35837d8ea3ee7d7447d63a8755d45ec2fd96 commit 2d9d35837d8ea3ee7d7447d63a8755d45ec2fd96 Author: Bjoern A. Zeeb AuthorDate: 2024-01-29 14:19:59 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-03 13:50:32 +0000 LinuxKPI: implement memset_after() memset_after() is needed by iwlwifi d3.c. MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D43644 --- sys/compat/linuxkpi/common/include/linux/string.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/string.h b/sys/compat/linuxkpi/common/include/linux/string.h index 1d9b7af5d9d5..f745c2f6d343 100644 --- a/sys/compat/linuxkpi/common/include/linux/string.h +++ b/sys/compat/linuxkpi/common/include/linux/string.h @@ -265,4 +265,12 @@ memcpy_and_pad(void *dst, size_t dstlen, const void *src, size_t len, int ch) memset(_ptr + _o, _c, sizeof(*(ptr)) - _o); \ }) +#define memset_after(ptr, bytepat, smember) \ +({ \ + uint8_t *_ptr = (uint8_t *)(ptr); \ + int _c = (int)(bytepat); \ + size_t _o = offsetofend(typeof(*(ptr)), smember); \ + memset(_ptr + _o, _c, sizeof(*(ptr)) - _o); \ +}) + #endif /* _LINUXKPI_LINUX_STRING_H_ */