Index: trunk/kernel/mm/mapper.h
===================================================================
--- trunk/kernel/mm/mapper.h	(revision 265)
+++ trunk/kernel/mm/mapper.h	(revision 313)
@@ -57,4 +57,6 @@
  * - the mapper_move_user() function is used to move data to or from an user buffer.
  *   This user space buffer can be physically distributed in several clusters.
+ * - the mapper_move_kernel() function is used to move data to or from a remote kernel
+ *   buffer, that can be physically located in any cluster.
  * - In the present implementation the cache size for a given file increases on demand,
  *   and the  allocated memory is only released when the mapper/inode is destroyed.
@@ -117,12 +119,10 @@
 
 /*******************************************************************************************
- * This function move data between a mapper and an user or kernel buffer.
+ * This function move data between a mapper and a - possibly distributed - user buffer.
  * It must be called by a thread running in the cluster containing the mapper.
- * - A kernel buffer must be entirely contained in the same cluster as the mapper.
- * - An user buffer can be physically distributed in several clusters.
- * In both cases, the data transfer is split in "fragments": one fragment contains 
+ * It is called by the vfs_user_move() function to implement sys_read() and sys_write().
+ * If required, the data transfer is split in "fragments", where one fragment contains 
  * contiguous bytes in the same mapper page.
- * - It uses "hal_uspace" accesses to move a fragment to/from the user buffer.
- * - It uses a simple memcpy" access to move a fragment to/from a kernel buffer.
+ * It uses "hal_uspace" accesses to move a fragment to/from the user buffer.
  * In case of write, the dirty bit is set for all pages written in the mapper.
  * The offset in the file descriptor is not modified by this function.
@@ -132,14 +132,37 @@
  * @ is_user      : user space buffer if true / kernel local buffer if false.
  * @ file_offset  : first byte to move in file.
- * @ buffer       : pointer on buffer (local kernel buffer or user spaceaddress in user space.
+ * @ buffer       : user space pointer on user buffer.
  * @ size         : number of bytes to move.
  * returns O if success / returns EINVAL if error.
  ******************************************************************************************/
-error_t mapper_move_buffer( mapper_t * mapper,
+error_t mapper_move_user( mapper_t * mapper,
+                          bool_t     to_buffer,
+                          bool_t     is_user,
+                          uint32_t   file_offset,
+                          void     * buffer,
+                          uint32_t   size );
+
+/*******************************************************************************************
+ * This function move data between a mapper and a remote kernel buffer.
+ * It must be called by a thread running in the cluster containing the mapper.
+ * If required, the data transfer is split in "fragments", where one fragment contains 
+ * contiguous bytes in the same mapper page.
+ * It uses a "remote_memcpy" to move a fragment to/from the kernel buffer.
+ * In case of write, the dirty bit is set for all pages written in the mapper.
+ * The offset in the file descriptor is not modified by this function.
+ *******************************************************************************************
+ * @ mapper       : local pointer on mapper.
+ * @ to_buffer    : mapper -> buffer if true / buffer -> mapper if false.
+ * @ file_offset  : first byte to move in file.
+ * @ buffer_xp    : extended pointer on kernel buffer.
+ * @ size         : number of bytes to move.
+ * returns O if success / returns EINVAL if error.
+ ******************************************************************************************/
+error_t mapper_move_kernel( mapper_t * mapper,
                             bool_t     to_buffer,
-                            bool_t     is_user,
                             uint32_t   file_offset,
-                            void     * buffer,
+                            xptr_t     buffer_xp,
                             uint32_t   size );
+
 
 /*******************************************************************************************
