Deleted Added
sdiff udiff text old ( 99424 ) new ( 103531 )
full compact
1/*
2 * Copyright (c) 2002, Jeffrey Roberson <jroberson@chesapeake.net>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * $FreeBSD: head/sys/vm/uma_dbg.c 103531 2002-09-18 08:26:30Z jeff $
27 *
28 */
29
30/*
31 * uma_dbg.c Debugging features for UMA users
32 *
33 */
34
35
36#include <sys/param.h>
37#include <sys/systm.h>
38#include <sys/kernel.h>
39#include <sys/types.h>
40#include <sys/queue.h>
41#include <sys/lock.h>
42#include <sys/mutex.h>
43#include <sys/malloc.h>
44
45#include <vm/vm.h>
46#include <vm/vm_object.h>
47#include <vm/vm_page.h>
48#include <vm/uma.h>
49#include <vm/uma_int.h>
50#include <vm/uma_dbg.h>
51
52static const u_int32_t uma_junk = 0xdeadc0de;
53
54/*
55 * Checks an item to make sure it hasn't been overwritten since freed.

--- 136 unchanged lines hidden (view full) ---

192static uma_slab_t
193uma_dbg_getslab(uma_zone_t zone, void *item)
194{
195 uma_slab_t slab;
196 u_int8_t *mem;
197
198 mem = (u_int8_t *)((unsigned long)item & (~UMA_SLAB_MASK));
199 if (zone->uz_flags & UMA_ZFLAG_MALLOC) {
200 slab = vtoslab((vm_offset_t)mem);
201 } else if (zone->uz_flags & UMA_ZFLAG_HASH) {
202 ZONE_LOCK(zone);
203 slab = hash_sfind(&zone->uz_hash, mem);
204 ZONE_UNLOCK(zone);
205 } else {
206 mem += zone->uz_pgoff;
207 slab = (uma_slab_t)mem;
208 }
209

--- 74 unchanged lines hidden ---