memguard.h revision 211194
14Srgrimes/*- 24Srgrimes * Copyright (c) 2005, 34Srgrimes * Bosko Milekic <bmilekic@FreeBSD.org>. All rights reserved. 44Srgrimes * 54Srgrimes * Redistribution and use in source and binary forms, with or without 64Srgrimes * modification, are permitted provided that the following conditions 74Srgrimes * are met: 84Srgrimes * 1. Redistributions of source code must retain the above copyright 94Srgrimes * notice unmodified, this list of conditions, and the following 104Srgrimes * disclaimer. 114Srgrimes * 2. Redistributions in binary form must reproduce the above copyright 124Srgrimes * notice, this list of conditions and the following disclaimer in the 134Srgrimes * documentation and/or other materials provided with the distribution. 144Srgrimes * 154Srgrimes * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 164Srgrimes * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 174Srgrimes * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 184Srgrimes * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 194Srgrimes * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 204Srgrimes * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 214Srgrimes * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 224Srgrimes * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 234Srgrimes * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 244Srgrimes * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 254Srgrimes * 26623Srgrimes * $FreeBSD: head/sys/vm/memguard.h 211194 2010-08-11 22:10:37Z mdf $ 274Srgrimes */ 28623Srgrimes 294Srgrimes#include "opt_vm.h" 304Srgrimes 314Srgrimes#ifdef DEBUG_MEMGUARD 324Srgrimesunsigned long memguard_fudge(unsigned long, unsigned long); 334Srgrimesvoid memguard_init(struct vm_map *); 344Srgrimesvoid *memguard_alloc(unsigned long, int); 354Srgrimesvoid memguard_free(void *); 364Srgrimesint memguard_cmp(struct malloc_type *, unsigned long); 374Srgrimesint is_memguard_addr(void *); 384Srgrimes#else 394Srgrimes#define memguard_fudge(size, xxx) (size) 404Srgrimes#define memguard_init(map) do { } while (0) 414Srgrimes#define memguard_alloc(size, flags) NULL 424Srgrimes#define memguard_free(addr) do { } while (0) 434Srgrimes#define memguard_cmp(mtp, size) 0 444Srgrimes#define is_memguard_addr(addr) 0 454Srgrimes#endif 464Srgrimes