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