From nobody Sun Feb 18 21:11:01 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 4TdJHT451bz5Blwd; Sun, 18 Feb 2024 21:11:01 +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 4TdJHT3Fpbz41w4; Sun, 18 Feb 2024 21:11:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708290661; 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=VtuU56MexsE2hy6hgfLz9yuOugOtL03aGDplWR5PUTE=; b=u6zkWSfqShlL6XIV/i6IE7W9/f+cOaUKLG2ihRI31fOKM5HyEc0bS2B2VTgaKIRnglI1nq nR4yCmMf1kWtqse1E9qcqWateBcdPkThEby2bVL7YUbu3DQZSe62J2yhbaaq4Nd6jFkiSR u5eSUjPAjBnlpLaAU7BIuUy/ESKxH6S8AKxUDkMI8Uf9wP6YrXDRKOqh5ze3JbU6VkQupE MUdwc0vpe/ffKyPDv7Tm9w89aqFBByHlQlj66PcO+NVYnoT/Jf4LSc/oPDU48IXjgO486b Ag73oZHOoMfltYJ8epCTqzrX1a9bLhX4Tfo/4MIczmaq5CGwHHLZx8dO7ardpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708290661; 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=VtuU56MexsE2hy6hgfLz9yuOugOtL03aGDplWR5PUTE=; b=iUX2+phTzXRm98vdWkt9d38zBF8oH7iWReMV19TB2Nsf+jVRiIXKjm9GXoaD8DSGpVwnRW UjC0D7f1+0PloJ/q4If04+SKg2Yh7hOowPqOSBH1uk4QIxJmrhH2WcWAlme+gSMu82DItq bfULzEIhPfYsqljihJi8tzP/EhkQGSBXtLVgeQpuE66/jlLcp5aZl+AfXfdwzm1yD1D5W5 w3b4RhmOsR+kMQOFu6BD6O478b4GZfOwwK9TRCJeDvF9zuoUaMfOcgJeMEpU25NFz6KVcx hFx4uJ2qnsTppLL300BJjvG5d2+r2mVH5HnmkZoFa5VuYwOoER9D1xmD3NsDTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708290661; a=rsa-sha256; cv=none; b=GsZ0egEqsWN/S/yRlinao6dYR+F4igpp3Rgp9RF6VOvwYMJcchOTrG9A4QGKVNxGMesE6v hOOd1hAynFM2mSIVdhdP5Q8T2AEIM5GAav/o/ICW7bpoZVcLvOwweWIrOoTDUwU2o611BJ dI+QBhQwMNnbS+C6Rn80P7bBy23wPfYfsxVSd4Uhf1sRxhrArcn+UhfU54fiZX9g7xsn+b fUsVmevcBj+ErM9BEYTq3CfuIwr035zPwJ6jsgFspGpZouU9r5Lsp4dOUk5uPSo5G2g2lJ VxZIdjXgkdV9IyJ4pHLH9okHMHcOXv4m3Sq7LF4oWwlLcZxw0/G/b6HlC3iZ3A== 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 4TdJHT2Jwvz16Rm; Sun, 18 Feb 2024 21:11:01 +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 41ILB1Uj012737; Sun, 18 Feb 2024 21:11:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41ILB1YP012734; Sun, 18 Feb 2024 21:11:01 GMT (envelope-from git) Date: Sun, 18 Feb 2024 21:11:01 GMT Message-Id: <202402182111.41ILB1YP012734@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: 7117d4b22f74 - stable/14 - 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 7117d4b22f747c692f3d033ef72fee527f890eb8 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=7117d4b22f747c692f3d033ef72fee527f890eb8 commit 7117d4b22f747c692f3d033ef72fee527f890eb8 Author: Bjoern A. Zeeb AuthorDate: 2024-01-29 14:19:59 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-18 16:41:17 +0000 LinuxKPI: implement memset_after() memset_after() is needed by iwlwifi d3.c. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D43644 (cherry picked from commit 2d9d35837d8ea3ee7d7447d63a8755d45ec2fd96) --- 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_ */