Debug I/O Interface.
More...
#include <kos/dbgio.h>
|
| | SLIST_ENTRY (dbgio_handler) entry |
| | dbgio handler list handle.
|
| |
|
| const char * | name |
| | Name of the dbgio handler.
|
| |
| int(* | detected )(void) |
| | Detect this debug interface.
|
| |
| int(* | init )(void) |
| | Initialize this debug interface with default parameters.
|
| |
| int(* | shutdown )(void) |
| | Shutdown this debug interface.
|
| |
| int(* | set_irq_usage )(int mode) |
| | Set either polled or IRQ usage for this interface.
|
| |
| int(* | read )(void) |
| | Read one character from the console.
|
| |
| int(* | write )(int c) |
| | Write one character to the console.
|
| |
| int(* | flush )(void) |
| | Flush any queued output.
|
| |
| int(* | write_buffer )(const uint8_t *data, int len, int xlat) |
| | Write an entire buffer of data to the console.
|
| |
| int(* | read_buffer )(uint8_t *data, int len) |
| | Read an entire buffer of data from the console.
|
| |
Debug I/O Interface.
This struct represents a single dbgio interface. This should represent a generic pollable console interface. We store an ordered, singly-linked list of these and fall back from one to the next until one returns true for detected(). Users may create and add their own dbgio interfaces using the dbgio_add_handler() function. Note that the last device in this chain is the null console, which will always return true.
◆ SLIST_ENTRY()
| dbgio_handler_t::SLIST_ENTRY |
( |
dbgio_handler | | ) |
|
dbgio handler list handle.
Contrary to what doxygen might think, this is not a function.
◆ detected
| int(* dbgio_handler_t::detected) (void) |
Detect this debug interface.
- Return values
-
| 1 | If the device is available and usable |
| 0 | If the device is unavailable |
◆ flush
| int(* dbgio_handler_t::flush) (void) |
Flush any queued output.
- Return values
-
| 0 | On success |
| -1 | On error (set errno as appropriate) |
◆ init
| int(* dbgio_handler_t::init) (void) |
Initialize this debug interface with default parameters.
- Return values
-
◆ name
| const char* dbgio_handler_t::name |
Name of the dbgio handler.
◆ read
| int(* dbgio_handler_t::read) (void) |
Read one character from the console.
- Return values
-
| 0 | On success |
| -1 | On failure (set errno as appropriate) |
◆ read_buffer
| int(* dbgio_handler_t::read_buffer) (uint8_t *data, int len) |
Read an entire buffer of data from the console.
- Parameters
-
| data | The buffer to read into |
| len | The length of the buffer |
- Returns
- Number of characters read on success, or -1 on failure (set errno as appropriate)
◆ set_irq_usage
| int(* dbgio_handler_t::set_irq_usage) (int mode) |
Set either polled or IRQ usage for this interface.
- Parameters
-
| mode | 1 for IRQ-based usage, 0 for polled I/O |
- Return values
-
◆ shutdown
| int(* dbgio_handler_t::shutdown) (void) |
Shutdown this debug interface.
- Return values
-
◆ write
| int(* dbgio_handler_t::write) (int c) |
Write one character to the console.
- Parameters
-
- Return values
-
| 1 | On success |
| -1 | On error (set errno as appropriate) |
- Note
- Interfaces may require a call to flush() before the output is actually flushed to the console.
◆ write_buffer
| int(* dbgio_handler_t::write_buffer) (const uint8_t *data, int len, int xlat) |
Write an entire buffer of data to the console.
- Parameters
-
| data | The buffer to write |
| len | The length of the buffer |
| xlat | If non-zero, newline transformations may occur |
- Returns
- Number of characters written on success, or -1 on failure (set errno as appropriate)
The documentation for this struct was generated from the following file: