source: rtems/cpukit/include/rtems/bspIo.h @ e8020d1

Last change on this file since e8020d1 was e8020d1, checked in by Sebastian Huber <sebastian.huber@…>, on Jun 21, 2016 at 11:28:01 AM

Rename and move RTEMS_PRINTF_ATTRIBUTE()

Rename RTEMS_PRINTF_ATTRIBUTE() into RTEMS_PRINTFLIKE() (similar to
<sys/cdefs.h> printflike()) and move it to <rtems/score/basedefs.h>.

  • Property mode set to 100644
File size: 3.5 KB
Line 
1/**
2 * @file rtems/bspIo.h
3 *
4 * @brief Interface to Kernel Print Methods
5 *
6 * This include file defines the interface to kernel print methods.
7 */
8
9/*
10 *  COPYRIGHT (c) 1998 valette@crf.canon.fr
11 *  COPYRIGHT (c) 2011 On-Line Applications Research Corporation.
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.rtems.org/license/LICENSE.
16 */
17
18#ifndef _RTEMS_BSPIO_H
19#define _RTEMS_BSPIO_H
20
21#include <rtems/score/basedefs.h>
22
23#include <stdarg.h>
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29/**
30 * @defgroup BSPIO Kernel Print Support
31 *
32 * This module contains all methods and support related to providing
33 * kernel level print support.
34 *
35 * The following variables below are declared as extern and
36 * MUST be declared and initialized in each BSP. Using this indirect
37 * function, the functionality in this group is tailored for the BSP.
38 *
39 *  - BSP_output_char
40 *  - BSP_poll_char
41 */
42
43/**
44 * This type defines the prototype for the BSP provided method to
45 * print a single character. It is assumed to be polled.
46 */
47typedef void    (*BSP_output_char_function_type)        (char c);
48
49/**
50 * This type defines the prototype for the BSP provided method to
51 * input a single character. It is assumed to be polled.
52 */
53typedef int     (*BSP_polling_getchar_function_type)    (void);
54
55/**
56 * This variable points to the BSP provided method to output a
57 * character for the purposes of debug output.
58 */
59extern  BSP_output_char_function_type           BSP_output_char;
60
61/**
62 * This variable points to the BSP provided method to input a
63 * character for the purposes of debug input.
64 */
65extern  BSP_polling_getchar_function_type       BSP_poll_char;
66
67/**
68 * @brief Get Character (kernel I/O)
69 *
70 * This method polls for a key in the simplest possible fashion
71 * from whatever the debug console device is.
72 *
73 * @return If a character is available, it is returned.  Otherwise
74 *         this method returns -1.
75 *
76 * @note This method uses the BSP_poll_char pointer to a BSP
77 *       provided method.
78 */
79extern int getchark(void);
80
81/**
82 * @brief Variable Argument printk()
83 *
84 * This method allows the user to access printk() functionality
85 * with a va_list style argument.
86 *
87 * @param[in] fmt is a printf()-style format string
88 * @param[in] ap is a va_list pointer to arguments
89 *
90 * @return The number of characters output.
91 */
92extern int vprintk(const char *fmt, va_list ap);
93
94/**
95 * @brief Kernel Print
96 *
97 * This method allows the user to perform a debug printk().
98 *
99 * @param[in] fmt is a printf()-style format string
100 *
101 * @return The number of characters output.
102 */
103extern int printk(const char *fmt, ...) RTEMS_PRINTFLIKE(1, 2);
104
105/**
106 * @brief Kernel Put String
107 *
108 * This method allows the user to perform a debug puts().
109 *
110 * @param[in] s is the string to print
111 *
112 * @return The number of characters output.
113 */
114extern int putk(const char *s);
115
116/**
117 * @brief Kernel Put Character
118 *
119 * This method allows the user to perform a debug putc().
120 *
121 * @param[in] c is the character to print
122 */
123extern void rtems_putc(char c);
124
125/**
126 * Type definition for function which can be plugged in to
127 * certain reporting routines to redirect the output.
128 *
129 * Use the RTEMS Print interface to call these functions. Do not
130 * directly use them.
131 *
132 * If the user provides their own "printf plugin", then they may
133 * redirect those reports as they see fit.
134 */
135typedef int (*rtems_print_plugin_t)(void *, const char *format, va_list ap);
136
137/**@}*/
138
139#ifdef __cplusplus
140}
141#endif
142
143#endif
Note: See TracBrowser for help on using the repository browser.