Lines Matching refs:entsrc
101 static physmem_entsrc_t entsrc; /* Physical mem as an entropy source */
229 if (physmem_ent_init(&entsrc) != 0) {
254 physmem_ent_fini(&entsrc);
340 physmem_ent_gen(&entsrc);
590 physmem_ent_init(physmem_entsrc_t *entsrc)
595 bzero(entsrc, sizeof (*entsrc));
603 entsrc->entperblock++;
605 /* Initialize entsrc->nblocks */
608 if (entsrc->nblocks == 0) {
614 entsrc->parity = kmem_alloc(howmany(entsrc->nblocks, 8),
616 entsrc->pmbuf = vmem_alloc(heap_arena, PAGESIZE, VM_SLEEP);
620 i = howmany(entsrc->nblocks, 8);
621 ptr = entsrc->parity;
638 physmem_ent_gen(entsrc);
646 physmem_ent_fini(physmem_entsrc_t *entsrc)
648 if (entsrc->pmbuf != NULL)
649 vmem_free(heap_arena, entsrc->pmbuf, PAGESIZE);
650 if (entsrc->parity != NULL)
651 kmem_free(entsrc->parity, howmany(entsrc->nblocks, 8));
652 bzero(entsrc, sizeof (*entsrc));
656 physmem_ent_gen(physmem_entsrc_t *entsrc)
689 ASSERT(entsrc->nblocks > 0);
692 block = oblock = srndpool[i] % entsrc->nblocks;
741 hat_devload(kas.a_hat, entsrc->pmbuf,
745 HashUpdate(&ctx, (uint8_t *)entsrc->pmbuf + poffset,
748 hat_unload(kas.a_hat, entsrc->pmbuf, PAGESIZE,
776 delta = diff - entsrc->last_diff;
779 delta2 = delta - entsrc->last_delta;
782 delta3 = delta2 - entsrc->last_delta2;
785 entsrc->last_diff = diff;
786 entsrc->last_delta = delta;
787 entsrc->last_delta2 = delta2;
804 if (physmem_parity_update(entsrc->parity, oblock,
806 ent += 2 * entsrc->entperblock;
834 entsrc.nblocks = 0;
836 entsrc.nblocks += pmem->ml_size / MEMBLOCKSIZE;
837 if (entsrc.nblocks > MAXMEMBLOCKS) {
838 entsrc.nblocks = MAXMEMBLOCKS;
853 /* More memory is available now, so update entsrc->nblocks. */
870 /* Memory has shrunk, so update entsrc->nblocks. */
902 physmem_ent_gen(&entsrc);