KallistiOS  ##version##
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Data Fields
dbgio_handler Struct Reference

Debug I/O Interface. More...

#include <kos/dbgio.h>

Data Fields

const char * name
 Name of the dbgio handler. More...
 
int(* detected )()
 Detect this debug interface. More...
 
int(* init )()
 Initialize this debug interface with default parameters. More...
 
int(* shutdown )()
 Shutdown this debug interface. More...
 
int(* set_irq_usage )(int mode)
 Set either polled or IRQ usage for this interface. More...
 
int(* read )()
 Read one character from the console. More...
 
int(* write )(int c)
 Write one character to the console. More...
 
int(* flush )()
 Flush any queued output. More...
 
int(* write_buffer )(const uint8 *data, int len, int xlat)
 Write an entire buffer of data to the console. More...
 
int(* read_buffer )(uint8 *data, int len)
 Read an entire buffer of data from the console. More...
 

Detailed Description

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.

Field Documentation

int(* dbgio_handler::detected)()

Detect this debug interface.

Return values
1If the device is available and useable
0If the device is unavailable
int(* dbgio_handler::flush)()

Flush any queued output.

Return values
0On success
-1On error (set errno as appropriate)
int(* dbgio_handler::init)()

Initialize this debug interface with default parameters.

Return values
0On success
-1On failure
const char* dbgio_handler::name

Name of the dbgio handler.

int(* dbgio_handler::read)()

Read one character from the console.

Return values
0On success
-1On failure (set errno as appropriate)
int(* dbgio_handler::read_buffer)(uint8 *data, int len)

Read an entire buffer of data from the console.

Parameters
dataThe buffer to read into
lenThe 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
mode1 for IRQ-based usage, 0 for polled I/O
Return values
0On success
-1On failure
int(* dbgio_handler::shutdown)()

Shutdown this debug interface.

Return values
0On success
-1On failure
int(* dbgio_handler::write)(int c)

Write one character to the console.

Parameters
cThe character to write
Return values
1On success
-1On 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
dataThe buffer to write
lenThe length of the buffer
xlatIf 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: