| 180 | } |
| 181 | |
| 182 | static int |
| 183 | start_ap(int cpuid) |
| 184 | { |
| 185 | int cpus, ms; |
| 186 | |
| 187 | cpus = mp_naps; |
| 188 | dpcpu = (void *)kmem_malloc(DPCPU_SIZE, M_WAITOK | M_ZERO); |
| 189 | |
| 190 | mips_sync(); |
| 191 | |
| 192 | if (platform_start_ap(cpuid) != 0) |
| 193 | return (-1); /* could not start AP */ |
| 194 | |
| 195 | for (ms = 0; ms < 5000; ++ms) { |
| 196 | if (mp_naps > cpus) |
| 197 | return (0); /* success */ |
| 198 | else |
| 199 | DELAY(1000); |
| 200 | } |
| 201 | |
| 202 | return (-2); /* timeout initializing AP */ |
| 203 | } |
| 204 | |
| 205 | void |
| 206 | cpu_mp_setmaxid(void) |
no test coverage detected