* Thread-related support functions. */
| 582 | * Thread-related support functions. |
| 583 | */ |
| 584 | struct pcb * |
| 585 | kdb_thr_ctx(struct thread *thr) |
| 586 | { |
| 587 | #if defined(SMP) && defined(KDB_STOPPEDPCB) |
| 588 | struct pcpu *pc; |
| 589 | #endif |
| 590 | |
| 591 | if (thr == curthread) |
| 592 | return (&kdb_pcb); |
| 593 | |
| 594 | #if defined(SMP) && defined(KDB_STOPPEDPCB) |
| 595 | STAILQ_FOREACH(pc, &cpuhead, pc_allcpu) { |
| 596 | if (pc->pc_curthread == thr && |
| 597 | CPU_ISSET(pc->pc_cpuid, &stopped_cpus)) |
| 598 | return (KDB_STOPPEDPCB(pc)); |
| 599 | } |
| 600 | #endif |
| 601 | return (thr->td_pcb); |
| 602 | } |
| 603 | |
| 604 | struct thread * |
| 605 | kdb_thr_first(void) |
no outgoing calls
no test coverage detected