Changeset 265 for trunk/kernel/mm/mapper.h
- Timestamp:
- Jul 21, 2017, 7:36:08 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/mm/mapper.h
r246 r265 51 51 * - The mapper_get_page() function that return a page descriptor pointer from a page 52 52 * index in file is in charge of handling the miss on the mapper cache. 53 * - The vfs_mapper_move_page() function is used to handle miss on one specific page,53 * - The vfs_mapper_move_page() function access the file system to handle a mapper miss, 54 54 * or update a dirty page on device. 55 * - The vfs_mapper_load_all() functions is used to load all pages of a given directory56 * into the mapper.57 * - the mapper_move () function is used to move data to or from an user buffer.55 * - The vfs_mapper_load_all() functions is used to load all pages of a given file 56 * or directory into the mapper. 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 59 * - In the present implementation the cache size for a given file increases on demand, … … 117 117 118 118 /******************************************************************************************* 119 * This function move data between a kernel mapper and an userbuffer.119 * This function move data between a mapper and an user or kernel buffer. 120 120 * It must be called by a thread running in the cluster containing the mapper. 121 * It split the data in fragments : one fragment is a set of contiguous bytes 122 * stored in the same mapper page. 123 * It uses "hal_uspace" accesses to move fragments to/from the user buffer. 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 124 * 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. 124 127 * In case of write, the dirty bit is set for all pages written in the mapper. 125 128 * The offset in the file descriptor is not modified by this function. 126 129 ******************************************************************************************* 127 * @ mapper : local pointer on local mapper. 128 * @ to_buffer : move data from mapper to buffer if true. 130 * @ mapper : local pointer on mapper. 131 * @ to_buffer : mapper -> buffer if true / buffer -> mapper if false. 132 * @ is_user : user space buffer if true / kernel local buffer if false. 129 133 * @ file_offset : first byte to move in file. 130 * @ buffer : bufferaddress in user space.134 * @ buffer : pointer on buffer (local kernel buffer or user spaceaddress in user space. 131 135 * @ size : number of bytes to move. 132 136 * returns O if success / returns EINVAL if error. 133 137 ******************************************************************************************/ 134 error_t mapper_move( mapper_t * mapper, 135 bool_t to_buffer, 136 uint32_t file_offset, 137 void * buffer, 138 uint32_t size ); 138 error_t mapper_move_buffer( 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 ); 139 144 140 145 /*******************************************************************************************
Note: See TracChangeset
for help on using the changeset viewer.