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

4.115
Last change on this file since f11858ac was bd5a1386, checked in by Sebastian Huber <sebastian.huber@…>, on 08/13/12 at 09:29:13

libcsupport: Add and use rtems_putc()

This reduces code size and provides a function similar to fputc().

  • Property mode set to 100644
File size: 2.3 KB
Line 
1/**
2 * @file rtems/bspIo.h
3 *
4 * This include file defines the interface to kernel print methods.
5 */
6
7/*
8 *  COPYRIGHT (c) 1998 valette@crf.canon.fr
9 *  COPYRIGHT (c) 2011 On-Line Applications Research Corporation.
10 *
11 *  The license and distribution terms for this file may be
12 *  found in the file LICENSE in this distribution or at
13 *  http://www.rtems.com/license/LICENSE.
14 */
15#ifndef _RTEMS_BSPIO_H
16#define _RTEMS_BSPIO_H
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22/*
23 * All the functions declared as extern after this comment
24 * MUST be implemented in each BSP. Using this function,
25 * this directory contains shared code that export higher level
26 * functionnality described after the next command.
27 */
28typedef void    (*BSP_output_char_function_type)        (char c);
29typedef int     (*BSP_polling_getchar_function_type)    (void);
30
31extern  BSP_output_char_function_type           BSP_output_char;
32extern  BSP_polling_getchar_function_type       BSP_poll_char;
33
34/*
35 * All the function declared as extern after this comment
36 * are available for each BSP by compiling and linking
37 * the files contained in this directory PROVIDED definition
38 * and initialisation of the previous variable are done.
39 */
40#include <stdarg.h>
41
42/**
43 *  This method polls for a key in the simplest possible fashion
44 *  from whatever the debug console device is.
45 *
46 *  @return If a character is available, it is returned.  Otherwise
47 *          this method returns -1.
48 *
49 *  @note This method uses the BSP_poll_char pointer to a BSP
50 *        provided method.
51 */
52extern int getchark(void);
53extern void vprintk(const char *fmt, va_list ap);
54extern void printk(const char *fmt, ...);
55extern void putk(const char *s);
56extern void rtems_putc(char c);
57
58/*
59 *  This routine is passed into RTEMS reporting functions
60 *  that may have their output redirected.  In particular,
61 *  the cpu usage, period usage, and stack usage reporting
62 *  functions use this.  If the user provides their
63 *  own "printf plugin", then they may redirect those reports
64 *  as they see fit.
65 */
66extern int printk_plugin(void *context, const char *fmt, ...);
67
68extern int rtems_printf_plugin(void *context, const char *fmt, ...);
69
70/*
71 *  Type definition for function which can be plugged in to
72 *  certain reporting routines to redirect the output
73 */
74typedef int (*rtems_printk_plugin_t)(void *, const char *format, ...);
75
76#ifdef __cplusplus
77}
78#endif
79
80#endif
Note: See TracBrowser for help on using the repository browser.