aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2021-11-19 22:16:37 +0100
committerHelge Deller <deller@gmx.de>2021-11-22 07:37:31 +0100
commit169d1a4a2adb2c246396c56aa2f9eec3868546f1 (patch)
treedf4284092a168b9639225c3a7f2b9fda16cce31f /arch/parisc
parentparisc: Increase FRAME_WARN to 2048 bytes on parisc (diff)
downloadlinux-dev-169d1a4a2adb2c246396c56aa2f9eec3868546f1.tar.xz
linux-dev-169d1a4a2adb2c246396c56aa2f9eec3868546f1.zip
parisc: Provide an extru_safe() macro to extract unsigned bits
The extru instruction leaves the most significant 32 bits of the target register in an undefined state on PA 2.0 systems. Provide a macro to safely use extru on 32- and 64-bit machines. Suggested-by: John David Anglin <dave.anglin@bell.net> Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'arch/parisc')
-rw-r--r--arch/parisc/include/asm/assembly.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/parisc/include/asm/assembly.h b/arch/parisc/include/asm/assembly.h
index 39e7985086f9..6d13ae236fcb 100644
--- a/arch/parisc/include/asm/assembly.h
+++ b/arch/parisc/include/asm/assembly.h
@@ -147,6 +147,17 @@
extrd,u \r, 63-(\sa), 64-(\sa), \t
.endm
+ /* Extract unsigned for 32- and 64-bit
+ * The extru instruction leaves the most significant 32 bits of the
+ * target register in an undefined state on PA 2.0 systems. */
+ .macro extru_safe r, p, len, t
+#ifdef CONFIG_64BIT
+ extrd,u \r, 32+(\p), \len, \t
+#else
+ extru \r, \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