diff -up haveged-1.3/configure.ac.s390 haveged-1.3/configure.ac
--- haveged-1.3/configure.ac.s390 2011-11-25 10:33:44.784760266 -0500
+++ haveged-1.3/configure.ac 2011-11-25 10:34:02.044760923 -0500
@@ -93,6 +93,10 @@ case "$host" in
HA_CPPFLAGS="-DHAVE_ISA_SPARC"
;;
+ s390*-*)
+ HA_CPPFLAGS="-DHAVE_ISA_S390"
+ ;;
+
*)
echo "Unsupported host: $host";
exit 1
diff -up haveged-1.3/configure.s390 haveged-1.3/configure
--- haveged-1.3/configure.s390 2011-11-25 10:49:45.334762435 -0500
+++ haveged-1.3/configure 2011-11-25 10:37:49.964754934 -0500
@@ -4585,6 +4585,10 @@ case "$host" in
HA_CPPFLAGS="-DHAVE_ISA_SPARC"
;;
+ s390*-*)
+ HA_CPPFLAGS="-DHAVE_ISA_S390"
+ ;;
+
*)
echo "Unsupported host: $host";
exit 1
diff -up haveged-1.3/src/havegecollect.h.s390 haveged-1.3/src/havegecollect.h
--- haveged-1.3/src/havegecollect.h.s390 2011-11-25 10:34:13.574761327 -0500
+++ haveged-1.3/src/havegecollect.h 2011-11-25 10:35:30.934753116 -0500
@@ -122,6 +122,11 @@ unsigned int havege_collect(volatile H_P
#define HARDCLOCK(x) ASM("mftb %0":"=r"(x)) /* eq. to mftb %0, 268 */
#endif
+#ifdef HAVE_ISA_S390
+#define ARCH "s390"
+#define HARDCLOCK(x) { unsigned long long tsc; ASM("stck %0":"=Q"(tsc)::"cc"); x = (unsigned int)tsc; }
+#endif
+
#ifdef HAVE_ISA_IA64
#define ARCH "ia64"
#define CPUID(op,reg) ASM("mov %0=cpuid[%1]"\