Ignore:
Timestamp:
Aug 2, 2017, 3:24:57 PM (5 years ago)
Author:
alain
Message:

RSeveral modifs in the page-fault handling.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/mm/mapper.h

    r265 r313  
    5757 * - the mapper_move_user() function is used to move data to or from an user buffer.
    5858 *   This user space buffer can be physically distributed in several clusters.
     59 * - the mapper_move_kernel() function is used to move data to or from a remote kernel
     60 *   buffer, that can be physically located in any cluster.
    5961 * - In the present implementation the cache size for a given file increases on demand,
    6062 *   and the  allocated memory is only released when the mapper/inode is destroyed.
     
    117119
    118120/*******************************************************************************************
    119  * This function move data between a mapper and an user or kernel buffer.
     121 * This function move data between a mapper and a - possibly distributed - user buffer.
    120122 * It must be called by a thread running in the cluster containing the mapper.
    121  * - A kernel buffer must be entirely contained in the same cluster as the mapper.
    122  * - An user buffer can be physically distributed in several clusters.
    123  * In both cases, the data transfer is split in "fragments": one fragment contains
     123 * It is called by the vfs_user_move() function to implement sys_read() and sys_write().
     124 * If required, the data transfer is split in "fragments", where one fragment contains
    124125 * contiguous bytes in the same mapper page.
    125  * - It uses "hal_uspace" accesses to move a fragment to/from the user buffer.
    126  * - It uses a simple memcpy" access to move a fragment to/from a kernel buffer.
     126 * It uses "hal_uspace" accesses to move a fragment to/from the user buffer.
    127127 * In case of write, the dirty bit is set for all pages written in the mapper.
    128128 * The offset in the file descriptor is not modified by this function.
     
    132132 * @ is_user      : user space buffer if true / kernel local buffer if false.
    133133 * @ file_offset  : first byte to move in file.
    134  * @ buffer       : pointer on buffer (local kernel buffer or user spaceaddress in user space.
     134 * @ buffer       : user space pointer on user buffer.
    135135 * @ size         : number of bytes to move.
    136136 * returns O if success / returns EINVAL if error.
    137137 ******************************************************************************************/
    138 error_t mapper_move_buffer( mapper_t * mapper,
     138error_t mapper_move_user( mapper_t * mapper,
     139                          bool_t     to_buffer,
     140                          bool_t     is_user,
     141                          uint32_t   file_offset,
     142                          void     * buffer,
     143                          uint32_t   size );
     144
     145/*******************************************************************************************
     146 * This function move data between a mapper and a remote kernel buffer.
     147 * It must be called by a thread running in the cluster containing the mapper.
     148 * If required, the data transfer is split in "fragments", where one fragment contains
     149 * contiguous bytes in the same mapper page.
     150 * It uses a "remote_memcpy" to move a fragment to/from the kernel buffer.
     151 * In case of write, the dirty bit is set for all pages written in the mapper.
     152 * The offset in the file descriptor is not modified by this function.
     153 *******************************************************************************************
     154 * @ mapper       : local pointer on mapper.
     155 * @ to_buffer    : mapper -> buffer if true / buffer -> mapper if false.
     156 * @ file_offset  : first byte to move in file.
     157 * @ buffer_xp    : extended pointer on kernel buffer.
     158 * @ size         : number of bytes to move.
     159 * returns O if success / returns EINVAL if error.
     160 ******************************************************************************************/
     161error_t mapper_move_kernel( mapper_t * mapper,
    139162                            bool_t     to_buffer,
    140                             bool_t     is_user,
    141163                            uint32_t   file_offset,
    142                             void     * buffer,
     164                            xptr_t     buffer_xp,
    143165                            uint32_t   size );
     166
    144167
    145168/*******************************************************************************************
Note: See TracChangeset for help on using the changeset viewer.