Deleted Added
full compact
34c34
< * $FreeBSD: head/sys/kern/kern_malloc.c 97655 2002-05-31 09:41:09Z robert $
---
> * $FreeBSD: head/sys/kern/kern_malloc.c 103531 2002-09-18 08:26:30Z jeff $
50a51
> #include <vm/pmap.h>
54d54
< #include <vm/pmap.h>
55a56
> #include <vm/vm_page.h>
123,124c124
< * The malloc_mtx protects the kmemstatistics linked list as well as the
< * mallochash.
---
> * The malloc_mtx protects the kmemstatistics linked list.
208a209
> register struct malloc_type *ksp = type;
210d210
< void *mem;
212d211
< register struct malloc_type *ksp = type;
220,223c219
< mem = (void *)((u_long)addr & (~UMA_SLAB_MASK));
< mtx_lock(&malloc_mtx);
< slab = hash_sfind(mallochash, mem);
< mtx_unlock(&malloc_mtx);
---
> slab = vtoslab((vm_offset_t)addr & (~UMA_SLAB_MASK));
227c223
< addr, mem);
---
> addr, (void *)((u_long)addr & (~UMA_SLAB_MASK)));
228a225
>
278,281c275
< mtx_lock(&malloc_mtx);
< slab = hash_sfind(mallochash,
< (void *)((u_long)addr & ~(UMA_SLAB_MASK)));
< mtx_unlock(&malloc_mtx);
---
> slab = vtoslab((vm_offset_t)addr & ~(UMA_SLAB_MASK));
336,339d329
< void *hashmem;
< u_long hashsize;
< int highbit;
< int bits;
395c385
< hashsize = npg * sizeof(void *);
---
> uma_startup2();
397,410d386
< highbit = 0;
< bits = 0;
< /* The hash size must be a power of two */
< for (i = 0; i < 8 * sizeof(hashsize); i++)
< if (hashsize & (1 << i)) {
< highbit = i;
< bits++;
< }
< if (bits > 1)
< hashsize = 1 << (highbit);
<
< hashmem = (void *)kmem_alloc(kernel_map, (vm_size_t)hashsize);
< uma_startup2(hashmem, hashsize / sizeof(void *));
<