2008-09-22 Joel Sherrill <joel.sherrill@oarcorp.com>

* include/rtems/bspIo.h, libcsupport/Makefile.am: Add genchark() for
	polled debug input from the same device as printk().
	* libcsupport/src/getchark.c: New file.
This commit is contained in:
Joel Sherrill
2008-09-22 21:47:04 +00:00
parent 0fbd231001
commit 23c3f72e4d
4 changed files with 45 additions and 2 deletions

View File

@@ -1,3 +1,9 @@
2008-09-22 Joel Sherrill <joel.sherrill@oarcorp.com>
* include/rtems/bspIo.h, libcsupport/Makefile.am: Add genchark() for
polled debug input from the same device as printk().
* libcsupport/src/getchark.c: New file.
2008-09-22 Ralf Corsépius <ralf.corsepius@rtems.org>
* aclocal/version.m4: Bump RTEMS_API to 4.10.

View File

@@ -25,7 +25,7 @@ extern "C" {
* functionnality described after the next command.
*/
typedef void (*BSP_output_char_function_type) (char c);
typedef char (*BSP_polling_getchar_function_type) (void);
typedef int (*BSP_polling_getchar_function_type) (void);
extern BSP_output_char_function_type BSP_output_char;
extern BSP_polling_getchar_function_type BSP_poll_char;
@@ -38,6 +38,17 @@ extern BSP_polling_getchar_function_type BSP_poll_char;
*/
#include <stdarg.h>
/**
* This method polls for a key in the simplest possible fashion
* from whatever the debug console device is.
*
* @return If a character is available, it is returned. Otherwise
* this method returns -1.
*
* @note This method uses the BSP_poll_char pointer to a BSP
* provided method.
*/
extern int getchark(void);
extern void vprintk(const char *fmt, va_list ap);
extern void printk(const char *fmt, ...);

View File

@@ -99,7 +99,8 @@ LIBC_GLUE_C_FILES = src/__getpid.c src/__gettod.c src/__times.c \
BSD_LIBC_C_FILES = src/strlcpy.c src/strlcat.c
libcsupport_a_SOURCES = src/gxx_wrappers.c src/printk.c src/printk_plugin.c \
libcsupport_a_SOURCES = src/gxx_wrappers.c src/getchark.c src/printk.c \
src/printk_plugin.c \
$(BSD_LIBC_C_FILES) $(BASE_FS_C_FILES) $(MALLOC_C_FILES) \
$(ERROR_C_FILES) $(ASSOCIATION_C_FILES)

View File

@@ -0,0 +1,25 @@
/*
* COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*
* $Id$
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif
#include <rtems.h>
#include <rtems/bspIo.h>
int getchark(void)
{
if ( BSP_poll_char )
return (*BSP_poll_char)();
return -1;
}