Changeset 3 for trunk/kernel/devices/dev_ioc.h
- Timestamp:
- Apr 26, 2017, 2:08:13 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/devices/dev_ioc.h
r1 r3 25 25 #define _DEV_IOC_H 26 26 27 #include <almos_config.h> 27 28 #include <hal_types.h> 28 29 29 30 /**** Forward declarations ****/ 30 31 31 struct device_s;32 struct chdev_s; 32 33 33 34 /***************************************************************************************** … … 104 105 105 106 /****************************************************************************************** 106 * This function completes the IOC devicedescriptor initialisation,107 * This function completes the IOC chdev descriptor initialisation, 107 108 * namely the link with the implementation specific driver. 108 * The func, impl, channel, is_rx t, base, and size fields must bepreviously initialised.109 * The func, impl, channel, is_rx, base fields have been previously initialised. 109 110 * It calls the specific driver initialisation function, to initialise the hardware 110 111 * device and the specific data structures when required. 111 * It creates the associated server thread. 112 * It can be executed in another cluster than the cluster containing the device descriptor 113 * or the hardware device itself. 112 * It creates the associated server thread and allocates a WTI from local ICU. 113 * It must de executed by a local thread. 114 114 ****************************************************************************************** 115 * @ xp_dev : extended pointer on IOC devicedescriptor.115 * @ chdev : local pointer on IOC chdev descriptor. 116 116 *****************************************************************************************/ 117 void dev_ioc_init( xptr_t xp_dev );117 void dev_ioc_init( struct chdev_s * chdev ); 118 118 119 119 /****************************************************************************************** … … 149 149 uint32_t count ); 150 150 151 /******************************************************************************************152 * This function is executed by the server thread associated to the IOC device descriptor.153 * This thread is created and activated by the dev_ioc_init() function.154 * It executes an infinite loop to handle sequencially all commands registered155 * by the client threads in the device waiting queue, calling the driver CMD function.156 *157 * - If the peripheral can only handle one single command, the driver block the server158 * thread on the THREAD_BLOCKED_DEV_ISR condition, waiting I/O operation conmpletion.159 * The server thread must be reacticated by the driver ISR function.160 * - If the peripheral can handle several commands in parallel (AHCI is an example), the161 * driver does not block the server thread (it is only descheduled if the number of162 * commands exceeeds the max number of parallel commands supported by the peripheral.163 *164 * When the waiting queue is empty, the server thread blocks on the THREAD_BLOCKED_CMD165 * condition and deschedule. It is re-activated by a client thread registering a command.166 ******************************************************************************************167 * @ dev : local pointer on IOC device descriptor.168 *****************************************************************************************/169 void dev_ioc_server( struct device_s * dev );170 171 151 #endif /* _DEV_IOC_H */
Note: See TracChangeset
for help on using the changeset viewer.