diff mbox series

[3/4] parisc: Add a dep_safe() macro to deposit a value in 32- and 64-kernels

Message ID 20220517152946.187638-3-deller@gmx.de (mailing list archive)
State Accepted, archived
Headers show
Series [1/4] parisc: Prevent ldil() to sign-extend into upper 32 bits | expand

Commit Message

Helge Deller May 17, 2022, 3:29 p.m. UTC
Signed-off-by: Helge Deller <deller@gmx.de>
---
 arch/parisc/include/asm/assembly.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

--
2.35.3
diff mbox series

Patch

diff --git a/arch/parisc/include/asm/assembly.h b/arch/parisc/include/asm/assembly.h
index be784b41048c..0f0d4a496fef 100644
--- a/arch/parisc/include/asm/assembly.h
+++ b/arch/parisc/include/asm/assembly.h
@@ -174,6 +174,16 @@ 
 #endif
 	.endm

+	/* The depw instruction leaves the most significant 32 bits of the
+	 * target register in an undefined state on PA 2.0 systems. */
+	.macro dep_safe i, p, len, t
+#ifdef CONFIG_64BIT
+	depd	\i, 32+(\p), \len, \t
+#else
+	depw	\i, \p, \len, \t
+#endif
+	.endm
+
 	/* load 32-bit 'value' into 'reg' compensating for the ldil
 	 * sign-extension when running in wide mode.
 	 * WARNING!! neither 'value' nor 'reg' can be expressions