Skip to contentSkip to conversation

parisc: Add cacheflush() syscall

PATCH New Helge Deller 1 participant 1 message Jun 1, 2023 PA-RISC architecture

lore
Share & tools
lore

Helge Deller

author maintainer
#0 lore raw

PATCH 1/1 parisc: Add cacheflush() syscall

Implement the missing cacheflush() syscall.

---
 arch/parisc/include/asm/assembly.h      |  7 ++++
 arch/parisc/include/uapi/asm/cachectl.h | 12 +++++++
 arch/parisc/kernel/cache.c              | 46 +++++++++++++++++++++++++
 arch/parisc/kernel/syscalls/syscall.tbl |  1 +
 4 files changed, 66 insertions(+)
 create mode 100644 arch/parisc/include/uapi/asm/cachectl.h
arch/parisc/include/asm/assembly.h +7 -0
index 0f0d4a496fef..286fea9b6372 100644
@@ -581,6 +581,13 @@
 	.word (fault_addr - .), (except_addr - .)	!	\
 	.previous
 
+#else /* __ASSEMBLY__ */
+
+#ifdef CONFIG_64BIT
+# define COND(x)	"*" __stringify(x)
+#else
+# define COND(x)	__stringify(x)
+#endif
 
 #endif /* __ASSEMBLY__ */
 #endif
arch/parisc/include/uapi/asm/cachectl.h new file +12 -0
new file mode 100644
index 000000000000..68d6b455498b
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+#ifndef _ASM_CACHECTL
+#define _ASM_CACHECTL
+
+/*
+ * Options for cacheflush system call
+ */
+#define ICACHE	(1<<0)		/* flush instruction cache	  */
+#define DCACHE	(1<<1)		/* writeback and flush data cache */
+#define BCACHE	(ICACHE|DCACHE) /* flush both caches		  */
+
+#endif	/* _ASM_CACHECTL */
arch/parisc/kernel/cache.c +46 -0

61 lines not on this page · raw message

arch/parisc/kernel/syscalls/syscall.tbl +1 -0
index 0e42fceb2d5e..293c0484447b 100644
@@ -400,6 +400,7 @@
 353	common	pkey_free		sys_pkey_free
 354	common	rseq			sys_rseq
 355	common	kexec_file_load		sys_kexec_file_load		sys_kexec_file_load
+356	common	cacheflush		sys_cacheflush
 # up to 402 is unassigned and reserved for arch specific syscalls
 403	32	clock_gettime64			sys_clock_gettime		sys_clock_gettime
 404	32	clock_settime64			sys_clock_settime		sys_clock_settime

--
2.40.1