Changes between Version 8 and Version 9 of txt_device_api
- Timestamp:
- Jan 23, 2020, 12:22:35 AM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
txt_device_api
v8 v9 5 5 == __A) General principles__ == 6 6 7 The TXT device allows the kernel to access a text terminal peripheral. It is a multi-channel device, and there is one chdev per channel and per direction (TX/RX). 7 The TXT device allows the kernel to access a text terminal peripheral, seen as two (TX & RX) streams of characters. 8 9 It is a multi-channel device, and there is one chdev per channel and per direction (TX/RX). 8 10 9 11 The TXT0 (channel 0) is the kernel terminal, and is only used to display debug or log messages. 10 12 11 The " user" API, contains the functions used the user-levelsystem calls, and by the kernel itself. It defines three operation types : '''TXT_READ''', '''TXT_WRITE''', and '''TXT_SYNC_WRITE'''. This API is detailed in section C below.13 The "kernel" API, contains the functions used by the system calls, and by the kernel itself. It defines three operation types : '''TXT_READ''', '''TXT_WRITE''', and '''TXT_SYNC_WRITE'''. This API is detailed in section C below. 12 14 13 The '''asynchronous''' TXT_READ and TXT_WRITE operations are not directly executed by the client thread. The requests are registered in the waiting queue rooted in the TXT chdev descriptor. These requests are actually handled by a dedicated server thread running in the cluster containing the chdev descriptor, that call the generic ''txt_driver_cmd()'' function for each registered request. A TXT_WRITE operation (TX direction) moves N characters from a kernel buffer to the TXT terminal. A TXT_READ operation moves one single character from the TXT terminal to a kernel buffer.15 The '''asynchronous''' TXT_READ and TXT_WRITE operations are not directly executed by the client thread. The requests are registered in the waiting queue rooted in the TXT chdev descriptor. These requests are actually handled by a dedicated server thread running in the cluster containing the chdev descriptor, that call the generic ''txt_driver_cmd()'' function for each registered request. A TXT_WRITE operation (TX direction) moves N characters from a kernel buffer to the TXT terminal. A TXT_READ operation (RX direction) moves one single character from the TXT terminal to a kernel buffer. 14 16 15 17 The '''synchronous''' SYNC_WRITE operation is used by the kernel to display debug messages on the TXT0. It does not use the waiting queue, and it does not use the server thread. The client thread calls directly the ''txt_driver_aux()'' function, without using the the txt_command_t structure to communicate with the driver. 16 18 17 Most TXT device implementations use two (hardware or software) FIFOs for asynchronous READ and WRITE operations. These FIFOs are not controlled by the kernel, but are controlled by the ''txt_driver_cmd()'' and ''txt_cxd_isr()''. When they are used by the driver, the TXT_TX_IRQ and TXT_RX_IRQ are routed to the core executing the corresponding TXT server thread. (ISR stand for Interrupt Service Routine).19 Most TXT device implementations use two (hardware or software) FIFOs for asynchronous READ and WRITE operations. These FIFOs are not controlled by the kernel, but are accessed by the ''txt_driver_cmd()'' and ''txt_cxd_isr()'' function. When they are used by the driver, the TXT_TX_IRQ and TXT_RX_IRQ are routed to the core executing the corresponding TXT server thread. (ISR stand for Interrupt Service Routine). 18 20 19 T o access the various drivers, the TXT device defines a lower-level "driver" API, thatis detailed in section D below.21 The lower level "driver" API is detailed in section D below. 20 22 21 23 All TXT device structures and access functions are defined in the [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/devices/dev_txt.c dev_txt.c] et [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/devices/dev_txt.h dev_txt.h] files. … … 31 33 It must be called by a local thread. 32 34 33 == __C) The " user" API__ ==35 == __C) The "kernel" API__ == 34 36 35 37 These three I/O operations are blocking, and return only when the transfer is completed, but the blocking policy depends on the operation type.