X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/de355530ae67247cbd0da700edb3a2a1dae884c2..ac5ea4a98a4e1d34a076095ea1eaa87e43d1f335:/pexpert/ppc/pe_identify_machine.c diff --git a/pexpert/ppc/pe_identify_machine.c b/pexpert/ppc/pe_identify_machine.c index 092d1926f..3ff1df2f4 100644 --- a/pexpert/ppc/pe_identify_machine.c +++ b/pexpert/ppc/pe_identify_machine.c @@ -46,7 +46,8 @@ void pe_identify_machine(void) gPEClockFrequencyInfo.bus_clock_rate_hz = 100000000; gPEClockFrequencyInfo.cpu_clock_rate_hz = 300000000; gPEClockFrequencyInfo.dec_clock_rate_hz = 25000000; - + gPEClockFrequencyInfo.timebase_frequency_hz = 25000000; + // Try to get the values from the device tree. if (DTFindEntry("device_type", "cpu", &cpu) == kSuccess) { if (DTGetProperty(cpu, "bus-frequency", @@ -64,11 +65,16 @@ void pe_identify_machine(void) gPEClockFrequencyInfo.cpu_clock_rate_hz = *value; if (DTGetProperty(cpu, "timebase-frequency", - (void **)&value, &size) == kSuccess) + (void **)&value, &size) == kSuccess) { gPEClockFrequencyInfo.dec_clock_rate_hz = *value; + gPEClockFrequencyInfo.timebase_frequency_hz= *value; + } } // Set the num / den pairs form the hz values. + gPEClockFrequencyInfo.timebase_frequency_num = gPEClockFrequencyInfo.timebase_frequency_hz; + gPEClockFrequencyInfo.timebase_frequency_den = 1; + gPEClockFrequencyInfo.bus_clock_rate_num = gPEClockFrequencyInfo.bus_clock_rate_hz; gPEClockFrequencyInfo.bus_clock_rate_den = 1;