RTEMS  5.0.0
Data Structures | Typedefs | Functions
RTEMS Print Support

Data Structures

struct  rtems_printer
 
struct  rtems_printer_task_context
 

Typedefs

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

Functions

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...
 
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.

Function Documentation

◆ 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.

◆ 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_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.