Debug I/O Interface.
More...
#include <kos/dbgio.h>
Debug I/O Interface.
This struct represents a single dbgio interface. This should represent a generic pollable console interface. We will store an ordered list of these statically linked into the program and fall back from one to the next until one returns true for detected(). Note that the last device in this chain is the null console, which will always return true.
int(* dbgio_handler::detected)() |
Detect this debug interface.
- Return values
-
1 | If the device is available and useable |
0 | If the device is unavailable |
int(* dbgio_handler::flush)() |
Flush any queued output.
- Return values
-
0 | On success |
-1 | On error (set errno as appropriate) |
int(* dbgio_handler::init)() |
Initialize this debug interface with default parameters.
- Return values
-
const char* dbgio_handler::name |
Name of the dbgio handler.
int(* dbgio_handler::read)() |
Read one character from the console.
- Return values
-
0 | On success |
-1 | On failure (set errno as appropriate) |
int(* dbgio_handler::read_buffer)(uint8 *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)
int(* dbgio_handler::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
-
int(* dbgio_handler::shutdown)() |
Shutdown this debug interface.
- Return values
-
int(* dbgio_handler::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.
int(* dbgio_handler::write_buffer)(const uint8 *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: