Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_intr.c
Show First 20 Lines • Show All 862 Lines • ▼ Show 20 Lines | intr_event_schedule_thread(struct intr_event *ie) | ||||
/* | /* | ||||
* If any of the handlers for this ithread claim to be good | * If any of the handlers for this ithread claim to be good | ||||
* sources of entropy, then gather some. | * sources of entropy, then gather some. | ||||
*/ | */ | ||||
if (ie->ie_flags & IE_ENTROPY) { | if (ie->ie_flags & IE_ENTROPY) { | ||||
entropy.event = (uintptr_t)ie; | entropy.event = (uintptr_t)ie; | ||||
entropy.td = ctd; | entropy.td = ctd; | ||||
random_harvest_queue(&entropy, sizeof(entropy), 2, RANDOM_INTERRUPT); | random_harvest_queue(&entropy, sizeof(entropy), RANDOM_INTERRUPT); | ||||
} | } | ||||
KASSERT(td->td_proc != NULL, ("ithread %s has no process", ie->ie_name)); | KASSERT(td->td_proc != NULL, ("ithread %s has no process", ie->ie_name)); | ||||
/* | /* | ||||
* Set it_need to tell the thread to keep running if it is already | * Set it_need to tell the thread to keep running if it is already | ||||
* running. Then, lock the thread and see if we actually need to | * running. Then, lock the thread and see if we actually need to | ||||
* put it on the runqueue. | * put it on the runqueue. | ||||
▲ Show 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | swi_sched(void *cookie, int flags) | ||||
struct intr_entropy entropy; | struct intr_entropy entropy; | ||||
int error __unused; | int error __unused; | ||||
CTR3(KTR_INTR, "swi_sched: %s %s need=%d", ie->ie_name, ih->ih_name, | CTR3(KTR_INTR, "swi_sched: %s %s need=%d", ie->ie_name, ih->ih_name, | ||||
ih->ih_need); | ih->ih_need); | ||||
entropy.event = (uintptr_t)ih; | entropy.event = (uintptr_t)ih; | ||||
entropy.td = curthread; | entropy.td = curthread; | ||||
random_harvest_queue(&entropy, sizeof(entropy), 1, RANDOM_SWI); | random_harvest_queue(&entropy, sizeof(entropy), RANDOM_SWI); | ||||
/* | /* | ||||
* Set ih_need for this handler so that if the ithread is already | * Set ih_need for this handler so that if the ithread is already | ||||
* running it will execute this handler on the next pass. Otherwise, | * running it will execute this handler on the next pass. Otherwise, | ||||
* it will execute it the next time it runs. | * it will execute it the next time it runs. | ||||
*/ | */ | ||||
ih->ih_need = 1; | ih->ih_need = 1; | ||||
▲ Show 20 Lines • Show All 544 Lines • Show Last 20 Lines |