| 533 | } |
| 534 | |
| 535 | void |
| 536 | cnputsn(const char *p, size_t n) |
| 537 | { |
| 538 | size_t i; |
| 539 | int unlock_reqd = 0; |
| 540 | |
| 541 | if (use_cnputs_mtx) { |
| 542 | /* |
| 543 | * NOTE: Debug prints and/or witness printouts in |
| 544 | * console driver clients can cause the "cnputs_mtx" |
| 545 | * mutex to recurse. Simply return if that happens. |
| 546 | */ |
| 547 | if (mtx_owned(&cnputs_mtx)) |
| 548 | return; |
| 549 | mtx_lock_spin(&cnputs_mtx); |
| 550 | unlock_reqd = 1; |
| 551 | } |
| 552 | |
| 553 | for (i = 0; i < n; i++) |
| 554 | cnputc(p[i]); |
| 555 | |
| 556 | if (unlock_reqd) |
| 557 | mtx_unlock_spin(&cnputs_mtx); |
| 558 | } |
| 559 | |
| 560 | void |
| 561 | cnputs(const char *p) |
no test coverage detected