Changes between Version 17 and Version 18 of ioc_device_api


Ignore:
Timestamp:
Jan 22, 2020, 2:05:37 PM (5 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ioc_device_api

    v17 v18  
    4545 1. When a client thread request an I/O operation, the request is registered in the ''ioc_command_t'' structure embedded in the client thread descriptor, and the client thread registers itself in the waiting queue rooted in the IOC chdev. Then the client thread blocks on the THREAD_BLOCKED_IO condition, and deschedules.
    4646 1. The DEV server thread attached to the IOC device descriptor handles all commands registered in the IOC device waiting queue. For each pending request, it calls the ''ioc_driver_cmd()'' function that is itself a blocking function, returning only when the transfer is completed.
    47  1. When the hardware block device has a DMA capability, for an asynchronous request, the ''ioc_driver_cmd()'' function is supposed to lauch the DMA transfer, then blocks on the THREAD_BLOCKED_ISR condition, and deschedules.
    48  1. When the I/O operation completes, the hardware rises the IOC_IRQ, and the the ioc_driver_isr() function reactivates the server thread.
    49  1.When the server thread resumes, it reactivates the client thread, and handle the next request in the IOC waiting queue, or deschedules if the IOC queue is empty.
     47 1. When the ''ioc_driver_cmd()'' function returns, the server thread reactivates the client thread, and handle the next request in the TXT waiting queue, or deschedules if the queue is empty.
    5048
    5149Note : According to the scheduler policy, the DEV threads have an higher priority than the USR threads, and a DEV thread keep blocked when the associated waiting queue is empty.
     
    7977 - '''IOC_SYNC_READ''' : move blocks from the hardware device to a kernel buffer, with a polling policy.
    8078
    81 For asynchronous operations the '''ioc_driver_cmd()''' function is called by the server thread. It must block and deschedule after launching the I/O transfer. When the IOC_IRQ is raised by the hardware, the '''ioc_driver_isr()''' function reports the I/O operation status is reported in the command, and reactivates the server thread.
     79For '''asynchronous operations''', the '''ioc_driver_cmd()''' function is called by the server thread:
     80 1. When the hardware block device has a DMA capability, for an asynchronous request, the '''ioc_driver_cmd()''' function launches the DMA transfer. Then it blocks on the THREAD_BLOCKED_ISR condition, and deschedules.
     81 1. When the I/O operation completes, the hardware rises the IOC_IRQ, and the the '''ioc_driver_isr()''' function reports the I/O operation status, and reactivates the server thread.
    8282
    83 For synchronous operations, the '''ioc_driver_cmd()''' function is called by the client thread. It masks the IOC_IRQ, polls the IOC hardware status register until I/O transfer completion, and report I/O operation status in the command. The '''ioc_driver_isr()''' function is not involved.
     83For '''synchronous operations''', the '''ioc_driver_cmd()''' function is called by the client thread:
     84 1. It masks the IOC_IRQ, and polls the IOC hardware status register until I/O transfer completion,
     85 1. When the I/O operation completes, it reports the I/O operation status in the command.
     86The '''ioc_driver_isr()''' function is not involved.