diff options
author | Pekka Enberg <penberg@cs.helsinki.fi> | 2010-07-11 04:06:57 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2010-07-12 17:46:00 -0400 |
commit | fa97bdf92709adaaf8b9a5164a895e262a4fcf60 (patch) | |
tree | e34f1b6232c302e39065f3dd7ef8bbf4c8ac3d3d /arch/x86/boot/boot.h | |
parent | 589643be6693c46fbc54bae77745f336c8ed4bcc (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.h | 16 |
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 @@ | |||
37 | extern struct setup_header hdr; | 37 | extern struct setup_header hdr; |
38 | extern struct boot_params boot_params; | 38 | extern 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 */ |
41 | static inline void outb(u8 v, u16 port) | 43 | static 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 | ||
208 | static 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. */ |
207 | extern char _end[]; | 220 | extern char _end[]; |
208 | extern char *HEAP; | 221 | extern char *HEAP; |
@@ -329,10 +342,13 @@ void initregs(struct biosregs *regs); | |||
329 | 342 | ||
330 | /* string.c */ | 343 | /* string.c */ |
331 | int strcmp(const char *str1, const char *str2); | 344 | int strcmp(const char *str1, const char *str2); |
345 | int strncmp(const char *cs, const char *ct, size_t count); | ||
332 | size_t strnlen(const char *s, size_t maxlen); | 346 | size_t strnlen(const char *s, size_t maxlen); |
333 | unsigned int atou(const char *s); | 347 | unsigned int atou(const char *s); |
348 | unsigned long long simple_strtoull(const char *cp, char **endp, unsigned int base); | ||
334 | 349 | ||
335 | /* tty.c */ | 350 | /* tty.c */ |
351 | void console_init(void); | ||
336 | void puts(const char *); | 352 | void puts(const char *); |
337 | void putchar(int); | 353 | void putchar(int); |
338 | int getchar(void); | 354 | int getchar(void); |