lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 28 Sep 2007 18:33:51 -0400
From:	Kyle McMartin <kyle@...artin.ca>
To:	linux-arch@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, Kyle McMartin <kyle@...artin.ca>
Subject: [COMPAT] Add compat_merge64 helper

To be used when endianness matters for argument ordering when reassembling
a 64-bit value out of two register halves.

Signed-off-by: Kyle McMartin <kyle@...artin.ca>
---
 include/linux/compat.h |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/include/linux/compat.h b/include/linux/compat.h
index 0e69d2c..07bcc3c 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -267,5 +267,14 @@ asmlinkage long compat_sys_signalfd(int ufd,
 asmlinkage long compat_sys_timerfd(int ufd, int clockid, int flags,
 				const struct compat_itimerspec __user *utmr);
 
+static inline u64 compat_merge64(u32 left, u32 right)
+{
+#if defined(__BIG_ENDIAN)
+	return ((u64)left << 32) | right;
+#else /* defined (__LITTLE_ENDIAN) */
+	return ((u64)right << 32) | left;
+#endif
+}
+	
 #endif /* CONFIG_COMPAT */
 #endif /* _LINUX_COMPAT_H */
-- 
1.5.3.2

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ