Skip to contentSkip to conversation

parisc: Define depi_safe macro

PATCH New John David Anglin 1 participant 1 message Dec 21, 2021 PA-RISC architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 parisc: Define depi_safe macro

Define depi_safe macro.

The depi instruction is similar to the extru instruction on 64-bit machines. It leaves the most-significant 32 bits of the target register in an undefined state. On 64-bit machines, the macro uses depdi to perform safe deposits in the least-significant 32 bits.

---

arch/parisc/include/asm/assembly.h +10 -0
index 6d13ae236fcb..6369082c6c74 100644
@@ -158,6 +158,16 @@
 #endif
 	.endm
 
+	/* The depi instruction leaves the most significant 32 bits of the
+	 * target register in an undefined state on PA 2.0 systems. */
+	.macro depi_safe i, p, len, t
+#ifdef CONFIG_64BIT
+	depdi	\i, 32+(\p), \len, \t
+#else
+	depi	\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