[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100710210750.GC6615@lenovo>
Date: Sun, 11 Jul 2010 01:07:50 +0400
From: Cyrill Gorcunov <gorcunov@...il.com>
To: Pekka Enberg <penberg@...helsinki.fi>
Cc: hpa@...or.com, x86@...nel.org, linux-kernel@...r.kernel.org,
Ingo Molnar <mingo@...hat.com>, Yinghai Lu <yinghai@...nel.org>
Subject: Re: [PATCH v2] x86: Early-boot serial I/O support
On Sat, Jul 10, 2010 at 10:40:20PM +0300, Pekka Enberg wrote:
> This patch adds serial I/O support to very early boot printf(). It's useful for
> debugging boot code when running Linux under KVM, for example. The actual code
> was lifted from early printk.
>
> Cc: Cyrill Gorcunov <gorcunov@...il.com>
> Cc: Ingo Molnar <mingo@...hat.com>
> Cc: Yinghai Lu <yinghai@...nel.org>
> Signed-off-by: Pekka Enberg <penberg@...helsinki.fi>
> ---
> v1 -> v2:
>
> - Use 'earlyprintk' kernel parameter to determine whether to use
> early serial or not as suggested by Yinghai and hpa.
>
> arch/x86/boot/boot.h | 16 +++++++
> arch/x86/boot/main.c | 3 +
> arch/x86/boot/string.c | 41 ++++++++++++++++++
> arch/x86/boot/tty.c | 111 +++++++++++++++++++++++++++++++++++++++++++++---
> 4 files changed, 165 insertions(+), 6 deletions(-)
>
> diff --git a/arch/x86/boot/boot.h b/arch/x86/boot/boot.h
> index 98239d2..f05b5ac 100644
> --- a/arch/x86/boot/boot.h
> +++ b/arch/x86/boot/boot.h
> @@ -37,6 +37,8 @@
> extern struct setup_header hdr;
> extern struct boot_params boot_params;
>
> +#define cpu_relax() asm volatile("rep; nop" ::: "memory")
> +
> /* Basic port I/O */
> static inline void outb(u8 v, u16 port)
> {
> @@ -203,6 +205,17 @@ static inline int isdigit(int ch)
> return (ch >= '0') && (ch <= '9');
> }
>
> +static inline int isxdigit(int ch)
> +{
> + if (isdigit(ch))
> + return true;
> +
> + if ((ch >= 'a') && (ch <= 'f'))
> + return true;
> +
> + return (ch >= 'A') && (ch <= 'F');
> +}
> +
I suspect it's supposed to be static inline *bool*, right?
-- Cyrill
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists