Messages in this thread | | | Date | Sun, 11 Jul 2010 01:07:50 +0400 | From | Cyrill Gorcunov <> | 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@gmail.com> > Cc: Ingo Molnar <mingo@redhat.com> > Cc: Yinghai Lu <yinghai@kernel.org> > Signed-off-by: Pekka Enberg <penberg@cs.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
| |