Ignore:
File:
1 edited

Legend:

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

    r3 r1  
    3030/****  Forward declarations  ****/
    3131
    32 struct chdev_s ;
     32struct device_s ;
    3333
    3434/******************************************************************************************
     
    7979
    8080/******************************************************************************************
    81  * This function completes the TXT chdev descriptor initialisation,
     81 * This function completes the TXT device descriptor initialisation,
    8282 * namely the link with the implementation specific driver.
    83  * The func, impl, channel, is_rxt, base fields have been previously initialised.
     83 * The func, impl, channel, is_rxt, base, and size fields must be previously initialised.
    8484 * It calls the specific driver initialisation function, to initialise the hardware
    8585 * device and the driver specific data structures when required.
    86  * It creates the associated server thread and allocates a WTI from local ICU.
    87  * It must de executed by a local thread.
     86 * It creates the associated server thread.
     87 * It can be executed in another cluster than cluster containing the device descriptor
     88 * or the hardware device itself.
    8889 ******************************************************************************************
    89  * @ chdev     : local pointer on TXT device descriptor.
     90 * @ xp_dev     : extended pointer on TXT device descriptor.
    9091 *****************************************************************************************/
    91 void dev_txt_init( struct chdev_s * chdev );
     92void dev_txt_init( xptr_t xp_dev );
    9293
    9394/******************************************************************************************
    9495 * This blocking function read a single character from the terminal identified
    9596 * by the "channel" argument. The corresponding request is actually registered in the
    96  * chdev requests queue, and the calling thread is descheduled, blocked until
     97 * device pending requests queue, and the calling thread is descheduled, blocked until
    9798 * transfer completion.
    9899 * It must be called in the client cluster.
     
    108109 * This blocking function writes a character string on the terminal identified
    109110 * by the "channel" argument. The corresponding request is actually registered in the
    110  * chdev requests queue, and the calling thread is descheduled, blocked until
     111 * device pending requests queue, and the calling thread is descheduled, blocked until
    111112 * transfer completion.
    112113 * It must be called in the client cluster.
     
    122123
    123124 /***************************************************************************************
    124  * This low-level blocking function is used by the kernel to display one string on a
     125 * This low-level blocking function is used by the kernel to display one character on a
    125126 * given TXT channel without descheduling the calling thread,  without registering it
    126127 * in the TXT device waiting queue, and without using the TXT irq.
     
    135136                            uint32_t   count );
    136137
     138/******************************************************************************************
     139 * This function is executed by the server thread associated to the TXT device descriptor.
     140 * This thread is created and lauched by the dev_txt_init() function, and is used
     141 * by the TXT_READ and TXT_WRITE operation types. It executes an infinite loop to handle
     142 * sequencially all commands registered by the client threads in the device waiting queue.
     143 * 
     144 * The driver CMD function is blocking, and returns only when the command is completed.
     145 * can use a busy waiting policy, or block the server thread on the THREAD_BLOCKED_IO_ISR
     146 * condition and deschedule, using the ISR to reactivate the server thread.
     147 *
     148 * When the waiting queue is empty, the server thread blocks on the THREAD_BLOCKED_IO_CMD
     149 * condition and deschedule. It is re-activated by a client thread registering a command.
     150 ******************************************************************************************
     151 * @ dev     : local pointer on device descriptor.
     152 *****************************************************************************************/
     153void dev_txt_server( struct device_s * dev );
     154
    137155
    138156#endif  /* _DEV_TXT_H_ */
Note: See TracChangeset for help on using the changeset viewer.