Changeset View
Changeset View
Standalone View
Standalone View
head/sys/powerpc/pseries/platform_chrp.c
Show First 20 Lines • Show All 279 Lines • ▼ Show 20 Lines | |||||
chrp_real_maxaddr(platform_t plat) | chrp_real_maxaddr(platform_t plat) | ||||
{ | { | ||||
return (realmaxaddr); | return (realmaxaddr); | ||||
} | } | ||||
static u_long | static u_long | ||||
chrp_timebase_freq(platform_t plat, struct cpuref *cpuref) | chrp_timebase_freq(platform_t plat, struct cpuref *cpuref) | ||||
{ | { | ||||
phandle_t phandle; | phandle_t cpus, cpunode; | ||||
int32_t ticks = -1; | int32_t ticks = -1; | ||||
int res; | |||||
char buf[8]; | |||||
phandle = cpuref->cr_hwref; | cpus = OF_finddevice("/cpus"); | ||||
if (cpus <= 0) | |||||
panic("CPU tree not found on Open Firmware\n"); | |||||
OF_getencprop(phandle, "timebase-frequency", &ticks, sizeof(ticks)); | 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 <= 0) | |||||
panic("CPU node not found on Open Firmware\n"); | |||||
OF_getencprop(cpunode, "timebase-frequency", &ticks, sizeof(ticks)); | |||||
if (ticks <= 0) | if (ticks <= 0) | ||||
panic("Unable to determine timebase frequency!"); | panic("Unable to determine timebase frequency!"); | ||||
return (ticks); | return (ticks); | ||||
} | } | ||||
static int | static int | ||||
▲ Show 20 Lines • Show All 200 Lines • Show Last 20 Lines |