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 |
---|
19 | extern "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 | */ |
---|
28 | typedef void (*BSP_output_char_function_type) (char c); |
---|
29 | typedef int (*BSP_polling_getchar_function_type) (void); |
---|
30 | |
---|
31 | extern BSP_output_char_function_type BSP_output_char; |
---|
32 | extern 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 | */ |
---|
52 | extern int getchark(void); |
---|
53 | extern void vprintk(const char *fmt, va_list ap); |
---|
54 | extern void printk(const char *fmt, ...); |
---|
55 | extern void putk(const char *s); |
---|
56 | extern 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 | */ |
---|
66 | extern int printk_plugin(void *context, const char *fmt, ...); |
---|
67 | |
---|
68 | extern 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 | */ |
---|
74 | typedef int (*rtems_printk_plugin_t)(void *, const char *format, ...); |
---|
75 | |
---|
76 | #ifdef __cplusplus |
---|
77 | } |
---|
78 | #endif |
---|
79 | |
---|
80 | #endif |
---|