_vm_radix.h revision 248223
1191783Srmacklem/*
2191783Srmacklem * Copyright (c) 2013 EMC Corp.
3191783Srmacklem * Copyright (c) 2011 Jeffrey Roberson <jeff@freebsd.org>
4191783Srmacklem * Copyright (c) 2008 Mayur Shardul <mayur.shardul@gmail.com>
5191783Srmacklem * All rights reserved.
6191783Srmacklem *
7191783Srmacklem * Redistribution and use in source and binary forms, with or without
8191783Srmacklem * modification, are permitted provided that the following conditions
9191783Srmacklem * are met:
10191783Srmacklem * 1. Redistributions of source code must retain the above copyright
11191783Srmacklem *    notice, this list of conditions and the following disclaimer.
12191783Srmacklem * 2. Redistributions in binary form must reproduce the above copyright
13191783Srmacklem *    notice, this list of conditions and the following disclaimer in the
14191783Srmacklem *    documentation and/or other materials provided with the distribution.
15191783Srmacklem *
16191783Srmacklem * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17191783Srmacklem * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18191783Srmacklem * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19191783Srmacklem * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20191783Srmacklem * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21191783Srmacklem * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22191783Srmacklem * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23191783Srmacklem * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24191783Srmacklem * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25191783Srmacklem * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26191783Srmacklem * SUCH DAMAGE.
27191783Srmacklem *
28191783Srmacklem */
29191783Srmacklem
30191783Srmacklem#ifndef __VM_RADIX_H_
31191783Srmacklem#define __VM_RADIX_H_
32191783Srmacklem
33191783Srmacklem/*
34191783Srmacklem * Radix tree root.
35191783Srmacklem */
36203849Srmacklemstruct vm_radix {
37191783Srmacklem	uintptr_t	rt_root;
38191783Srmacklem};
39191783Srmacklem
40191783Srmacklem#ifdef _KERNEL
41191783Srmacklem
42191783Srmacklemstatic __inline boolean_t
43191783Srmacklemvm_radix_is_empty(struct vm_radix *rtree)
44191783Srmacklem{
45191783Srmacklem
46191783Srmacklem	return (rtree->rt_root == 0);
47191783Srmacklem}
48210030Srmacklem
49191783Srmacklem#endif /* _KERNEL */
50191783Srmacklem#endif /* !__VM_RADIX_H_ */
51191783Srmacklem