RTEMS
Classes | Typedefs | Functions
RTEMS Print Support

Classes

struct  rtems_printer
 
struct  rtems_printer_task_context
 

Typedefs

typedef int(* rtems_print_printer) (void *, const char *format, va_list ap)
 

Functions

static bool rtems_print_printer_valid (const rtems_printer *printer)
 check if the printer is valid. More...
 
static void rtems_print_printer_empty (rtems_printer *printer)
 Initializes the printer to print nothing. More...
 
void rtems_print_printer_printk (rtems_printer *printer)
 Initializes the printer to print via printk(). More...
 
void rtems_print_printer_printf (rtems_printer *printer)
 Initializes the printer to print via printf(). More...
 
void rtems_print_printer_fprintf (rtems_printer *printer, FILE *file)
 Initializes the printer to print via fprintf() using the specified file stream. More...
 
void rtems_print_printer_fprintf_putc (rtems_printer *printer)
 Initializes the printer to print via fprintf() using an unbuffered FILE stream with output through rtems_putc(). More...
 
static void rtems_printer_task_initialize (rtems_printer_task_context *context)
 
static void rtems_printer_task_set_stack_size (rtems_printer_task_context *context, size_t stack_size)
 
static void rtems_printer_task_set_priority (rtems_printer_task_context *context, rtems_task_priority priority)
 
static void rtems_printer_task_set_file_descriptor (rtems_printer_task_context *context, int fd)
 
static void rtems_printer_task_set_buffer_table (rtems_printer_task_context *context, void *buffer_table)
 
static void rtems_printer_task_set_buffer_count (rtems_printer_task_context *context, size_t buffer_count)
 
static void rtems_printer_task_set_buffer_size (rtems_printer_task_context *context, size_t buffer_size)
 
int rtems_print_printer_task (rtems_printer *printer, rtems_printer_task_context *context)
 Creates a printer task. More...
 
void rtems_printer_task_drain (rtems_printer_task_context *context)
 Drains the work queue of the printer task. More...
 

Detailed Description

This module contains all methods and support related to providing the user with an interface to the kernel level print support.

Typedef Documentation

◆ rtems_print_printer

typedef int(* rtems_print_printer) (void *, const char *format, va_list ap)

Type definition for function which can be plugged in to certain reporting routines to redirect the output.

Use the RTEMS Print interface to call these functions. Do not directly use them.

If the user provides their own printer, then they may redirect those reports as they see fit.

Definition at line 49 of file printer.h.

Function Documentation

◆ rtems_print_printer_empty()

static void rtems_print_printer_empty ( rtems_printer printer)
inlinestatic

Initializes the printer to print nothing.

An empty printer prints nothing. You can use this to implement an enable and disable type print implementation.

Parameters
[in]printerPointer to the printer structure.

Definition at line 80 of file printer.h.

◆ rtems_print_printer_fprintf()

void rtems_print_printer_fprintf ( rtems_printer printer,
FILE *  file 
)

Initializes the printer to print via fprintf() using the specified file stream.

Parameters
[in]printerPointer to the printer structure.

◆ rtems_print_printer_fprintf_putc()

void rtems_print_printer_fprintf_putc ( rtems_printer printer)

Initializes the printer to print via fprintf() using an unbuffered FILE stream with output through rtems_putc().

Parameters
[in]printerPointer to the printer structure.

◆ rtems_print_printer_printf()

void rtems_print_printer_printf ( rtems_printer printer)

Initializes the printer to print via printf().

Parameters
[in]printerPointer to the printer structure.

◆ rtems_print_printer_printk()

void rtems_print_printer_printk ( rtems_printer printer)

Initializes the printer to print via printk().

Parameters
[in]printerPointer to the printer structure.

Definition at line 34 of file printk_plugin.c.

◆ rtems_print_printer_task()

int rtems_print_printer_task ( rtems_printer printer,
rtems_printer_task_context context 
)

Creates a printer task.

Print requests via rtems_printf() or rtems_vprintf() using a printer task printer are output to a buffer and then placed on a work queue in FIFO order. The work queue is emptied by the printer task. The printer task writes the buffer content to the file descriptor specified by the context. Buffers are allocated from a pool of buffers as specified by the context.

Parameters
[in]printerPointer to the printer structure.
[in]contextThe initialized printer task context.
Return values
0Successful operation.
EINVALInvalid context parameters.
ENOMEMNot enough resources.

◆ rtems_print_printer_valid()

static bool rtems_print_printer_valid ( const rtems_printer printer)
inlinestatic

check if the printer is valid.

Parameters
[in]printerPointer to the printer structure.
Returns
true The printer is valid else false is returned.

Definition at line 67 of file printer.h.

◆ rtems_printer_task_drain()

void rtems_printer_task_drain ( rtems_printer_task_context context)

Drains the work queue of the printer task.

Waits until all output buffers in the work queue at the time of this function call are written to the file descriptor and an fsync() completed.

The printer task must be successfully started via rtems_print_printer_task() before this function can be used. Otherwise, the behaviour is undefined.

Parameters
[in]contextThe printer task context of a successfully started printer task.