1246423Sattilio/*
2248134Salc * Copyright (c) 2013 EMC Corp.
3246423Sattilio * Copyright (c) 2011 Jeffrey Roberson <jeff@freebsd.org>
4246423Sattilio * Copyright (c) 2008 Mayur Shardul <mayur.shardul@gmail.com>
5246423Sattilio * All rights reserved.
6246423Sattilio *
7246423Sattilio * Redistribution and use in source and binary forms, with or without
8246423Sattilio * modification, are permitted provided that the following conditions
9246423Sattilio * are met:
10246423Sattilio * 1. Redistributions of source code must retain the above copyright
11246423Sattilio *    notice, this list of conditions and the following disclaimer.
12246423Sattilio * 2. Redistributions in binary form must reproduce the above copyright
13246423Sattilio *    notice, this list of conditions and the following disclaimer in the
14246423Sattilio *    documentation and/or other materials provided with the distribution.
15246423Sattilio *
16246423Sattilio * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17246423Sattilio * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18246423Sattilio * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19246423Sattilio * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20246423Sattilio * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21246423Sattilio * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22246423Sattilio * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23246423Sattilio * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24246423Sattilio * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25246423Sattilio * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26246423Sattilio * SUCH DAMAGE.
27246423Sattilio *
28248448Sattilio * $FreeBSD$
29246423Sattilio */
30246423Sattilio
31246423Sattilio#ifndef __VM_RADIX_H_
32246423Sattilio#define __VM_RADIX_H_
33246423Sattilio
34246423Sattilio/*
35246478Sattilio * Radix tree root.
36246423Sattilio */
37246423Sattiliostruct vm_radix {
38246478Sattilio	uintptr_t	rt_root;
39254141Sattilio	uint8_t		rt_flags;
40246423Sattilio};
41246423Sattilio
42254141Sattilio#define	RT_INSERT_INPROG	0x01
43254141Sattilio#define	RT_TRIE_MODIFIED	0x02
44254141Sattilio
45248223Sattilio#ifdef _KERNEL
46248223Sattilio
47248134Salcstatic __inline boolean_t
48248134Salcvm_radix_is_empty(struct vm_radix *rtree)
49248134Salc{
50248134Salc
51248134Salc	return (rtree->rt_root == 0);
52248134Salc}
53248134Salc
54248223Sattilio#endif /* _KERNEL */
55246423Sattilio#endif /* !__VM_RADIX_H_ */
56