From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id 2108A3857C52 for ; Sun, 20 Dec 2020 20:54:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2108A3857C52 Received: by mail-wr1-x42d.google.com with SMTP id t16so8910509wra.3 for ; Sun, 20 Dec 2020 12:54:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:cc:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=WU57UDH9iBA+SpWG/JBlCFUVWISWmdR25NDdKT5/S3c=; b=lhlTnJLcY5Ym1f0Ea/GIrrvQr8ik3hsysqJveADezkd5enfKoxMRqCUovsV17qDkPS 4jgM2IdVBLeDrOeWCP8eS9UkkHwVL7MpKG9Zsh4tBNzyekbl5VXJnTGcwuFL95BNlYCf U50JwALGmEBmAIKvYlTjFCeNEpKjcpXTNxZXE/jrx8v59pvghTdcBduga0T2XrxFzyvu s11bh/nG7nZe7Q+/O7y7gvZ7JCYBmWjOXNm1iHAKV81Hfls8Kr9wWNXb4YBgaRv+tTxB g8+E86H9A4LD6DHoACzypvkXFdLlsCwM40jJNhm7LarwIuu1cp1dMjjSCNxyAVkXqcSN 3PWg== X-Gm-Message-State: AOAM531rQt9tT4NzgBnQ4i5rjZMVvGsIS8dBi8dvXrnY4YHXoitW/DzJ rTJcH98KgWuS7cGrKW8yIZ9H5oqDxWyt5g== X-Google-Smtp-Source: ABdhPJwytmEUOzZSF9jWilBV08Nu0od0fJlT0cOl+k5I/CICI8GpuyJTO/fBARjwip72nszUqtF0rQ== X-Received: by 2002:adf:d085:: with SMTP id y5mr15571261wrh.41.1608497695921; Sun, 20 Dec 2020 12:54:55 -0800 (PST) Received: from ?IPv6:2001:a61:2467:2f01:faca:3d43:5e40:30d1? ([2001:a61:2467:2f01:faca:3d43:5e40:30d1]) by smtp.gmail.com with ESMTPSA id l8sm21563534wmf.35.2020.12.20.12.54.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 20 Dec 2020 12:54:55 -0800 (PST) Cc: mtk.manpages@gmail.com, 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 Subject: Re: [PATCH] cacheflush.2: Document Architecture-specific variants To: Alejandro Colomar , Dave Martin , Heinrich Schuchardt , linux-man@vger.kernel.org References: <20201214143852.16565-1-alx.manpages@gmail.com> From: "Michael Kerrisk (man-pages)" Message-ID: <53a3c827-3e83-441b-8192-afdf323ca296@gmail.com> Date: Sun, 20 Dec 2020 21:54:53 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <20201214143852.16565-1-alx.manpages@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, 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: Sun, 20 Dec 2020 20:54:58 -0000 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. > +.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 -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/