11553Srgrimes/*
21553Srgrimes * Copyright (c) 2013 EMC Corp.
31553Srgrimes * Copyright (c) 2011 Jeffrey Roberson <jeff@freebsd.org>
41553Srgrimes * Copyright (c) 2008 Mayur Shardul <mayur.shardul@gmail.com>
51553Srgrimes * All rights reserved.
61553Srgrimes *
71553Srgrimes * Redistribution and use in source and binary forms, with or without
81553Srgrimes * modification, are permitted provided that the following conditions
91553Srgrimes * are met:
101553Srgrimes * 1. Redistributions of source code must retain the above copyright
111553Srgrimes *    notice, this list of conditions and the following disclaimer.
121553Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
131553Srgrimes *    notice, this list of conditions and the following disclaimer in the
141553Srgrimes *    documentation and/or other materials provided with the distribution.
151553Srgrimes *
161553Srgrimes * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
171553Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
181553Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
191553Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
201553Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
211553Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
221553Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
231553Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
241553Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
251553Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
261553Srgrimes * SUCH DAMAGE.
271553Srgrimes *
281553Srgrimes * $FreeBSD$
2950479Speter */
301553Srgrimes
311553Srgrimes#ifndef __SYS_PCTRIE_H_
321553Srgrimes#define __SYS_PCTRIE_H_
3379537Sru
341553Srgrimes/*
351553Srgrimes * Radix tree root.
361553Srgrimes */
371553Srgrimesstruct pctrie {
3868965Sru	uintptr_t	pt_root;
3913107Sbde};
40129833Smaxim
41129833Smaxim#ifdef _KERNEL
421553Srgrimes
4399968Scharnierstatic __inline boolean_t
4499968Scharnierpctrie_is_empty(struct pctrie *ptree)
4599968Scharnier{
461553Srgrimes
4729736Scharnier	return (ptree->pt_root == 0);
481553Srgrimes}
491553Srgrimes
501553Srgrimes#endif /* _KERNEL */
511553Srgrimes#endif /* !__SYS_PCTRIE_H_ */
521553Srgrimes