#ifndef _LINUX_KHO_RADIX_TREE_H
#define _LINUX_KHO_RADIX_TREE_H
#include <linux/err.h>
#include <linux/errno.h>
#include <linux/mutex_types.h>
#include <linux/types.h>
struct kho_radix_node;
struct kho_radix_tree {
struct kho_radix_node *root;
struct mutex lock;
};
typedef int (*kho_radix_tree_walk_callback_t)(phys_addr_t phys,
unsigned int order);
#ifdef CONFIG_KEXEC_HANDOVER
int kho_radix_add_page(struct kho_radix_tree *tree, unsigned long pfn,
unsigned int order);
void kho_radix_del_page(struct kho_radix_tree *tree, unsigned long pfn,
unsigned int order);
int kho_radix_walk_tree(struct kho_radix_tree *tree,
kho_radix_tree_walk_callback_t cb);
#else
static inline int kho_radix_add_page(struct kho_radix_tree *tree, long pfn,
unsigned int order)
{
return -EOPNOTSUPP;
}
static inline void kho_radix_del_page(struct kho_radix_tree *tree,
unsigned long pfn, unsigned int order) { }
static inline int kho_radix_walk_tree(struct kho_radix_tree *tree,
kho_radix_tree_walk_callback_t cb)
{
return -EOPNOTSUPP;
}
#endif
#endif