| 141 | } |
| 142 | |
| 143 | void |
| 144 | mips_timer_init_params(uint64_t platform_counter_freq, int double_count) |
| 145 | { |
| 146 | |
| 147 | /* |
| 148 | * XXX: Do not use printf here: uart code 8250 may use DELAY so this |
| 149 | * function should be called before cninit. |
| 150 | */ |
| 151 | counter_freq = platform_counter_freq; |
| 152 | /* |
| 153 | * XXX: Some MIPS32 cores update the Count register only every two |
| 154 | * pipeline cycles. |
| 155 | * We know this because of status registers in CP0, make it automatic. |
| 156 | */ |
| 157 | if (double_count != 0) |
| 158 | counter_freq /= 2; |
| 159 | |
| 160 | cycles_per_usec = counter_freq / (1 * 1000 * 1000); |
| 161 | set_cputicker(tick_ticker, counter_freq, 1); |
| 162 | } |
| 163 | |
| 164 | static int |
| 165 | sysctl_machdep_counter_freq(SYSCTL_HANDLER_ARGS) |
no test coverage detected