Ignore:
Timestamp:
Jan 15, 2019, 1:59:32 PM (3 years ago)
Author:
alain
Message:

1) introduce a dev_ioc_sync_write() function in IOC API,

to improve the DEVFS synchronous update.

2) fix a big bug in both the user_dir_create() and user_dir_destroy()

functions: add an extended pointer on the reference client process
in the function's arguments.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/devices/dev_ioc.h

    r457 r614  
    3838 * magnetic hard disk or a SD card, that can store blocks of data in a linear array
    3939 * of sectors indexed by a simple lba (logic block address).
    40  * It supports three command types:
    41  * - READ      : move blocks from device to memory, with a descheduling policy.
    42  * - WRITE     : move blocks from memory to device, with a descheduling policy.
    43  * - SYNC_READ : move blocks from device to memory, with a busy waiting policy.
     40 * It supports four command types:
     41 * - READ       : move blocks from device to memory, with a descheduling policy.
     42 * - WRITE      : move blocks from memory to device, with a descheduling policy.
     43 * - SYNC_READ  : move blocks from device to memory, with a busy waiting policy.
     44 * - SYNC_WRITE : move blocks from memory to device, with a busy waiting policy.
    4445
    4546 * A READ or WRITE operation requires dynamic ressource allocation. The calling thread
     
    6465 *    3) release the WTI mailbox to the client cluster WTI allocator.
    6566 *
    66  * The SYNC_READ operation is used by the kernel in the initialisation phase. It does
    67  * not uses the IOC device waiting queue and server thread, and does not use the IOC IRQ,
    68  * but implement a busy-waiting policy for the calling thread.
     67 * The SYNC_READ and SYNC_WRITE operations are used by the kernel in the initialisation
     68 * phase. These operations do not not use the IOC device waiting queue, the server thread,
     69 * and the IOC IRQ, but implement a busy-waiting policy for the calling thread.
    6970 *****************************************************************************************/
    7071
     
    8586 *****************************************************************************************/
    8687
    87 enum ioc_impl_e
     88typedef enum
    8889{
    8990    IMPL_IOC_BDV =   0,     
     
    99100 *****************************************************************************************/
    100101
    101 enum
     102typedef enum
    102103{
    103104    IOC_READ       = 0,
    104105    IOC_WRITE      = 1,
    105106    IOC_SYNC_READ  = 2,
    106 };
     107    IOC_SYNC_WRITE = 3,
     108}
     109cmd_type_t;
    107110
    108111typedef struct ioc_command_s
     
    131134
    132135/******************************************************************************************
    133  * This blocking function try to tranfer one or several contiguous blocks of data
     136 * This blocking function moves one or several contiguous blocks of data
    134137 * from the block device to a local memory buffer. The corresponding request is actually
    135138 * registered in the device pending request queue, and the calling thread is descheduled,
     
    147150
    148151/******************************************************************************************
    149  * This blocking function try to tranfer one or several contiguous blocks of data
     152 * This blocking function moves one or several contiguous blocks of data
    150153 * from a local memory buffer to the block device. The corresponding request is actually
    151154 * registered in the device pending request queue, and the calling thread is descheduled,
     
    163166
    164167/******************************************************************************************
    165  * This blocking function try to tranfer one or several contiguous blocks of data
    166  * from the block device to a memory buffer.
     168 * This blocking function moves one or several contiguous blocks of data
     169 * from the block device to a local memory buffer.
    167170 * It does  not uses the IOC device waiting queue and server thread, and does not use
    168171 * the IOC IRQ, but call directly the relevant IOC driver, implementing a busy-waiting
     
    179182                           uint32_t       count );
    180183
     184/******************************************************************************************
     185 * This blocking function moves one or several contiguous blocks of data
     186 * from a local memory buffer to the block device.
     187 * It does  not uses the IOC device waiting queue and server thread, and does not use
     188 * the IOC IRQ, but call directly the relevant IOC driver, implementing a busy-waiting
     189 * policy for the calling thread.
     190 * It must be called in the client cluster.
     191 ******************************************************************************************
     192 * @ buffer    : local pointer on source buffer in memory (must be block aligned).
     193 * @ lba       : first block index on device.
     194 * @ count     : number of blocks to transfer.
     195 * @ returns 0 if success / returns EINVAL if error.
     196 *****************************************************************************************/
     197error_t dev_ioc_sync_write( uint8_t      * buffer,
     198                            uint32_t       lba,
     199                            uint32_t       count );
     200
    181201#endif  /* _DEV_IOC_H */
Note: See TracChangeset for help on using the changeset viewer.