Changes between Version 15 and Version 16 of ioc_device_api


Ignore:
Timestamp:
Jan 21, 2020, 11:50:56 PM (4 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ioc_device_api

    v15 v16  
    99The block size is supposed to be 512 bytes.
    1010
    11 The ''user'' API contains the functions used by the user-level system calls, and defines four operation types : the '''IOC_READ''', '''IOC_WRITE''', '''IOC_SYNC_READ''', and '''IOC_SYNC_WRITE''' operations move a given number of contiguous blocks between the block device and a kernel memory buffer. This API is detailed in section C below.
     11The "user" API contains the functions used by the user-level system calls, and defines four operation types : the '''IOC_READ''', '''IOC_WRITE''', '''IOC_SYNC_READ''', and '''IOC_SYNC_WRITE''' operations move a given number of contiguous blocks between the block device and a kernel memory buffer. This API is detailed in section C below.
    1212
    1313* The '''asynchronous''' READ and WRITE operations are not directly executed by the client thread. The READ and WRITE requests are registered in the waiting queue rooted in the IOC chdev descriptor. These requests are actually handled by a dedicated server thread running in the cluster containing the chdev descriptor, that calls the ''ioc_driver_cmd()'' function.
     
    1919An exception is the IOC-RDK implementation, where the block device is actually implemented as physical memory. This IOC-RDK implementation does not use DMA, and does not use an IRQ. The data transfer is directly executed by the ''ioc_driver_cmd()''  software function.
    2020
    21 To access the various drivers, the IOC device defines a lower-level ''driver'' API, that is detailed in section D below.
     21To access the various drivers, the IOC device defines a lower-level "driver" API, that is detailed in section D below.
    2222
    2323All IOC device structures and access functions are defined in the [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/devices/dev_ioc.c  dev_ioc.c] et [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/devices/dev_ioc.h dev_ioc.h] files.
     
    3333It must be called by a local thread.
    3434
    35 == __C) User API__ ==
     35== __C) The "user" API__ ==
    3636
    37 These four I/O operations are blocking for the calling thread, but the blocking policy depends on the operation type.
     37These four I/O operations are blocking and return only when the transfer is completed, but the blocking policy depends on the operation type.
    3838
    3939=== C.1) Asynchronous operations ===
     
    6060These synchronous operations use neither the IOC device waiting queue, nor the DEV server thread. 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, that executes the command and returns only when the transfer is completed. For a synchronous request, and even if the  the hardware IOC controller has a DMA capability, the ioc_driver_cmd() function is supposed to use a polling strategy to wait the transfer completion, withoutdriver
    6161
    62 == __D) Driver API__ ==
     62== __D) The "driver" API__ ==
    6363
    6464All IOC drivers must define three functions :
    65 * void '''ioc_driver_init( chdev_t *ioc_chdev )
    66 * void '''ioc_driver_cmd'''( xptr_t  thread_xp )
    67 * void '''ioc_driver_isr'''( chdev_t * ioc_chdev )
     65* void '''ioc_driver_init( chdev_t *ioc_chdev )'''
     66* void '''ioc_driver_cmd( xptr_t  thread_xp )'''
     67* void '''ioc_driver_isr( chdev_t * ioc_chdev )'''
    6868
    6969The ''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: