diff options
author | Ryan S. Arnold <rsa@us.ibm.com> | 2006-03-27 19:25:16 (GMT) |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-03-28 05:45:26 (GMT) |
commit | 45d607ed92695d7543f5e1fc5b133cd69834e3e4 (patch) | |
tree | c82b6ae1f9b9827894021797a85cbcbe6efca08e /drivers/char/hvc_vio.c | |
parent | 11089f08d9dd8b89cd07d6f126ccb4849e3c61a3 (diff) | |
download | linux-fsl-qoriq-45d607ed92695d7543f5e1fc5b133cd69834e3e4.tar.xz |
[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" <rsa@us.ibm.com>
Signed-off-by: Arnd Bergmann <abergman@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'drivers/char/hvc_vio.c')
-rw-r--r-- | drivers/char/hvc_vio.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/char/hvc_vio.c b/drivers/char/hvc_vio.c index f5212eb..9add81ce 100644 --- a/drivers/char/hvc_vio.c +++ b/drivers/char/hvc_vio.c @@ -31,10 +31,13 @@ #include <linux/types.h> #include <linux/init.h> + #include <asm/hvconsole.h> #include <asm/vio.h> #include <asm/prom.h> +#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); /* |