* Reconfigure specified per-CPU timer on other CPU. Called from IPI handler. */
| 441 | * Reconfigure specified per-CPU timer on other CPU. Called from IPI handler. |
| 442 | */ |
| 443 | static int |
| 444 | doconfigtimer(void) |
| 445 | { |
| 446 | sbintime_t now; |
| 447 | struct pcpu_state *state; |
| 448 | |
| 449 | state = DPCPU_PTR(timerstate); |
| 450 | switch (atomic_load_acq_int(&state->action)) { |
| 451 | case 1: |
| 452 | now = sbinuptime(); |
| 453 | ET_HW_LOCK(state); |
| 454 | loadtimer(now, 1); |
| 455 | ET_HW_UNLOCK(state); |
| 456 | state->handle = 0; |
| 457 | atomic_store_rel_int(&state->action, 0); |
| 458 | return (1); |
| 459 | case 2: |
| 460 | ET_HW_LOCK(state); |
| 461 | et_stop(timer); |
| 462 | ET_HW_UNLOCK(state); |
| 463 | state->handle = 0; |
| 464 | atomic_store_rel_int(&state->action, 0); |
| 465 | return (1); |
| 466 | } |
| 467 | if (atomic_readandclear_int(&state->handle) && !busy) { |
| 468 | now = sbinuptime(); |
| 469 | handleevents(now, 0); |
| 470 | return (1); |
| 471 | } |
| 472 | return (0); |
| 473 | } |
| 474 | |
| 475 | /* |
| 476 | * Reconfigure specified timer. |
no test coverage detected