From 45d607ed92695d7543f5e1fc5b133cd69834e3e4 Mon Sep 17 00:00:00 2001 From: "Ryan S. Arnold" Date: Mon, 27 Mar 2006 21:25:16 +0200 Subject: [PATCH] powerpc: hvc_console updates These are some updates from both Ryan and Arnd for the hvc_console driver: The main point is to enable the inclusion of a console driver for rtas, which is currrently needed for the cell platform. Also shuffle around some data-type declarations and moves some functions out of include/asm-ppc64/hvconsole.h and into a new drivers/char/hvc_console.h file. Signed-off-by: "Ryan S. Arnold" Signed-off-by: Arnd Bergmann Signed-off-by: Paul Mackerras --- drivers/char/hvc_vio.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'drivers/char/hvc_vio.c') diff --git a/drivers/char/hvc_vio.c b/drivers/char/hvc_vio.c index f5212eb2b41..9add81ceb44 100644 --- a/drivers/char/hvc_vio.c +++ b/drivers/char/hvc_vio.c @@ -31,10 +31,13 @@ #include #include + #include #include #include +#include "hvc_console.h" + char hvc_driver_name[] = "hvc_console"; static struct vio_device_id hvc_driver_table[] __devinitdata = { @@ -48,6 +51,14 @@ static int filtered_get_chars(uint32_t vtermno, char *buf, int count) unsigned long got; int i; + /* + * Vio firmware will read up to SIZE_VIO_GET_CHARS at its own discretion + * so we play safe and avoid the situation where got > count which could + * overload the flip buffer. + */ + if (count < SIZE_VIO_GET_CHARS) + return -EAGAIN; + got = hvc_get_chars(vtermno, buf, count); /* -- cgit v1.2.3