RTEMS: RTEMS Print Support

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
Data Structures | Typedefs | Functions
RTEMS Print Support
API » IO » 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().
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] | printer | Pointer 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] | printer | Pointer 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] | printer | Pointer 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] | printer | Pointer 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] | printer | Pointer to the printer structure.
  [in] | context | The initialized printer task context.

Return values

  0 | Successful operation.
  EINVAL | Invalid context parameters.
  ENOMEM | Not 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] | context | The printer task context of a successfully started printer task.