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