Changeset 626 for trunk/kernel/devices/dev_ioc.h
- Timestamp:
- Apr 29, 2019, 7:25:09 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/devices/dev_ioc.h
r614 r626 2 2 * dev_ioc.h - IOC (Block Device Controler) generic device API definition. 3 3 * 4 * Author Alain Greiner (2016,2017,2018 )4 * Author Alain Greiner (2016,2017,2018,2019) 5 5 * 6 6 * Copyright (c) UPMC Sorbonne Universites … … 44 44 * - SYNC_WRITE : move blocks from memory to device, with a busy waiting policy. 45 45 46 * A READ or WRITE operation requiresdynamic ressource allocation. The calling thread46 * The READ or WRITE operations require dynamic ressource allocation. The calling thread 47 47 * is descheduled, and the work is done by the server thread associated to IOC device. 48 48 * The general scenario is detailed below. … … 66 66 * 67 67 * The SYNC_READ and SYNC_WRITE operations are used by the kernel in the initialisation 68 * phase. These operations do not not use the IOC device waiting queue, the server thread, 69 * and the IOC IRQ, but implement a busy-waiting policy for the calling thread. 68 * phase, to update the FAT (both the FAT mapper and the FAT on IOC device), or to update 69 * a directory on IOC device when a new file is created. 70 * - These synchronous operations do not not use the IOC device waiting queue, 71 * the server thread, and the IOC IRQ, but implement a busy-waiting policy 72 * for the calling thread. 73 * - As the work 70 74 *****************************************************************************************/ 71 75 … … 119 123 } 120 124 ioc_command_t; 125 126 /****************************************************************************************** 127 * This function returns a printable string for a IOC command type. 128 ****************************************************************************************** 129 * @ cmd : command type. 130 * @ return pointer on string. 131 *****************************************************************************************/ 132 char * dev_ioc_cmd_str( cmd_type_t cmd ); 121 133 122 134 /****************************************************************************************** … … 138 150 * registered in the device pending request queue, and the calling thread is descheduled, 139 151 * waiting on transfer completion. It will be resumed by the IRQ signaling completion. 140 * It must be called in the client cluster.152 * It must be called by a local thread. 141 153 ****************************************************************************************** 142 154 * @ buffer : local pointer on target buffer in memory (must be block aligned). 143 155 * @ lba : first block index on device. 144 156 * @ count : number of blocks to transfer. 145 * @ returns 0 if success / returns EINVALif error.157 * @ returns 0 if success / returns -1 if error. 146 158 *****************************************************************************************/ 147 159 error_t dev_ioc_read( uint8_t * buffer, … … 154 166 * registered in the device pending request queue, and the calling thread is descheduled, 155 167 * waiting on transfer completion. It will be resumed by the IRQ signaling completion. 156 * It must be called in the client cluster.168 * It must be called by a local thread. 157 169 ****************************************************************************************** 158 170 * @ buffer : local pointer on source buffer in memory (must be block aligned). 159 171 * @ lba : first block index on device. 160 172 * @ count : number of blocks to transfer. 161 * @ returns 0 if success / returns EINVALif error.173 * @ returns 0 if success / returns -1 if error. 162 174 *****************************************************************************************/ 163 175 error_t dev_ioc_write( uint8_t * buffer, … … 167 179 /****************************************************************************************** 168 180 * This blocking function moves one or several contiguous blocks of data 169 * from the block device to a localmemory buffer.181 * from the block device to a - possibly remote - memory buffer. 170 182 * It does not uses the IOC device waiting queue and server thread, and does not use 171 183 * the IOC IRQ, but call directly the relevant IOC driver, implementing a busy-waiting 172 184 * policy for the calling thread. 173 * It must be called in the clientcluster.174 ****************************************************************************************** 175 * @ buffer : localpointer on target buffer in memory (must be block aligned).176 * @ lba : first block index on device. 177 * @ count : number of blocks to transfer. 178 * @ returns 0 if success / returns EINVALif error.179 *****************************************************************************************/ 180 error_t dev_ioc_sync_read( uint8_t * buffer,185 * It can be called by a thread running in any cluster. 186 ****************************************************************************************** 187 * @ buffer_xp : extended pointer on target buffer in memory (must be block aligned). 188 * @ lba : first block index on device. 189 * @ count : number of blocks to transfer. 190 * @ returns 0 if success / returns -1 if error. 191 *****************************************************************************************/ 192 error_t dev_ioc_sync_read( xptr_t buffer_xp, 181 193 uint32_t lba, 182 194 uint32_t count ); … … 184 196 /****************************************************************************************** 185 197 * This blocking function moves one or several contiguous blocks of data 186 * from a localmemory buffer to the block device.198 * from a - possibly remote - memory buffer to the block device. 187 199 * It does not uses the IOC device waiting queue and server thread, and does not use 188 200 * the IOC IRQ, but call directly the relevant IOC driver, implementing a busy-waiting 189 201 * policy for the calling thread. 190 * It must be called in the clientcluster.191 ****************************************************************************************** 192 * @ buffer : localpointer on source buffer in memory (must be block aligned).193 * @ lba : first block index on device. 194 * @ count : number of blocks to transfer. 195 * @ returns 0 if success / returns EINVALif error.196 *****************************************************************************************/ 197 error_t dev_ioc_sync_write( uint8_t * buffer,202 * It can be called by a thread running in any cluster. 203 ****************************************************************************************** 204 * @ buffer_xp : extended pointer on source buffer in memory (must be block aligned). 205 * @ lba : first block index on device. 206 * @ count : number of blocks to transfer. 207 * @ returns 0 if success / returns -1 if error. 208 *****************************************************************************************/ 209 error_t dev_ioc_sync_write( xptr_t buffer_xp, 198 210 uint32_t lba, 199 211 uint32_t count );
Note: See TracChangeset
for help on using the changeset viewer.