Changeset 313 for trunk/kernel/mm/mapper.h
- Timestamp:
- Aug 2, 2017, 3:24:57 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/mm/mapper.h
r265 r313 57 57 * - the mapper_move_user() function is used to move data to or from an user buffer. 58 58 * 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. 59 61 * - In the present implementation the cache size for a given file increases on demand, 60 62 * and the allocated memory is only released when the mapper/inode is destroyed. … … 117 119 118 120 /******************************************************************************************* 119 * This function move data between a mapper and a n user or kernelbuffer.121 * This function move data between a mapper and a - possibly distributed - user buffer. 120 122 * 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 124 125 * 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. 127 127 * In case of write, the dirty bit is set for all pages written in the mapper. 128 128 * The offset in the file descriptor is not modified by this function. … … 132 132 * @ is_user : user space buffer if true / kernel local buffer if false. 133 133 * @ 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. 135 135 * @ size : number of bytes to move. 136 136 * returns O if success / returns EINVAL if error. 137 137 ******************************************************************************************/ 138 error_t mapper_move_buffer( mapper_t * mapper, 138 error_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 ******************************************************************************************/ 161 error_t mapper_move_kernel( mapper_t * mapper, 139 162 bool_t to_buffer, 140 bool_t is_user,141 163 uint32_t file_offset, 142 void * buffer,164 xptr_t buffer_xp, 143 165 uint32_t size ); 166 144 167 145 168 /*******************************************************************************************
Note: See TracChangeset
for help on using the changeset viewer.