Module Name: src Committed By: martin Date: Sat Oct 26 15:28:56 UTC 2024
Modified Files: src/sys/arch/evbppc/wii [netbsd-10]: machdep.c src/sys/arch/powerpc/powerpc [netbsd-10]: clock.c Log Message: Pull up following revision(s) (requested by jmcneill in ticket #986): sys/arch/evbppc/wii/machdep.c: revision 1.8 sys/arch/powerpc/powerpc/clock.c: revision 1.19 Improve delay() accuracy on Nintendo Wii. The PowerPC delay() implementation converts the timebase frequency to a number of nanoseconds per tick and uses that value to compute the delay interval. On the Wii's Broadway processor with a timebase frequency of 60.75 MHz, some precision is lost as each tick is approximately 16.46 nanoseconds. The end result is that we sleep for approximately 2.875% longer than necessary. This also has an impact on CPU speed calculation on Broadway, which incorrectly reports itself as 750MHz instead of 729MHz (2.875% faster). Fix this by introducing an (optional) ticks_per_msec variable that can be set by the platform and allows delay() to improve the accuracy of longer delays. Measured CPU frequency before this change: [ 1.000000] cpu0: 750.00 MHz, 256KB WB with ECC L2 cache Measured CPU frequency after this change: [ 1.000000] cpu0: 729.00 MHz, 256KB WB with ECC L2 cache To generate a diff of this commit: cvs rdiff -u -r1.4.2.3 -r1.4.2.4 src/sys/arch/evbppc/wii/machdep.c cvs rdiff -u -r1.17.20.1 -r1.17.20.2 src/sys/arch/powerpc/powerpc/clock.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.