summaryrefslogtreecommitdiff
path: root/arch/x86/boot/boot.h
diff options
context:
space:
mode:
authorPekka Enberg <penberg@cs.helsinki.fi>2010-07-11 11:06:57 +0300
committerH. Peter Anvin <hpa@linux.intel.com>2010-07-12 14:46:00 -0700
commitfa97bdf92709adaaf8b9a5164a895e262a4fcf60 (patch)
treee34f1b6232c302e39065f3dd7ef8bbf4c8ac3d3d /arch/x86/boot/boot.h
parent589643be6693c46fbc54bae77745f336c8ed4bcc (diff)
x86, setup: Early-boot serial I/O support
This patch adds serial I/O support to the real-mode setup (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> LKML-Reference: <1278835617-11368-1-git-send-email-penberg@cs.helsinki.fi> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/boot/boot.h')
-rw-r--r--arch/x86/boot/boot.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/x86/boot/boot.h b/arch/x86/boot/boot.h
index 98239d2658f2..46c4c5c71af7 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")
+
/* 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');
+}
+
/* Heap -- available for dynamic lists. */
extern char _end[];
extern char *HEAP;
@@ -329,10 +342,13 @@ void initregs(struct biosregs *regs);
/* string.c */
int strcmp(const char *str1, const char *str2);
+int strncmp(const char *cs, const char *ct, size_t count);
size_t strnlen(const char *s, size_t maxlen);
unsigned int atou(const char *s);
+unsigned long long simple_strtoull(const char *cp, char **endp, unsigned int base);
/* tty.c */
+void console_init(void);
void puts(const char *);
void putchar(int);
int getchar(void);