Lines Matching defs:cpu
203 unsigned int cpu, i;
217 for (cpu = 0; cpu < kd_cpus; cpu++) {
218 if (kmem_alloc(kernel_map, (unsigned int *)&kdbip[cpu].kd_buffer, kd_bufsize) != KERN_SUCCESS)
221 if (cpu < kd_cpus) {
222 for (i = 0; i < cpu; i++)
231 for (cpu = 0; cpu < kd_cpus; cpu++) {
232 kdbip[cpu].kd_bufptr = kdbip[cpu].kd_buffer;
233 kdbip[cpu].kd_buflast = &kdbip[cpu].kd_bufptr[nentries];
234 kdbip[cpu].kd_readlast = kdbip[cpu].kd_bufptr;
245 unsigned int cpu;
248 for (cpu = 0; cpu < kd_cpus; cpu++)
249 kmem_free(kernel_map, (vm_offset_t)kdbip[cpu].kd_buffer, kd_bufsize);
268 int cpu;
273 cpu = cpu_number();
339 kd = kdbip[cpu].kd_bufptr;
350 if (now < kdbip[cpu].kd_prev_timebase)
355 now = ++kdbip[cpu].kd_prev_timebase & KDBG_TIMESTAMP_MASK;
359 kdbip[cpu].kd_prev_timebase = now;
361 kd->timestamp = now | (((uint64_t)cpu) << KDBG_CPU_SHIFT);
363 kdbip[cpu].kd_bufptr++;
365 if (kdbip[cpu].kd_bufptr >= kdbip[cpu].kd_buflast)
366 kdbip[cpu].kd_bufptr = kdbip[cpu].kd_buffer;
368 if (kdbip[cpu].kd_bufptr == kdbip[cpu].kd_readlast) {
371 kdbip[cpu].kd_wrapped = 1;
1275 unsigned int cpu;
1310 for (cpu = 0; cpu < kd_cpus; cpu++) {
1313 if ((cur_bufptr = kdbip[cpu].kd_bufptr) >= kdbip[cpu].kd_buflast)
1314 cur_bufptr = kdbip[cpu].kd_buffer;
1316 if (kdbip[cpu].kd_wrapped) {
1317 kdbip[cpu].kd_wrapped = 0;
1318 kdbip[cpu].kd_readlast = cur_bufptr;
1319 kdbip[cpu].kd_stop = cur_bufptr;
1323 last_wrap_cpu = cpu;
1326 if (kdbip[cpu].kd_readlast == cur_bufptr)
1327 kdbip[cpu].kd_stop = 0;
1329 kdbip[cpu].kd_stop = cur_bufptr;
1349 for (cpu = 0; cpu < kd_cpus; cpu++) {
1350 if (kdbip[cpu].kd_stop == 0) /* empty buffer */
1352 t = kdbip[cpu].kd_readlast[0].timestamp & KDBG_TIMESTAMP_MASK;
1356 mincpu = cpu;