aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/boot/boot.h
diff options
context:
space:
mode:
authorPekka Enberg <penberg@cs.helsinki.fi>2010-07-11 04:06:57 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2010-07-12 17:46:00 -0400
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 @@
37extern struct setup_header hdr; 37extern struct setup_header hdr;
38extern struct boot_params boot_params; 38extern struct boot_params boot_params;
39 39
40#define cpu_relax() asm volatile("rep; nop")
41
40/* Basic port I/O */ 42/* Basic port I/O */
41static inline void outb(u8 v, u16 port) 43static inline void outb(u8 v, u16 port)
42{ 44{
@@ -203,6 +205,17 @@ static inline int isdigit(int ch)
203 return (ch >= '0') && (ch <= '9'); 205 return (ch >= '0') && (ch <= '9');
204} 206}
205 207
208static inline int isxdigit(int ch)
209{
210 if (isdigit(ch))
211 return true;
212
213 if ((ch >= 'a') && (ch <= 'f'))
214 return true;
215
216 return (ch >= 'A') && (ch <= 'F');
217}
218
206/* Heap -- available for dynamic lists. */ 219/* Heap -- available for dynamic lists. */
207extern char _end[]; 220extern char _end[];
208extern char *HEAP; 221extern char *HEAP;
@@ -329,10 +342,13 @@ void initregs(struct biosregs *regs);
329 342
330/* string.c */ 343/* string.c */
331int strcmp(const char *str1, const char *str2); 344int strcmp(const char *str1, const char *str2);
345int strncmp(const char *cs, const char *ct, size_t count);
332size_t strnlen(const char *s, size_t maxlen); 346size_t strnlen(const char *s, size_t maxlen);
333unsigned int atou(const char *s); 347unsigned int atou(const char *s);
348unsigned long long simple_strtoull(const char *cp, char **endp, unsigned int base);
334 349
335/* tty.c */ 350/* tty.c */
351void console_init(void);
336void puts(const char *); 352void puts(const char *);
337void putchar(int); 353void putchar(int);
338int getchar(void); 354int getchar(void);