diff options
author | Vivek Goyal <vgoyal@in.ibm.com> | 2006-09-20 12:50:08 -0400 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2006-10-06 12:44:15 +0900 |
commit | c1349002068bda5deab1d485b22eecfb8a41d2c1 (patch) | |
tree | 3fdfcc95bedfb70fac60ab5e930dd4ae96804a63 /purgatory | |
parent | 49e72cf7736ac4c219a8f106bff332f2691fabd2 (diff) | |
download | kexec-tools-c1349002068bda5deab1d485b22eecfb8a41d2c1.tar.gz |
kexec-tools: cleanup DEBUG macro usage in code
o Currently DEBUG macro is being used at some places by purgatory code. We
need this DEBUG macro to be defined by user at compile time for including
or excluding the debug code. -DDEBUG is more common practice to use for
this purpose. Hence, changing DEBUG() to DEBUG_CHAR() and make space
for DEBUG to be defined by user.
Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'purgatory')
-rw-r--r-- | purgatory/arch/i386/entry32-16-debug.S | 20 | ||||
-rw-r--r-- | purgatory/arch/i386/include/arch/debug.h | 2 | ||||
-rw-r--r-- | purgatory/arch/i386/linux-entry16.S | 44 | ||||
-rw-r--r-- | purgatory/arch/x86_64/include/arch/debug.h | 2 |
4 files changed, 34 insertions, 34 deletions
diff --git a/purgatory/arch/i386/entry32-16-debug.S b/purgatory/arch/i386/entry32-16-debug.S index fdf70edc..558ac1f9 100644 --- a/purgatory/arch/i386/entry32-16-debug.S +++ b/purgatory/arch/i386/entry32-16-debug.S @@ -55,15 +55,15 @@ entry16_debug: orl %ecx, 0x14 + gdt -DEBUG('a') +DEBUG_CHAR('a') /* Setup the classic BIOS interrupt table at 0x0 */ lidt idtptr -DEBUG('b') +DEBUG_CHAR('b') /* Provide us with 16bit segments that we can use */ lgdt gdt -DEBUG('c') +DEBUG_CHAR('c') /* Note we don't disable the a20 line, (this shouldn't be required) * The code to do it is in kexec_test and it is a real pain. * I will worry about that when I need it. @@ -77,26 +77,26 @@ DEBUG('c') movl %eax, %fs movl %eax, %gs -DEBUG('d') +DEBUG_CHAR('d') /* switch to 16bit mode */ ljmp $0x08, $1f - entry16_debug 1: .code16 -DEBUG('e') +DEBUG_CHAR('e') /* Disable Paging and protected mode */ /* clear the PG & PE bits of CR0 */ movl %cr0,%eax andl $~((1 << 31)|(1<<0)),%eax movl %eax,%cr0 -DEBUG('f') +DEBUG_CHAR('f') /* make intersegment jmp to flush the processor pipeline * and reload %cs:%eip (to clear upper 16 bits of %eip). */ ljmp *(realptr - entry16_debug) 3: -DEBUG('g') +DEBUG_CHAR('g') /* we are in real mode now * set up the real mode segment registers : %ds, $ss, %es */ @@ -104,7 +104,7 @@ DEBUG('g') movw %cs, %ax movw %ax, %ds -DEBUG('h') +DEBUG_CHAR('h') /* Load the registers */ movl eax - entry16_debug, %eax movl ebx - entry16_debug, %ebx @@ -176,7 +176,7 @@ gdt_end: .text entry16_debug_pre32: .code16 -DEBUG('i') +DEBUG_CHAR('i') cli # no interrupts allowed ! movb $0x80, %al # disable NMI for bootup # sequence @@ -186,7 +186,7 @@ DEBUG('i') entry16_debug_first32: .code32 -DEBUG('j') +DEBUG_CHAR('j') .byte 0xb8 /* movl $0x10000, %eax */ entry16_debug_old_first32: .long 0x100000 diff --git a/purgatory/arch/i386/include/arch/debug.h b/purgatory/arch/i386/include/arch/debug.h index 69deaf19..25853cd1 100644 --- a/purgatory/arch/i386/include/arch/debug.h +++ b/purgatory/arch/i386/include/arch/debug.h @@ -311,6 +311,6 @@ TTYS0_TX_AL -#define DEBUG(x) TTYS0_TX_CHAR($x) ; TTYS0_TX_CHAR($'\r') ; TTYS0_TX_CHAR($'\n') +#define DEBUG_CHAR(x) TTYS0_TX_CHAR($x) ; TTYS0_TX_CHAR($'\r') ; TTYS0_TX_CHAR($'\n') #define DEBUG_TX_HEX32(x) TTYS0_TX_HEX32(x); TTYS0_TX_CHAR($'\r') ; TTYS0_TX_CHAR($'\n') #define DEBUG_TX_HEX64(x) TTYS0_TX_HEX64(x); TTYS0_TX_CHAR($'\r') ; TTYS0_TX_CHAR($'\n') diff --git a/purgatory/arch/i386/linux-entry16.S b/purgatory/arch/i386/linux-entry16.S index f366a11f..7ab0b2a3 100644 --- a/purgatory/arch/i386/linux-entry16.S +++ b/purgatory/arch/i386/linux-entry16.S @@ -127,10 +127,10 @@ TTYS0_TX_AL -#define DEBUG(x) TTYS0_TX_CHAR($x) ; TTYS0_TX_CHAR($'\r') ; TTYS0_TX_CHAR($'\n') +#define DEBUG_CHAR(x) TTYS0_TX_CHAR($x) ; TTYS0_TX_CHAR($'\r') ; TTYS0_TX_CHAR($'\n') #define DEBUG_TX_HEX32(x) TTYS0_TX_HEX32(x) ; TTYS0_TX_CHAR($'\r') ; TTYS0_TX_CHAR($'\n') #else -#define DEBUG(x) +#define DEBUG_CHAR(x) #define DEBUG_TX_HEX32(x) #endif @@ -142,15 +142,15 @@ entry16: .code32 -DEBUG('a') +DEBUG_CHAR('a') /* Setup the classic BIOS interrupt table at 0x0 */ lidt idtptr -DEBUG('b') +DEBUG_CHAR('b') /* Provide us with 16bit segments that we can use */ lgdt gdt -DEBUG('c') +DEBUG_CHAR('c') /* Note we don't disable the a20 line, (this shouldn't be required) * The code to do it is in kexec_test and it is a real pain. * I will worry about that when I need it. @@ -164,26 +164,26 @@ DEBUG('c') movl %eax, %fs movl %eax, %gs -DEBUG('d') +DEBUG_CHAR('d') /* switch to 16bit mode */ ljmp $0x08, $1f - entry16 1: .code16 -DEBUG('e') +DEBUG_CHAR('e') /* Disable Paging and protected mode */ /* clear the PG & PE bits of CR0 */ movl %cr0,%eax andl $~((1 << 31)|(1<<0)),%eax movl %eax,%cr0 -DEBUG('f') +DEBUG_CHAR('f') /* make intersegment jmp to flush the processor pipeline * and reload %cs:%eip (to clear upper 16 bits of %eip). */ ljmp *(realptr - entry16) 3: -DEBUG('g') +DEBUG_CHAR('g') /* we are in real mode now * set up the real mode segment registers : %ds, $ss, %es */ @@ -191,7 +191,7 @@ DEBUG('g') movw %cs, %ax movw %ax, %ds -DEBUG('h') +DEBUG_CHAR('h') /* Load the registers */ movl eax - entry16, %eax movl ebx - entry16, %ebx @@ -386,10 +386,10 @@ gdt_end: TTYS0_TX_AL -#define DEBUG(x) TTYS0_TX_CHAR($x) ; TTYS0_TX_CHAR($'\r') ; TTYS0_TX_CHAR($'\n') +#define DEBUG_CHAR(x) TTYS0_TX_CHAR($x) ; TTYS0_TX_CHAR($'\r') ; TTYS0_TX_CHAR($'\n') #define DEBUG_TX_HEX32(x) TTYS0_TX_HEX32(x) ; TTYS0_TX_CHAR($'\r') ; TTYS0_TX_CHAR($'\n') #else -#define DEBUG(x) +#define DEBUG_CHAR(x) #define DEBUG_TX_HEX32(x) #endif @@ -403,7 +403,7 @@ setup16_debug_start: _reloc = . .balign 16 .code32 -DEBUG('a') +DEBUG_CHAR('a') /* Compute where I am running at */ call 1f 1: popl %ebx @@ -412,13 +412,13 @@ DEBUG('a') /* Remember where I am running at */ movl %ebx, location - _reloc(%ebx) -DEBUG('b') +DEBUG_CHAR('b') /* Fixup my real mode segment */ movl %ebx, %eax shrl $4, %eax movw %ax, 2 + realptr - _reloc(%ebx) -DEBUG('c') +DEBUG_CHAR('c') /* Fixup the gdt */ movl %ebx, %eax shll $16, %eax @@ -440,7 +440,7 @@ DEBUG('c') -DEBUG('d') +DEBUG_CHAR('d') /* Setup the classic BIOS interrupt table at 0x0 */ lidt idtptr - _reloc(%ebx) @@ -465,20 +465,20 @@ DEBUG('d') ljmp $0x08, $2f - _reloc 2: .code16 -DEBUG('e') +DEBUG_CHAR('e') /* Disable Paging and protected mode */ /* clear the PG & PE bits of CR0 */ movl %cr0,%eax andl $~((1 << 31)|(1<<0)),%eax movl %eax,%cr0 -DEBUG('f') +DEBUG_CHAR('f') /* make intersegment jmp to flush the processor pipeline * and reload %cs:%eip (to clear upper 16 bits of %eip). */ ljmp *(realptr - _reloc) 3: -DEBUG('g') +DEBUG_CHAR('g') /* we are in real mode now * set up the real mode segment registers : %ds, $ss, %es */ @@ -486,7 +486,7 @@ DEBUG('g') movw %cs, %ax movw %ax, %ds -DEBUG('h') +DEBUG_CHAR('h') /* Load the registers */ movl eax - _reloc, %eax movl ebx - _reloc, %ebx @@ -600,7 +600,7 @@ debug_gdt_end: setup16_debug_kernel_pre_protected: .code16 - DEBUG('i') + DEBUG_CHAR('i') cli # no interrupts allowed ! movb $0x80, %al # disable NMI for bootup # sequence @@ -611,7 +611,7 @@ setup16_debug_first_code32: .byte 0xbf /* movl $0x12345678, %edi */ location: .long 0x12345678 - DEBUG('j') + DEBUG_CHAR('j') .byte 0xb8 /* movl $0x10000, %eax */ setup16_debug_old_code32: .long 0x10000 diff --git a/purgatory/arch/x86_64/include/arch/debug.h b/purgatory/arch/x86_64/include/arch/debug.h index 39f2b16f..e0509420 100644 --- a/purgatory/arch/x86_64/include/arch/debug.h +++ b/purgatory/arch/x86_64/include/arch/debug.h @@ -311,7 +311,7 @@ TTYS0_TX_AL -#define DEBUG(x) TTYS0_TX_CHAR($x) ; TTYS0_TX_CHAR($'\r') ; TTYS0_TX_CHAR($'\n') +#define DEBUG_CHAR(x) TTYS0_TX_CHAR($x) ; TTYS0_TX_CHAR($'\r') ; TTYS0_TX_CHAR($'\n') #define DEBUG_TX_HEX32(x) TTYS0_TX_HEX32(x); TTYS0_TX_CHAR($'\r') ; TTYS0_TX_CHAR($'\n') #define DEBUG_TX_HEX64(x) TTYS0_TX_HEX64(x); TTYS0_TX_CHAR($'\r') ; TTYS0_TX_CHAR($'\n') |