Changes between Version 7 and Version 8 of ioc_device_api
- Timestamp:
- Jan 21, 2020, 12:11:31 AM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ioc_device_api
v7 v8 55 55 Note : According to the scheduler policy, the DEV thread has an higher priority than any user thread, but it is not selected when the associated waiting queue is empty. 56 56 57 === C.2) Synchronous I/Ooperations ===57 === C.2) Synchronous operations === 58 58 59 Almost-mkh uses the '''synchronous''' SYNC_READ and SYNC_WRITE operations in the kernel_init() function, or to update the FAT (both the FAT mapper in memory, and the FAT on IOC device), or to update a directory on IOC device when a new file is created.59 Almost-mkh uses the '''synchronous''' SYNC_READ and SYNC_WRITE operations in the kernel_init() function, or to synchronously update the FAT (both the FAT mapper in memory, and the FAT on IOC device), or the directory files on IOC device. 60 60 61 61 These synchronous operations use neither the IOC device waiting queue, nor the DEV server thread, and the IRQ. The client thread does not deschedules : it registers the arguments in the IOC command structure embedded in the client thread descriptor, and calls directly the blocking IOC driver CMD function, … … 63 63 == __D) Driver API__ == 64 64 65 The IOC device defines uses the same four command types to access the IOC driver(s) : 66 - '''IOC_WRITE''' : move blocks from a kernel buffer to the hardware device, with a descheduling policy. 67 - '''IOC_READ''' : move blocks from the hardware device to a kernel buffer, with a descheduling policy. 68 - '''IOC_SYNC_WRITE''' : move blocks from a kernel buffer to the hardware device, with a polling policy. 69 - '''IOC_SYNC_READ''' : move blocks from the hardware device to a kernel buffer, with a polling policy. 65 All IOC drivers must define three functions : 66 * void '''ioc_driver_init( chdev_t *ioc_chdev ) 67 * void '''ioc_driver_cmd'''( xptr_t thread_xp ) 68 * void '''ioc_driver_isr'''( chdev_t * ioc_chdev ) 70 69 71 These four commands use the three following arguments, that must be registered, with the command type, in the ''ioc_command_t'' structure embedded in the client thread descriptor : 70 The ioc_driver_cmd()'' function arguments are actually defined in the ''ioc_command_t'' structure embedded in the client thread descriptor. One command contains four informations: 71 - '''type''' : operation type (defined below) 72 72 - '''count''' : number of contiguous blocks to be moved. 73 73 - '''buffer_xp''' : extended pointer on kernel buffer. 74 74 - '''lba''' : logic block address (index of block in hardware device). 75 76 The four operation types for the IOC driver(s) are the following: 77 - '''IOC_WRITE''' : move blocks from a kernel buffer to the hardware device, with a descheduling policy. 78 - '''IOC_READ''' : move blocks from the hardware device to a kernel buffer, with a descheduling policy. 79 - '''IOC_SYNC_WRITE''' : move blocks from a kernel buffer to the hardware device, without descheduling. 80 - '''IOC_SYNC_READ''' : move blocks from the hardware device to a kernel buffer, without descheduling. 81 82 83 These four commands use the three following arguments, that must be registered, with the command type, in