From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by sourceware.org (Postfix) with ESMTPS id B298C3857022 for ; Mon, 21 Dec 2020 08:32:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B298C3857022 Received: by mail-wr1-x429.google.com with SMTP id c5so10130026wrp.6 for ; Mon, 21 Dec 2020 00:32: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:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=VoiV0D68E7iBU6MgOJJtpGcG8ySo+Z5P8wrAxN/JZM4=; b=htBLaDSxoMFyNp6+M4qh7ILnAWeNPYh90zVMBfkJ8sjPBYC4Ke+R1l9g9USHHCfTiw 859Quo6n9zv8GVikBV9CLfBBR0AbW30CWNZmZn2Zvr/UgUgZk6s2zWTVBZnuOuJK+C3F R3NxWO1S/QPxKmmwokPeclx0HAfFwqLPONnFRGTUjnYFqkCXbV5rQPU5G0vQx7b7sYW8 g8mtGWIzFwzzowG83SmD1eZGVNiRKl5nrfGTpvPqEBPczQQCzfLjYrpBMRWhGwehmWZZ LhRhAfsOl/NYUH7LcNzonBSdH/qiXaamiedQ97/7zQ3NxEmTkBmYByqhAr0mi6s2JTOC 7GTg== X-Gm-Message-State: AOAM533OrdNOj8sKTTTb+rd7dsatkf8dv0Oxo2TuNesvflv7nNO/1HCK SXPTPyQrvrSdEueXoAGHhcBFXwuCDcw= X-Google-Smtp-Source: ABdhPJx4YGEmXDYJ2YKR4RrvSOsm7/mnOT/aDO8wr0wOUJEtAbHndIf8eLruBEyKHqfyDd46ST3H8Q== X-Received: by 2002:a5d:504d:: with SMTP id h13mr17651300wrt.246.1608539527540; Mon, 21 Dec 2020 00:32:07 -0800 (PST) Received: from [192.168.1.143] ([170.253.51.130]) by smtp.gmail.com with ESMTPSA id n12sm27406645wrg.76.2020.12.21.00.32.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 21 Dec 2020 00:32:07 -0800 (PST) Subject: Re: [PATCH] cacheflush.2: Document Architecture-specific variants To: "Michael Kerrisk (man-pages)" , Dave Martin , Heinrich Schuchardt , linux-man@vger.kernel.org Cc: Vineet Gupta , linux-snps-arc@lists.infradead.org, Guo Ren , linux-csky@vger.kernel.org, Thomas Bogendoerfer , linux-mips@vger.kernel.org, Nick Hu , Greentime Hu , Vincent Chen , libc-alpha@sourceware.org References: <20201214143852.16565-1-alx.manpages@gmail.com> <53a3c827-3e83-441b-8192-afdf323ca296@gmail.com> From: "Alejandro Colomar (man-pages)" Message-ID: Date: Mon, 21 Dec 2020 09:32:05 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: <53a3c827-3e83-441b-8192-afdf323ca296@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, NICE_REPLY_A, 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-List-Received-Date: Mon, 21 Dec 2020 08:32:11 -0000 On 12/20/20 9:54 PM, Michael Kerrisk (man-pages) wrote: > Hi Alex > > On 12/14/20 3:38 PM, Alejandro Colomar wrote: >> 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. Applied. > >> 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 > > I made the formatting rather: > > [[ > .TP > M68K: > .nf > .BI "int cacheflush(unsigned long " addr ", int " scope ", int " cache , > .BI " unsigned long " len ); > .fi > ]] > > That's for consistency wqith the SYNOPSIS sections, where .EX/.EE > isn't used. Ahh. Right! Thanks, Alex > >> +.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 (), > > > Cheers, > > Michael > > > -- Alejandro Colomar Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/ http://www.alejandro-colomar.es/