| 539 | } |
| 540 | |
| 541 | static struct callout_cpu * |
| 542 | callout_lock(struct callout *c) |
| 543 | { |
| 544 | struct callout_cpu *cc; |
| 545 | int cpu; |
| 546 | |
| 547 | for (;;) { |
| 548 | cpu = c->c_cpu; |
| 549 | #ifdef SMP |
| 550 | if (cpu == CPUBLOCK) { |
| 551 | while (c->c_cpu == CPUBLOCK) |
| 552 | cpu_spinwait(); |
| 553 | continue; |
| 554 | } |
| 555 | #endif |
| 556 | cc = CC_CPU(cpu); |
| 557 | CC_LOCK(cc); |
| 558 | if (cpu == c->c_cpu) |
| 559 | break; |
| 560 | CC_UNLOCK(cc); |
| 561 | } |
| 562 | return (cc); |
| 563 | } |
| 564 | |
| 565 | static void |
| 566 | callout_cc_add(struct callout *c, struct callout_cpu *cc, |
no outgoing calls
no test coverage detected