| 7 | This device provide access to various external mass storage peripherals such as a magnetic hard disk or a SD card, that can store blocks of data in a linear array of sectors indexed by a simple lba (logic block address). |
| 8 | It supports two command types of I/O operations: |
| 9 | * '''READ''' : move a given number of contiguous blocks from device to a memory buffer. |
| 10 | * '''WRITE''' : move a given number of contiguous blocks from a memory buffer to device. |
| 11 | |
| 12 | An I/O operation requires dynamic ressource allocation for IRQ routing to the dore running the client thread. It is always blocking for the client thread. The general scenario is detailed below: |
| 13 | 1. The client thread start the I/O operation, by calling the dev_ioc_read() or the dev_ioc_write() kernel functions that perform the following actions: |
| 14 | * it get a free WTI mailbox from the client cluster WTI allocator. |
| 15 | * it enables the WTI IRQ on the client cluster ICU and update the WTI interrupt vector. |
| 16 | * it access the PIC to link the WTI mailbox to the IOC IRQ. |
| 17 | * it builds the command descriptor stored in the thread descriptor. |
| 18 | * the client thread registers in the IOC device waiting queue, block on the THREAD_BLOCKED_IO condition, and deschedule. |
| 19 | 1. The server thread attached to the IOC device descriptor handles all commands registered in the IOC device waiting queue, calling the IOC driver CMD function to start the I/O operation. |
| 20 | 1. The IOC driver ISR (Interrupt Service Routine) signaling the I/O operation completion reactivates the client thread, that releases the allocated resources: |
| 21 | * it access the PIC to unlink the IOC IRQ. |
| 22 | * it disables the WTI IRQ in the client cluster ICU and reset the interrupt vector entry. |
| 23 | * it releases the WTI mailbox to the client cluster WTI allocator. |
| 24 | |
| 25 | Most hardware implementation have a DMA capability, but some implementations, such as the RDK (Ram Disk) implementation does not use DMA, and don't use IRQ. |
| 26 | |