Changes in trunk/kernel/devices/dev_ioc.h [3:1]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/devices/dev_ioc.h
r3 r1 25 25 #define _DEV_IOC_H 26 26 27 #include <almos_config.h>28 27 #include <hal_types.h> 29 28 30 29 /**** Forward declarations ****/ 31 30 32 struct chdev_s;31 struct device_s; 33 32 34 33 /***************************************************************************************** … … 105 104 106 105 /****************************************************************************************** 107 * This function completes the IOC chdevdescriptor initialisation,106 * This function completes the IOC device descriptor initialisation, 108 107 * namely the link with the implementation specific driver. 109 * The func, impl, channel, is_rx , base fields have beenpreviously initialised.108 * The func, impl, channel, is_rxt, base, and size fields must be previously initialised. 110 109 * It calls the specific driver initialisation function, to initialise the hardware 111 110 * device and the specific data structures when required. 112 * It creates the associated server thread and allocates a WTI from local ICU. 113 * It must de executed by a local thread. 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. 114 114 ****************************************************************************************** 115 * @ chdev : local pointer on IOC chdevdescriptor.115 * @ xp_dev : extended pointer on IOC device descriptor. 116 116 *****************************************************************************************/ 117 void dev_ioc_init( struct chdev_s * chdev );117 void dev_ioc_init( xptr_t xp_dev ); 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 registered 155 * 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 server 158 * 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), the 161 * driver does not block the server thread (it is only descheduled if the number of 162 * 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_CMD 165 * 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 151 171 #endif /* _DEV_IOC_H */
Note: See TracChangeset
for help on using the changeset viewer.