Skip to contentSkip to conversation

cacheflush.2: Document Architecture-specific variants

PATCH In review Alejandro Colomar 2 participants 4 messages Dec 14, 2020 – Dec 21, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cacheflush.2: Document Architecture-specific variants

---

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(+)
man2/cacheflush.2 +42 -0
index fc35f1a0b..0761b429a 100644
@@ -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 (),
Signature · 7 lines
2.29.2


_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
#1 lore raw

Ping: [PATCH] cacheflush.2: Document Architecture-specific variants

Ping

Quoted 77 lines · 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(+)
man2/cacheflush.2 +42 -0
index fc35f1a0b..0761b429a 100644
@@ -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 (),
Signature · 8 lines
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
#2 lore raw
In reply to Alejandro Colomar

Hi Alex

Quoted 8 lines · Alejandro Colomar

---

Hi Michael,

Please apply this patch after
'[PATCH v5] cacheflush.2: Document __builtin___clear_cache() as a more
portable alternative'.

Thanks. Applied.

Quoted 29 lines
 man2/cacheflush.2 | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)
man2/cacheflush.2 +11 -0
index fc35f1a0b..0761b429a 100644
@@ -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,

man2/cacheflush.2 but nowadays, Linux provides a · line 110

Quoted 10 lines
man2/cacheflush.2 +10 -0
+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.

Quoted 14 lines
man2/cacheflush.2 +14 -0
+.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 );

man2/cacheflush.2 but nowadays, Linux provides a · line 134

Quoted 10 lines
man2/cacheflush.2 +7 -0
+.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

Signature · 8 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
#3 lore raw
Quoted 65 lines · Michael Kerrisk (man-pages)

Hi Alex

Quoted 8 lines · Alejandro Colomar

---

Hi Michael,

Please apply this patch after
'[PATCH v5] cacheflush.2: Document __builtin___clear_cache() as a more
portable alternative'.

Thanks. Applied.

Quoted 29 lines
 man2/cacheflush.2 | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)
man2/cacheflush.2 +11 -0
index fc35f1a0b..0761b429a 100644
@@ -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,

man2/cacheflush.2 but nowadays, Linux provides a · line 110

Quoted 10 lines
man2/cacheflush.2 +10 -0
+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
]]

Quoted 2 lines

That's for consistency wqith the SYNOPSIS sections, where .EX/.EE isn't used.

Ahh. Right!

Thanks,

Alex

Quoted 33 lines
Quoted 15 lines
man2/cacheflush.2 +14 -0
+.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 );

man2/cacheflush.2 but nowadays, Linux provides a · line 134

Quoted 10 lines
man2/cacheflush.2 +7 -0
+.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

Signature · 8 lines
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc