From patchwork Mon Dec 14 14:38:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 1415986 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=lmFk45kn; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=L6tz25Dm; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (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) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CvkYJ0Swdz9sPB for ; Tue, 15 Dec 2020 01:39:14 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=GWUr59Bi7ipmBi+pZoh5oNPyF1ZtGMx6DuxV4xKb3B4=; b=lmFk45kn9+6v/pvbzPW31w850y KmSnRLIn/ZIyAlFm81KDBx54+HPJDh91ibAMPafzB2D7e4J8RTplgt5K6zQlEJYSPnLcjInp4ImrQ KWgUkq+xME3QTDQpVu5THxVTbZzjaIqpSvwiLwJauRbk1P1A9HT/wmZ6Ed7zEbpxxRwwhdrYyNTp2 S67XaNd3/xIhgO5fgsfUdvzyJHzykdOcoXNAd6V9vaRDn3JfomulR8X1UPgtwctPpZR6uaS8T5PEW pTzfqvDgKAv6Zuhtb2xhUoP0J6d+NxsQhpEys/zb/SfvENnm83OHr/Qi/Fnco/d0TWIpqKaX7gWqh gIrY6gGg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kop0J-00048f-19; Mon, 14 Dec 2020 14:39:11 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kop0G-000488-Uw for linux-snps-arc@lists.infradead.org; Mon, 14 Dec 2020 14:39:09 +0000 Received: by mail-wr1-x442.google.com with SMTP id a11so8912558wrr.13 for ; Mon, 14 Dec 2020 06:39:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Y23uQOHXl8QZ5RIklxR/5d33ikY1eJDu8wcPOna5oh4=; b=L6tz25Dmbm6QTy/RsOTHj5HcD+iVVZXZ9pDv1dXNiPIUjzgZ3vz2s9Jsi8bDGn8OW4 2YkyF5rU/HLezWAyBNB6QMCNBG8/HuvpFBX+rz8/VdKBKS5VVt39sWNvga9Q53e7R733 0LpK5/rJTUMvJbs3pGlBAzAEqdZmaZgEuaPJc728JO42MKOphAv+uSg7af7zvgoz34P6 6UG1aBiBYuu3bKLd+DJXPJTECQWb62n2d9EnSPdqZB5T6BJbifDwfjKDSUo7qDamU66o 8VdH2J+YpEYeDoeN7/bocXWlfCox28B/i9OkKwLvgulGEKd96SGHbVV8l6K6rduduooi +7BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Y23uQOHXl8QZ5RIklxR/5d33ikY1eJDu8wcPOna5oh4=; b=pCVhXOWNrEw27DyjVL9gi0qYvvdcMWBtLecLqnikUmnOqIdyzQ45lU18dzx9qV4VrP E9mXDMWoL+s1PVDKHkzsw1kzj+Nu7fX/0zBZ0gv44m0LxkbL4iBZOV4dwUdvhYlp40/0 s4Craaj3og3M41oPWm3LkTImVMy660KNCAFVAqEiD5Tit96egelyO1uHB/OXf+cx5F8i 6oRsfHr2JIP/5pjD7hqwjRNWqiICZ8Yzc+iWGfRdGSRvy54fBhjyrzF+Rt0SQkIWVwKv +4c8iyin+732qLQDLE7nMIi9Fljw68v0fLXel1iHTJX+NVYGpmLyBeIPn+c9Pqa1kNNs +5EQ== X-Gm-Message-State: AOAM530LGbWc8UyqZZClPtoeKMwI75dzE6r1jvZNWjGtJEr7VYq3X+js PS+WbBr8NaO5+n5fUxB/678= X-Google-Smtp-Source: ABdhPJw6FLJ01Z+XyCZT/YG7W+WiJ6p1Di+54cDzlWLY2Y7+ZsEyURKbqB2sn9ipAH3YjqEV1gr5gw== X-Received: by 2002:a05:6000:185:: with SMTP id p5mr28298483wrx.403.1607956748086; Mon, 14 Dec 2020 06:39:08 -0800 (PST) Received: from debian.vlc ([170.253.51.130]) by smtp.gmail.com with ESMTPSA id w18sm12481539wrn.2.2020.12.14.06.39.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Dec 2020 06:39:07 -0800 (PST) From: Alejandro Colomar To: Michael Kerrisk , Dave Martin , Heinrich Schuchardt , linux-man@vger.kernel.org Subject: [PATCH] cacheflush.2: Document Architecture-specific variants Date: Mon, 14 Dec 2020 15:38:53 +0100 Message-Id: <20201214143852.16565-1-alx.manpages@gmail.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201214_093909_009783_94FF6BD9 X-CRM114-Status: GOOD ( 10.52 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:442 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [alx.manpages[at]gmail.com] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alejandro Colomar , Thomas Bogendoerfer , Vincent Chen , Nick Hu , Vineet Gupta , linux-mips@vger.kernel.org, linux-csky@vger.kernel.org, Guo Ren , Greentime Hu , libc-alpha@sourceware.org, linux-snps-arc@lists.infradead.org Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Alejandro Colomar --- Hi Michael, Please apply this patch after '[PATCH v5] cacheflush.2: Document __builtin___clear_cache() as a more portable alternative'. Thanks, Alex man2/cacheflush.2 | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/man2/cacheflush.2 b/man2/cacheflush.2 index fc35f1a0b..0761b429a 100644 --- a/man2/cacheflush.2 +++ b/man2/cacheflush.2 @@ -31,6 +31,10 @@ cacheflush \- flush contents of instruction and/or data cache .PP .BI "int cacheflush(char *" addr ", int "nbytes ", int "cache ); .fi +.PP +.IR Note : +On some architectures, +there is no glibc wrapper for this system call; see NOTES. .SH DESCRIPTION .BR cacheflush () flushes the contents of the indicated cache(s) for the @@ -87,6 +91,44 @@ but nowadays, Linux provides a .BR cacheflush () system call on some other architectures, but with different arguments. .SH NOTES +.SS Architecture-specific variants +Glibc provides a wrapper for this system call, +with the prototype shown in SYNOPSIS, +for the following architectures: +ARC, CSKY, MIPS, and NIOS2. +.PP +On some other architectures, +Linux provides this system call, with different arguments: +.TP +M68K: +.PP +.in +4n +.EX +.BI "int cacheflush(unsigned long " addr ", int " scope ", int " cache , +.BI " unsigned long " len ); +.EE +.in +.TP +SH: +.PP +.in +4n +.EX +.BI "int cacheflush(unsigned long " addr ", unsigned long " len ", int " op ); +.EE +.in +.TP +NDS32: +.PP +.in +4n +.EX +.BI "int cacheflush(unsigned int " start ", unsigned int " end ", int " cache ); +.EE +.in +.PP +On the above architectures, +glibc does not provide a wrapper for this system call; call it using +.BR syscall (2). +.SS GCC alternative Unless you need the finer grained control that this system call provides, you probably want to use the GCC built-in function .BR __builtin___clear_cache (),