linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/6] powerpc: Add ZERO_GPRS macros for register clears
@ 2022-06-01  5:48 Rohan McLure
  2022-06-01  5:48 ` [PATCH 2/6] powerpc: Provide syscall wrapper Rohan McLure
                   ` (6 more replies)
  0 siblings, 7 replies; 31+ messages in thread
From: Rohan McLure @ 2022-06-01  5:48 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Rohan McLure, npiggin

Macros for restoring saving registers to and from the stack exist.
Provide a macro for simply zeroing a range of gprs, or an individual
gpr.

Signed-off-by: Rohan McLure <rmclure@linux.ibm.com>
---
 arch/powerpc/include/asm/ppc_asm.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h
index 4dea2d963738..3fb37a9767f7 100644
--- a/arch/powerpc/include/asm/ppc_asm.h
+++ b/arch/powerpc/include/asm/ppc_asm.h
@@ -33,6 +33,19 @@
 	.endr
 .endm
 
+/*
+ * Simplification of OP_REGS, for an arbitrary right hand operand.
+ *
+ *   op  reg, rhs
+ */
+.macro BINOP_REGS op, rhs, start, end
+	.Lreg=\start
+	.rept (\end - \start + 1)
+	\op .Lreg, \rhs
+	.Lreg=.Lreg+1
+	.endr
+.endm
+
 /*
  * Macros for storing registers into and loading registers from
  * exception frames.
@@ -49,6 +62,10 @@
 #define REST_NVGPRS(base)		REST_GPRS(13, 31, base)
 #endif
 
+#define ZERO_GPRS(start, end)		BINOP_REGS li, 0, start, end
+#define ZERO_NVGPRS()			ZERO_GPRS(14, 31)
+#define ZERO_GPR(n)			ZERO_GPRS(n, n)
+
 #define SAVE_GPR(n, base)		SAVE_GPRS(n, n, base)
 #define REST_GPR(n, base)		REST_GPRS(n, n, base)
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2022-06-16  7:20 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-01  5:48 [PATCH 1/6] powerpc: Add ZERO_GPRS macros for register clears Rohan McLure
2022-06-01  5:48 ` [PATCH 2/6] powerpc: Provide syscall wrapper Rohan McLure
2022-06-01  8:29   ` Christophe Leroy
2022-06-09 13:06     ` Christophe Leroy
2022-06-16  5:42       ` Rohan McLure
2022-06-16  7:20         ` Arnd Bergmann
2022-06-01  8:59   ` kernel test robot
2022-06-01  9:35   ` kernel test robot
2022-06-01 12:23   ` kernel test robot
2022-06-01 14:33   ` Christophe Leroy
2022-06-03  3:24     ` Rohan McLure
2022-06-03  7:09       ` Andrew Donnellan
2022-06-03  8:39         ` Christophe Leroy
2022-06-14 13:57           ` Andrew Donnellan
2022-06-03  9:04   ` Arnd Bergmann
2022-06-15  1:47     ` Rohan McLure
2022-06-15 10:13       ` Arnd Bergmann
2022-06-01  5:48 ` [PATCH 3/6] powerpc: Make syscalls save and restore gprs Rohan McLure
2022-06-01  8:33   ` Christophe Leroy
2022-06-01  5:48 ` [PATCH 4/6] powerpc: Fix comment, use clear and restore macros Rohan McLure
2022-06-01  5:48 ` [PATCH 5/6] powerpc: Move syscall handler prototypes to header Rohan McLure
2022-06-01  5:48 ` [PATCH 6/6] powerpc/64s: Clear gprs on interrupt routine entry Rohan McLure
2022-06-01  8:37   ` Christophe Leroy
2022-06-01  7:45 ` [PATCH 1/6] powerpc: Add ZERO_GPRS macros for register clears Christophe Leroy
2022-06-01 16:00 ` Segher Boessenkool
2022-06-10  3:32   ` Rohan McLure
2022-06-10 14:05     ` Segher Boessenkool
2022-06-11  8:42     ` Christophe Leroy
2022-06-13 18:48       ` Segher Boessenkool
2022-06-14  4:31         ` Michael Ellerman
2022-06-14 11:43           ` Segher Boessenkool

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).