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: 41376 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4D1AC3857010; Mon, 14 Dec 2020 14:39:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4D1AC3857010 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1607956752; bh=Y23uQOHXl8QZ5RIklxR/5d33ikY1eJDu8wcPOna5oh4=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=xRz2eAoEcV/ihMUskShTHNt6WdgIADrsHizP2MWpvv7qfityjdtBcxecZte0ximUH QzyghcVD0TyyboTissERCmDEnaVvndojlK7BNgqFv9MEJvmsw4MTAI1LuITd+BbNkQ KNU0IViBhWk9jk6oLn/+A4fMh4vmB7EQwrq8ZKSc= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by sourceware.org (Postfix) with ESMTPS id ECA733857C6D for ; Mon, 14 Dec 2020 14:39:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org ECA733857C6D Received: by mail-wr1-x442.google.com with SMTP id i9so16660650wrc.4 for ; Mon, 14 Dec 2020 06:39:08 -0800 (PST) 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=kwH2+MotVtwjv/FzuXIsFU+5h6mJPDvDBRgIwZ1NADlMwm33Zn8sk6lonF1BLbT1fi 1dcLgDILSXqnpybytqRkmCo34zu3KVjBtzaTU8zfBgdRPRLBLSbnErZ64zrLXtr0K31W HYHrjLUMeMUjnVIk5QtC6+JLWNuJ8jI8snMmYwDOyDXwxBvRmVTAocmJ4noBdjr0zAPO hK2VJ3MFVbY1qFdXPZaSfZrUj/yF3wZJU88yQbA8JV2VZKMvYqU2xbOFD9wXmpZmYzt7 QblJ6A81RA27FGsr0Bn7eHPNStm49xwltwV4sPwbE5DLI89n579Eok3/uBFRAo41Gd2i H4hQ== X-Gm-Message-State: AOAM531WDgig8pgLTxwvoJofoCHQnWskJqUh1OHT002KZChsUkGEXUNl /cLXWoyQB0tNXFX9CmfQldg= 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) 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-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Alejandro Colomar via Libc-alpha From: Alejandro Colomar Reply-To: Alejandro Colomar 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 Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" 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 (),