Index: trunk/kernel/libk/grdxt.h
===================================================================
--- trunk/kernel/libk/grdxt.h	(revision 690)
+++ trunk/kernel/libk/grdxt.h	(revision 1)
@@ -1,6 +1,6 @@
 /*
- * grdxt.h - Three-levels Generic Radix-tree definition.
+ * grdxt.h - Three-levels Generic Radix-tree interface
  * 
- * Authors  Alain Greiner (2016,2017,2018,2019,2019,2020)
+ * Authors  Alain Greiner (2016)
  *
  * Copyright  UPMC Sorbonne Universites
@@ -25,5 +25,5 @@
 #define _GRDXT_H_
 
-#include <hal_kernel_types.h>
+#include <hal_types.h>
 
 /*******************************************************************************************
@@ -36,12 +36,6 @@
  * Memory for the second and third levels arrays is dynamically allocated by the
  * grdxt_insert() function and is only released by grdxt_destroy().
- * This structure is entirely contained in one single cluster, but to allow any thread
- * to access it, two sets of access functions are defined:
- * - local threads can use access function using local pointers.
- * - remote threads must use the access functions using extended pointers.
- ******************************************************************************************
- * When it is used by the mapper implementing the file cache:
- * - the key is the page index in file.
- * - the registered value is a local pointer on the page descriptor.
+ * - It used to by the VMM to retrieve a vseg descriptor: key is the virtual address.
+ * - It is used by the mapper to implement the file cache: key is the page index in file.
  ******************************************************************************************/
 
@@ -55,12 +49,8 @@
 grdxt_t;
 
-////////////////////////////////////////////////////////////////////////////////////////////
-//                       Local access functions
-////////////////////////////////////////////////////////////////////////////////////////////
 
 /*******************************************************************************************
  * This function initialises the radix-tree descriptor,
  * and allocates memory for the first level array of pointers.
- * It must be called by a local thread.
  *******************************************************************************************
  * @ rt        : pointer on the radix-tree descriptor.
@@ -77,6 +67,5 @@
 /*******************************************************************************************
  * This function releases all memory allocated to the radix-tree infrastructure.
- * A warning message is printed on the kernel TXT0 if the radix tree is not empty.
- * It must be called by a local thread.
+ * The radix-tree is supposed to be empty, but this is NOT checked by this function.
  *******************************************************************************************
  * @ rt      : pointer on the radix-tree descriptor.
@@ -87,10 +76,9 @@
  * This function insert a new item in the radix-tree.
  * It dynamically allocates memory for new second and third level arrays if required.
- * It must be called by a local thread.
  *******************************************************************************************
  * @ rt      : pointer on the radix-tree descriptor.
  * @ key     : key value.
  * @ value   : pointer on item to be registered in radix-tree.
- * @ returns 0 if success / returns -1 if no memory, or illegal key.
+ * @ returns 0 if success / returns ENOMEM if no memory, or EINVAL if illegal key.
  ******************************************************************************************/
 error_t grdxt_insert( grdxt_t  * rt,
@@ -99,7 +87,6 @@
 
 /*******************************************************************************************
- * This function removes an item identified by its key from the radix tree,
- * and returns a pointer on the removed item. No memory is released.
- * It must be called by a local thread.
+ * This function removes an item identified by its key, and returns a pointer
+ * on the removed item. No memory is released.
  *******************************************************************************************
  * @ rt      : pointer on the radix-tree descriptor.
@@ -111,11 +98,9 @@
 
 /*******************************************************************************************
- * This function returns to a local client, a local pointer on the item identified 
- * It must be called by a local thread.
- * by the <key> argument, from the radix tree identified by the <rt> local pointer.
+ * This function returns the pointer on the item identified by its key.
  *******************************************************************************************
- * @ rt      : local pointer on the radix-tree descriptor.
+ * @ rt      : pointer on the radix-tree descriptor.
  * @ key     : key value.
- * @ returns a local pointer on found item if success / returns NULL if failure.
+ * @ returns pointer on found item if success / returns NULL if failure.
  ******************************************************************************************/
 void * grdxt_lookup( grdxt_t  * rt, 
@@ -124,12 +109,11 @@
 /*******************************************************************************************
  * This function scan all radix-tree entries in increasing key order, starting from
- * the key defined by the <start_key> argument. It returns a pointer on the first valid
- * registered item, and returns in the <found_key> buffer the found item key value.
- * It must be called by a local thread.
+ * the value defined by the <key> argument, and return a pointer on the first valid
+ * registered item, and the found item key value.
  *******************************************************************************************
  * @ rt         : pointer on the radix-tree descriptor.
  * @ start_key  : key starting value for the scan.
  * @ found_key  : [out] buffer for found key value.
- * @ return pointer on first valid item if found / return NULL if no item found.
+ * return pointer on first valid item if found / return NULL if not found.
  ******************************************************************************************/
 void * grdxt_get_first( grdxt_t  * rt,
@@ -137,97 +121,13 @@
                         uint32_t * found_key );
 
-////////////////////////////////////////////////////////////////////////////////////////////
-//                       Remote access functions
-////////////////////////////////////////////////////////////////////////////////////////////
+/*******************************************************************************************
+ * This function displays the content of the radix_tree.
+ *******************************************************************************************
+ * @ rt      : pointer on the radix-tree descriptor.
+ * @ name    : string identifying the radix-tree.
+ ******************************************************************************************/
+void grdxt_print( grdxt_t * rt,
+                  char    * name );
 
-/*******************************************************************************************
- * This function initialises the radix-tree descriptor,
- * and allocates memory for the first level array of pointers.
- * It can be called by any thread running in any cluster
- *******************************************************************************************
- * @ rt_xp     : extended pointer on the radix-tree descriptor.
- * @ ix1_width : number of bits in ix1 field
- * @ ix2_width : number of bits in ix2 field
- * @ ix3_width : number of bits in ix3 field
- * @ returns 0 if success / returns ENOMEM if no more memory.      
- ******************************************************************************************/
-error_t grdxt_remote_init( xptr_t     rt_xp,
-                           uint32_t   ix1_width,
-                           uint32_t   ix2_width,
-                           uint32_t   ix3_width );
-
-/*******************************************************************************************
- * This function releases all memory allocated to the radix-tree infrastructure.
- * A warning message is printed on the kernel TXT0 if the radix tree is not empty.
- * It can be called by any thread running in any cluster
- *******************************************************************************************
- * @ rt_xp    : extended pointer on the radix-tree descriptor.
- ******************************************************************************************/
-void grdxt_remote_destroy( xptr_t  rt_xp );
-
-/*******************************************************************************************
- * This function insert a new item in a - possibly remote - radix tree.
- * It dynamically allocates memory for new second and third level arrays if required.
- * It can be called by any thread running in any cluster
- *******************************************************************************************
- * @ rt_xp   : extended pointer on the radix-tree descriptor.
- * @ key     : key value.
- * @ value   : pointer on item to be registered in radix-tree.
- * @ returns 0 if success / returns -1 if no memory, or illegal key.
- ******************************************************************************************/
-error_t grdxt_remote_insert( xptr_t     rt_xp,
-                             uint32_t   key,
-                             void     * value );
-
-/*******************************************************************************************
- * This function removes an item identified by its key from a - possibly remote - radix
- * tree, and returns a local pointer on the removed item. No memory is released.
- * It can be called by a thread running in any cluster
- *******************************************************************************************
- * @ rt_xp   : pointer on the radix-tree descriptor.
- * @ key     : key value.
- * @ returns extended pointer on removed item if success / returns XPTR_NULL if failure.
- ******************************************************************************************/
-xptr_t grdxt_remote_remove( xptr_t    rt_xp,
-                            uint32_t  key );
-
-/*******************************************************************************************
- * This function returns to a - possibly remote - client, an extended pointer
- * on the item identified by the <key> argument, from the radix tree identified by
- * the <rt_xp> remote pointer.
- * It can be called by a thread running in any cluster
- *******************************************************************************************
- * @ rt_xp   : extended pointer on the radix-tree descriptor.
- * @ key     : key value.
- * @ returns extended pointer on found item if success / returns XPTR_NULL if not found.
- ******************************************************************************************/
-xptr_t grdxt_remote_lookup( xptr_t     rt_xp, 
-                            uint32_t   key );
-
-/*******************************************************************************************
- * This function scan all radix-tree entries of a - possibly remote - radix tree <rt_xp>,
- * in increasing key order, starting from the key defined by the <start_key> argument.
- * It returns an extended pointer on the first valid registered item, and returns in the
- * <found_key> buffer the found item key value.
- * It can be called by a thread running in any cluster
- *******************************************************************************************
- * @ rt_xp      : extended pointer on the radix-tree descriptor.
- * @ start_key  : key starting value for the scan.
- * @ found_key  : [out] buffer for found key value.
- * @ return xptr on first valid item if found / return XPTR_NULL if no item found.
- ******************************************************************************************/
-xptr_t grdxt_remote_get_first( xptr_t     rt_xp,
-                               uint32_t   start_key,
-                               uint32_t * found_key );
-
-/*******************************************************************************************
- * This function displays the current content of a possibly remote radix_tree.
- * It can be called by a thread running in any cluster
- *******************************************************************************************
- * @ rt      : extended pointer on the radix-tree descriptor.
- * @ string  : radix tree identifier. 
- ******************************************************************************************/
-void grdxt_remote_display( xptr_t    rt_xp,
-                           char    * string );
 
 #endif	/* _GRDXT_H_ */
