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
31250551Sjeff#ifndef __SYS_PCTRIE_H_
32250551Sjeff#define __SYS_PCTRIE_H_
33246423Sattilio
34246423Sattilio/*
35246478Sattilio * Radix tree root.
36246423Sattilio */
37250551Sjeffstruct pctrie {
38250551Sjeff	uintptr_t	pt_root;
39246423Sattilio};
40246423Sattilio
41248223Sattilio#ifdef _KERNEL
42248223Sattilio
43248134Salcstatic __inline boolean_t
44250551Sjeffpctrie_is_empty(struct pctrie *ptree)
45248134Salc{
46248134Salc
47250551Sjeff	return (ptree->pt_root == 0);
48248134Salc}
49248134Salc
50248223Sattilio#endif /* _KERNEL */
51250551Sjeff#endif /* !__SYS_PCTRIE_H_ */
52