_vm_radix.h revision 248134
1219820Sjeff/* 2219820Sjeff * Copyright (c) 2013 EMC Corp. 3219820Sjeff * Copyright (c) 2011 Jeffrey Roberson <jeff@freebsd.org> 4219820Sjeff * Copyright (c) 2008 Mayur Shardul <mayur.shardul@gmail.com> 5219820Sjeff * All rights reserved. 6219820Sjeff * 7219820Sjeff * Redistribution and use in source and binary forms, with or without 8219820Sjeff * modification, are permitted provided that the following conditions 9219820Sjeff * are met: 10219820Sjeff * 1. Redistributions of source code must retain the above copyright 11219820Sjeff * notice, this list of conditions and the following disclaimer. 12219820Sjeff * 2. Redistributions in binary form must reproduce the above copyright 13219820Sjeff * notice, this list of conditions and the following disclaimer in the 14219820Sjeff * documentation and/or other materials provided with the distribution. 15219820Sjeff * 16219820Sjeff * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 17219820Sjeff * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18219820Sjeff * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19219820Sjeff * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 20219820Sjeff * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21219820Sjeff * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22219820Sjeff * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23219820Sjeff * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24219820Sjeff * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25219820Sjeff * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26219820Sjeff * SUCH DAMAGE. 27219820Sjeff * 28219820Sjeff */ 29219820Sjeff 30219820Sjeff#ifndef __VM_RADIX_H_ 31219820Sjeff#define __VM_RADIX_H_ 32219820Sjeff 33219820Sjeff/* 34219820Sjeff * Radix tree root. 35219820Sjeff */ 36219820Sjeffstruct vm_radix { 37219820Sjeff uintptr_t rt_root; 38219820Sjeff}; 39219820Sjeff 40219820Sjeffstatic __inline boolean_t 41219820Sjeffvm_radix_is_empty(struct vm_radix *rtree) 42219820Sjeff{ 43219820Sjeff 44219820Sjeff return (rtree->rt_root == 0); 45219820Sjeff} 46219820Sjeff 47219820Sjeff#endif /* !__VM_RADIX_H_ */ 48219820Sjeff