From nobody Wed Sep 07 15:09:48 2022 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 4MN5Js150Kz4cd22; Wed, 7 Sep 2022 15:09:49 +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 4MN5Js0XSNz3WN9; Wed, 7 Sep 2022 15:09:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662563389; 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=H45uKEyvPXT/iLi0QRmDiqC0lu7nJac8RdDvjE+f+2E=; b=DleQPh3lz4fIM+lUWCKC/H0O896FK5th9LXZ3u2tr7ufrLIAc39YkPM8SQPTDIa6eeyYW9 bhd2WQ8SeLhmiOqUNgBGAJ+H20CxERmtil+IQ3FmFcecpShCSGJG28bZDGW0AEbJG/HN0o Uy8HsLtTcwY30+2QJqhYc2ynpF1oAR9WVFJP7xCAQG6jIsKrqgO7kgJbiLC36eZvLC4FxR ELIqb3Q6A3DNiv195hQBl5+ItfHhxt14HUugknjI2mR0rNF16OHkEvvsiq4hdnUPklkbUG o6r3v3A24UxcMupjAes7NJWRhwbR+zV/ftR8kWc1WIwXCK13gEj1OX7FWilJ8A== 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 4MN5Jr6gJZzYqf; Wed, 7 Sep 2022 15:09:48 +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 287F9mCC017049; Wed, 7 Sep 2022 15:09:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 287F9miG017048; Wed, 7 Sep 2022 15:09:48 GMT (envelope-from git) Date: Wed, 7 Sep 2022 15:09:48 GMT Message-Id: <202209071509.287F9miG017048@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 6d8dc6c97157 - stable/13 - linuxkpi: Add circ_buf.h 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: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6d8dc6c9715700c9281c9f0eac763ffc346e8477 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662563389; 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=H45uKEyvPXT/iLi0QRmDiqC0lu7nJac8RdDvjE+f+2E=; b=YeoOqm5uT3ST7vkdBRhK5RBsj/6RiAKyxqnp7wHgVkJefZAlWwNUKWMWTBf7TjzTzkBBif RQbAQm/8/mc7vPx0BVPAuyIhGvQjOOa0YuLfIcEV2cakKZUe3YXO1WpYI1yKp/icg/E0Dl cdyAwYXNBsyXk4GDAj+yqlmFmLIiQXXCIMUMF8BfsQyUxDjsWUQPBIzSXRDRyvFLkg7zUZ kMlY4AY1uOYod8ATVE4kwq4m6dr2eY6P9HkhojH24swlXyaMeMTGHvksc1wLmF1jOdaqWB 4klJOBpfqL7hS35TZhYiS7FQFi60eZgFnJWStwt/yCCPkCp+aMgF7il4G2VV9Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1662563389; a=rsa-sha256; cv=none; b=mPvYtudEN5kAUS/kX5tx79Dl6HWmFW7sUpR7U9rr+na8x9ZV787YlPuoevFwi0rHjWaVPE WD0FyXfNjMwz7iS/iZU3T3WuqEPSGzxnKnYLToXfGKr+UlMwvDcgd9Saz7EwUrI3CnAzwN R5Lv6Eyuy7iQjapnSNFeIKMKeDmKlS1kd16PZpKkQ3C3byHlw/bSYonCihFmLXPPvZflfE 8ZsoSwlhFtaVTBEHVeMLLsBg0G+sp6RFefiS85JSAK5nOBRTXZqCwxSYj/zgxfXhaU8OUX 1QaZ9MhoI7MYWAi9anEFcgKoXxFswyl+2ImJMqRg+SFIcuwnOfkLw38BUmrFLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=6d8dc6c9715700c9281c9f0eac763ffc346e8477 commit 6d8dc6c9715700c9281c9f0eac763ffc346e8477 Author: Emmanuel Vadot AuthorDate: 2022-06-23 07:46:03 +0000 Commit: Emmanuel Vadot CommitDate: 2022-09-07 15:09:02 +0000 linuxkpi: Add circ_buf.h Provide macros needed for drm-kmod. Reviewed by: bz MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D35561 (cherry picked from commit 7674baeb37870b05539a0214c99ce55d9f199fb0) --- .../linuxkpi/common/include/linux/circ_buf.h | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/circ_buf.h b/sys/compat/linuxkpi/common/include/linux/circ_buf.h new file mode 100644 index 000000000000..53d7fa736ef8 --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/circ_buf.h @@ -0,0 +1,34 @@ +/*- + * Copyright (c) 2022 Beckhoff Automation GmbH & Co. KG + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#ifndef _LINUXKPI_LINUX_CIRC_BUF_H_ +#define _LINUXKPI_LINUX_CIRC_BUF_H_ + +#define CIRC_CNT(head,tail,size) (((head) - (tail)) & ((size) - 1)) +#define CIRC_SPACE(head,tail,size) CIRC_CNT((tail),((head) + 1),(size)) + +#endif /* _LINUXKPI_LINUX_CIRC_BUF_H_ */ +