[Hangcheck-timer-commits] rev 42 - trunk

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Wed Oct 29 12:56:41 CST 2003


Author: jlbec
Date: 2003-10-29 12:56:39 -0600 (Wed, 29 Oct 2003)
New Revision: 42

Modified:
   trunk/ChangeLog
   trunk/Makefile
   trunk/hangcheck-timer.c
Log:
hangcheck on 390

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2003-07-26 00:10:08 UTC (rev 41)
+++ trunk/ChangeLog	2003-10-29 18:56:39 UTC (rev 42)
@@ -1,4 +1,9 @@
 
+2003-10-29	Joel Becker <joel.becker at oracle.com>
+
+	* Makefile: Version 0.9.0
+	* hangcheck-timer.c: Handle s390 (thank you SuSE).
+
 2003-07-25	Joel Becker <joel.becker at oracle.com>
 
 	* Makefile: Bumped to 0.8.0

Modified: trunk/Makefile
===================================================================
--- trunk/Makefile	2003-07-26 00:10:08 UTC (rev 41)
+++ trunk/Makefile	2003-10-29 18:56:39 UTC (rev 42)
@@ -12,7 +12,7 @@
 PACKAGE = hangcheck
 
 VERSION = 0
-PATCHLEVEL = 8
+PATCHLEVEL = 9
 SUBVERSION = 0
 EXTRAVERSION =
 

Modified: trunk/hangcheck-timer.c
===================================================================
--- trunk/hangcheck-timer.c	2003-07-26 00:10:08 UTC (rev 41)
+++ trunk/hangcheck-timer.c	2003-10-29 18:56:39 UTC (rev 42)
@@ -111,13 +111,16 @@
 
 static int use_cyclone = 0;
 #define COUNTER_MASK (use_cyclone ? CYCLONE_TIMER_MASK : ~0ULL)
-#ifdef __ia64__
+#ifdef __s390__
+/* FA240000 is 1 Second in the IBM time universe (Page 4-38 Principles of Op for zSeries */
+# define TIMER_FREQ 0xFA240000ULL
+#elif defined(__ia64__)
 # define TIMER_FREQ ((unsigned long long)local_cpu_data->itc_freq)
 #elif defined(__powerpc64__)
 # define TIMER_FREQ (HZ*loops_per_jiffy)
 #else
 # define TIMER_FREQ (use_cyclone ? CYCLONE_TIMER_FREQ : HZ*(unsigned long long)current_cpu_data.loops_per_jiffy)
-#endif  /* __ia64__ */
+#endif  /* __s390__ */
 
 #ifdef HAVE_MONOTONIC
 extern unsigned long long monotonic_clock(void);
@@ -130,6 +133,9 @@
 # endif  /* __i386__ */
 static inline unsigned long long monotonic_clock(void)
 {
+# ifdef __s390__
+	/* returns the TOD.  see 4-38 Principles of Op of zSeries */
+	return get_clock();
 # ifdef __i386__
 	if(use_cyclone)
 		return get_cyclone();
@@ -178,15 +184,21 @@
 {
 	printk("Hangcheck: starting hangcheck timer %s (tick is %d seconds, margin is %d seconds).\n",
 	       VERSION_STR, hangcheck_tick, hangcheck_margin);
-#if !defined(HAVE_MONOTONIC) && defined(__i386__)
+#if defined (HAVE_MONOTONIC)
+	printk("Hangcheck: Using monotonic_clock().\n");
+#elif defined(__s390__)
+	printk("Hangcheck: Using TOD.\n");
+#elif defined(__i386__)
 	if(!init_cyclone()){
 		use_cyclone = 1;
 		printk("Hangcheck: Using cyclone counter.\n");
 	}else{
 		printk("Hangcheck: Using TSC.\n");
 	}
-#endif
-	hangcheck_tsc_margin = 
+#else
+	printk("Hangcheck: Using get_cycles().\n");
+#endif  /* HAVE_MONOTONIC */
+	hangcheck_tsc_margin =
 		(unsigned long long)(hangcheck_margin + hangcheck_tick);
 	hangcheck_tsc_margin *= (unsigned long long)TIMER_FREQ;
 



More information about the Hangcheck-timer-commits mailing list