Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F157514775
D14204.id39048.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D14204.id39048.diff
View Options
Index: sys/powerpc/pseries/platform_chrp.c
===================================================================
--- sys/powerpc/pseries/platform_chrp.c
+++ sys/powerpc/pseries/platform_chrp.c
@@ -285,12 +285,24 @@
static u_long
chrp_timebase_freq(platform_t plat, struct cpuref *cpuref)
{
- phandle_t phandle;
+ phandle_t cpus, cpunode;
int32_t ticks = -1;
+ int res;
+ char buf[8];
+
+ cpus = OF_finddevice("/cpus");
+ if (!cpus || cpus == -1)
+ panic("CPU tree not found on Open Firmware\n");
- phandle = cpuref->cr_hwref;
+ for (cpunode = OF_child(cpus); cpunode != 0; cpunode = OF_peer(cpunode)) {
+ res = OF_getprop(cpunode, "device_type", buf, sizeof(buf));
+ if (res > 0 && strcmp(buf, "cpu") == 0)
+ break;
+ }
+ if (!cpunode || cpunode == -1)
+ panic("CPU node not found on Open Firmware\n");
- OF_getencprop(phandle, "timebase-frequency", &ticks, sizeof(ticks));
+ OF_getencprop(cpunode, "timebase-frequency", &ticks, sizeof(ticks));
if (ticks <= 0)
panic("Unable to determine timebase frequency!");
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, May 23, 7:00 AM (18 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33442909
Default Alt Text
D14204.id39048.diff (1 KB)
Attached To
Mode
D14204: PC64: Get the timestap from the proper OF field
Attached
Detach File
Event Timeline
Log In to Comment