RTEMS 6.1-rc4
Loading...
Searching...
No Matches
Files | Data Structures | Typedefs | Functions
RTEMS Print Support

Files

file  print.h
 User print interface to the bspIO print plug in.
 
file  printer.h
 User print interface to the bspIO print plug in.
 
file  printk_plugin.c
 This source file contains the implementation of rtems_printk_printer() and rtems_print_printer_printk().
 

Data Structures

struct  rtems_printer
 
struct  rtems_printer_task_context
 

Typedefs

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

Functions

int rtems_printf (const rtems_printer *printer, const char *format,...) RTEMS_PRINTFLIKE(2
 Print to the kernel plugin handler. This has to be a macro because there is no vprint version of the plug in handlers.
 
int int rtems_vprintf (const rtems_printer *printer, const char *format, va_list ap)
 Print to the kernel plugin handler. This has to be a macro because there is no vprint version of the plug in handlers.
 
void rtems_print_printer_printk (rtems_printer *printer)
 Initializes the printer to print via printk().
 
void rtems_print_printer_printf (rtems_printer *printer)
 Initializes the printer to print via printf().
 
void rtems_print_printer_fprintf (rtems_printer *printer, FILE *file)
 Initializes the printer to print via fprintf() using the specified file stream.
 
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().
 
int rtems_print_printer_task (rtems_printer *printer, rtems_printer_task_context *context)
 Creates a printer task.
 
void rtems_printer_task_drain (rtems_printer_task_context *context)
 Drains the work queue of the printer task.
 

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.

◆ rtems_printf()

int rtems_printf ( const rtems_printer printer,
const char *  format,
  ... 
)

Print to the kernel plugin handler. This has to be a macro because there is no vprint version of the plug in handlers.

Parameters
[in]printerPointer to the printer structure.
[in]fmtPrint format string.
[in]...Print variable argument list.
Returns
int Number of characters printed.

◆ rtems_vprintf()

int int rtems_vprintf ( const rtems_printer printer,
const char *  format,
va_list  ap 
)

Print to the kernel plugin handler. This has to be a macro because there is no vprint version of the plug in handlers.

Parameters
[in]printerPointer to the printer structure.
[in]fmtPrint format string.
[in]apPrint variable argument list pointer.
Returns
int Number of characters printed.