From: Andrew Cooper Date: Fri, 30 Nov 2012 09:37:13 +0000 (+0000) Subject: minios/console: console_input() weak reference X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=e0d99723c46afe6d3d26dce107403ceb716e7183;p=people%2Fliuw%2Flibxenctrl-split%2Fmini-os.git minios/console: console_input() weak reference In exactly the same style as app_main() in kernel.c, create a weak reference console_input() function for applications to override to quickly gain access to the console. Signed-off-by: Andrew Cooper Acked-by: Samuel Thibault Committed-by: Keir Fraser --- diff --git a/console/console.c b/console/console.c index fec3791..380f53c 100644 --- a/console/console.c +++ b/console/console.c @@ -54,9 +54,7 @@ NOTE: you need to enable verbose in xen/Rules.mk for it to work. */ static int console_initialised = 0; - -#ifndef HAVE_LIBC -void xencons_rx(char *buf, unsigned len, struct pt_regs *regs) +__attribute__((weak)) void console_input(char * buf, unsigned len) { if(len > 0) { @@ -69,6 +67,12 @@ void xencons_rx(char *buf, unsigned len, struct pt_regs *regs) } } +#ifndef HAVE_LIBC +void xencons_rx(char *buf, unsigned len, struct pt_regs *regs) +{ + console_input(buf, len); +} + void xencons_tx(void) { /* Do nothing, handled by _rx */