svn commit: r256974 - head/sys/powerpc/booke
Nathan Whitehorn
nwhitehorn at FreeBSD.org
Wed Oct 23 14:34:05 UTC 2013
Author: nwhitehorn
Date: Wed Oct 23 14:34:04 2013
New Revision: 256974
URL: http://svnweb.freebsd.org/changeset/base/256974
Log:
A quick addendum: the standard says that timebase-frequency can be either
32 or 64 bits, so allow either.
Modified:
head/sys/powerpc/booke/platform_bare.c
Modified: head/sys/powerpc/booke/platform_bare.c
==============================================================================
--- head/sys/powerpc/booke/platform_bare.c Wed Oct 23 14:28:59 2013 (r256973)
+++ head/sys/powerpc/booke/platform_bare.c Wed Oct 23 14:34:04 2013 (r256974)
@@ -188,9 +188,24 @@ bare_timebase_freq(platform_t plat, stru
if ((child = OF_child(cpus)) == 0)
goto out;
- if (OF_getprop(child, "timebase-frequency", (void *)&ticks,
- sizeof(ticks)) == sizeof(ticks))
- goto out;
+ switch (OF_getproplen(child, "timebase-frequency")) {
+ case 4:
+ {
+ uint32_t tbase;
+ OF_getprop(child, "timebase-frequency", &tbase, sizeof(tbase));
+ ticks = tbase;
+ return (ticks);
+ }
+ case 8:
+ {
+ uint64_t tbase;
+ OF_getprop(child, "timebase-frequency", &tbase, sizeof(tbase));
+ ticks = tbase;
+ return (ticks);
+ }
+ default:
+ break;
+ }
freq = 0;
if (OF_getprop(child, "bus-frequency", (void *)&freq,
More information about the svn-src-head
mailing list