_vm_radix.h revision 254141
1230557Sjimharris/* 2230557Sjimharris * Copyright (c) 2013 EMC Corp. 3230557Sjimharris * Copyright (c) 2011 Jeffrey Roberson <jeff@freebsd.org> 4230557Sjimharris * Copyright (c) 2008 Mayur Shardul <mayur.shardul@gmail.com> 5230557Sjimharris * All rights reserved. 6230557Sjimharris * 7230557Sjimharris * Redistribution and use in source and binary forms, with or without 8230557Sjimharris * modification, are permitted provided that the following conditions 9230557Sjimharris * are met: 10230557Sjimharris * 1. Redistributions of source code must retain the above copyright 11230557Sjimharris * notice, this list of conditions and the following disclaimer. 12230557Sjimharris * 2. Redistributions in binary form must reproduce the above copyright 13230557Sjimharris * notice, this list of conditions and the following disclaimer in the 14230557Sjimharris * documentation and/or other materials provided with the distribution. 15230557Sjimharris * 16230557Sjimharris * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 17230557Sjimharris * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18230557Sjimharris * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19230557Sjimharris * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 20230557Sjimharris * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21230557Sjimharris * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22230557Sjimharris * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23230557Sjimharris * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24230557Sjimharris * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25230557Sjimharris * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26230557Sjimharris * SUCH DAMAGE. 27230557Sjimharris * 28230557Sjimharris * $FreeBSD: head/sys/vm/_vm_radix.h 254141 2013-08-09 11:28:55Z attilio $ 29230557Sjimharris */ 30230557Sjimharris 31230557Sjimharris#ifndef __VM_RADIX_H_ 32230557Sjimharris#define __VM_RADIX_H_ 33230557Sjimharris 34230557Sjimharris/* 35230557Sjimharris * Radix tree root. 36230557Sjimharris */ 37230557Sjimharrisstruct vm_radix { 38230557Sjimharris uintptr_t rt_root; 39230557Sjimharris uint8_t rt_flags; 40230557Sjimharris}; 41230557Sjimharris 42230557Sjimharris#define RT_INSERT_INPROG 0x01 43230557Sjimharris#define RT_TRIE_MODIFIED 0x02 44230557Sjimharris 45230557Sjimharris#ifdef _KERNEL 46230557Sjimharris 47230557Sjimharrisstatic __inline boolean_t 48230557Sjimharrisvm_radix_is_empty(struct vm_radix *rtree) 49230557Sjimharris{ 50230557Sjimharris 51230557Sjimharris return (rtree->rt_root == 0); 52230557Sjimharris} 53230557Sjimharris 54230557Sjimharris#endif /* _KERNEL */ 55230557Sjimharris#endif /* !__VM_RADIX_H_ */ 56230557Sjimharris