svn commit: r223959 - head/sys/sparc64/pci

Marius Strobl marius at FreeBSD.org
Tue Jul 12 17:55:34 UTC 2011


Author: marius
Date: Tue Jul 12 17:55:34 2011
New Revision: 223959
URL: http://svn.freebsd.org/changeset/base/223959

Log:
  - Add a missing shift in schizo_get_timecount(). This happened to be non-fatal
    as STX_CTRL_PERF_CNT_CNT0_SHIFT actually is zero, if we were using the
    second counter in the upper 32 bits this would be required though as the MI
    timecounter code doesn't support 64-bit counters/counter registers.
  - Remove a redundant NULL assignment from the timecounter initialization.

Modified:
  head/sys/sparc64/pci/schizo.c

Modified: head/sys/sparc64/pci/schizo.c
==============================================================================
--- head/sys/sparc64/pci/schizo.c	Tue Jul 12 15:07:17 2011	(r223958)
+++ head/sys/sparc64/pci/schizo.c	Tue Jul 12 17:55:34 2011	(r223959)
@@ -482,7 +482,6 @@ schizo_attach(device_t dev)
 		if (tc == NULL)
 			panic("%s: could not malloc timecounter", __func__);
 		tc->tc_get_timecount = schizo_get_timecount;
-		tc->tc_poll_pps = NULL;
 		tc->tc_counter_mask = STX_CTRL_PERF_CNT_MASK;
 		if (OF_getprop(OF_peer(0), "clock-frequency", &prop,
 		    sizeof(prop)) == -1)
@@ -1521,6 +1520,7 @@ schizo_get_timecount(struct timecounter 
 	struct schizo_softc *sc;
 
 	sc = tc->tc_priv;
-	return (SCHIZO_CTRL_READ_8(sc, STX_CTRL_PERF_CNT) &
-	    (STX_CTRL_PERF_CNT_MASK << STX_CTRL_PERF_CNT_CNT0_SHIFT));
+	return ((SCHIZO_CTRL_READ_8(sc, STX_CTRL_PERF_CNT) &
+	    (STX_CTRL_PERF_CNT_MASK << STX_CTRL_PERF_CNT_CNT0_SHIFT)) >>
+	    STX_CTRL_PERF_CNT_CNT0_SHIFT);
 }


More information about the svn-src-all mailing list