root/opal/mca/rcache/base/rcache_base_vma_tree.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
   4  *                         University Research and Technology
   5  *                         Corporation.  All rights reserved.
   6  * Copyright (c) 2004-2007 The University of Tennessee and The University
   7  *                         of Tennessee Research Foundation.  All rights
   8  *                         reserved.
   9  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
  10  *                         University of Stuttgart.  All rights reserved.
  11  * Copyright (c) 2004-2005 The Regents of the University of California.
  12  *                         All rights reserved.
  13  *
  14  * Copyright (c) 2006      Voltaire. All rights reserved.
  15  * Copyright (c) 2009      IBM Corporation.  All rights reserved.
  16  *
  17  * Copyright (c) 2013      Cisco Systems, Inc.  All rights reserved.
  18  * Copyright (c) 2015-2018 Los Alamos National Security, LLC. All rights
  19  *                         reserved.
  20  * $COPYRIGHT$
  21  *
  22  * Additional copyrights may follow
  23  *
  24  * $HEADER$
  25  */
  26 /**
  27   * @file
  28   * Registation cache VMA tree implementation
  29   */
  30 #ifndef MCA_RCACHE_BASE_VMA_TREE_H
  31 #define MCA_RCACHE_BASE_VMA_TREE_H
  32 
  33 #include "opal_config.h"
  34 
  35 #include "opal/mca/rcache/rcache.h"
  36 #include "rcache_base_vma.h"
  37 
  38 /*
  39  * initialize the vma tree
  40  */
  41 int mca_rcache_base_vma_tree_init (mca_rcache_base_vma_module_t *vma_module);
  42 
  43 /*
  44  * clean up the vma tree
  45  */
  46 void mca_rcache_base_vma_tree_finalize(mca_rcache_base_vma_module_t *vma_module);
  47 
  48 /**
  49  *  Returns the item in the vma tree
  50  */
  51 mca_rcache_base_registration_t *mca_rcache_base_vma_tree_find (mca_rcache_base_vma_module_t *vma_module,
  52                                                                unsigned char *base,
  53                                                                unsigned char *bound);
  54 /**
  55  * Returns all registration that overlaps given memory region
  56  */
  57 int mca_rcache_base_vma_tree_find_all (
  58         mca_rcache_base_vma_module_t *vma_module, unsigned char *base,
  59         unsigned char *bound, mca_rcache_base_registration_t **regs,
  60         int reg_cnt);
  61 
  62 /*
  63  * insert an item in the vma tree
  64  */
  65 int mca_rcache_base_vma_tree_insert (mca_rcache_base_vma_module_t *vma_module,
  66                                      mca_rcache_base_registration_t* reg, size_t limit);
  67 
  68 /*
  69  * remove an item from the vma tree
  70  */
  71 int mca_rcache_base_vma_tree_delete (mca_rcache_base_vma_module_t *vma_module,
  72                                      mca_rcache_base_registration_t *reg);
  73 
  74 /*
  75  * Dump out the contents of the rcache for debugging.
  76  */
  77 void mca_rcache_base_vma_tree_dump_range (mca_rcache_base_vma_module_t *vma_module,
  78                                           unsigned char *base, size_t size, char *msg);
  79 
  80 
  81 /*
  82  * Iterate over matching registration handles in the tree.
  83  */
  84 int mca_rcache_base_vma_tree_iterate (mca_rcache_base_vma_module_t *vma_module,
  85                                       unsigned char *base, size_t size, bool partial_ok,
  86                                       int (*callback_fn) (struct mca_rcache_base_registration_t *, void *),
  87                                       void *ctx);
  88 
  89 /**
  90  * @brief Get the current size of the vma tree
  91  *
  92  * @param[in] vma_module   rcache vma tree module
  93  *
  94  * @returns the current number of vma regions in the tree
  95  */
  96 size_t mca_rcache_base_vma_tree_size (mca_rcache_base_vma_module_t *vma_module);
  97 
  98 #endif /* MCA_RCACHE_BASE_VMA_TREE_H */

/* [<][>][^][v][top][bottom][index][help] */