Changes between Version 7 and Version 8 of ioc_device_api


Ignore:
Timestamp:
Jan 21, 2020, 12:11:31 AM (5 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ioc_device_api

    v7 v8  
    5555Note : 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.
    5656
    57 === C.2) Synchronous I/O operations ===
     57=== C.2) Synchronous operations ===
    5858
    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.
     59Almost-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.
    6060
    6161These 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,
     
    6363== __D) Driver API__ ==
    6464
    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.
     65All 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 )
    7069
    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 :
     70The 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)
    7272 - '''count''' : number of contiguous blocks to be moved.
    7373 - '''buffer_xp''' : extended pointer on kernel buffer.
    7474 - '''lba''' : logic block address (index of block in hardware device).
     75
     76The 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
     83These four commands use the three following arguments, that must be registered, with the command type, in