forked from Minki/linux
x86, boot: stylistic cleanups for boot/compressed/head_32.S
Reformat arch/x86/boot/compressed/head_32.S to be closer to currently preferred kernel assembly style, that is: - opcode and operand separated by tab - operands separated by ", " - C-style comments This also makes it more similar to head_64.S. [ Impact: cleanup, no object code change ] Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
parent
bd2a36984c
commit
5f64ec64e7
|
@ -21,7 +21,7 @@
|
||||||
/*
|
/*
|
||||||
* High loaded stuff by Hans Lermen & Werner Almesberger, Feb. 1996
|
* High loaded stuff by Hans Lermen & Werner Almesberger, Feb. 1996
|
||||||
*/
|
*/
|
||||||
.text
|
.text
|
||||||
|
|
||||||
#include <linux/linkage.h>
|
#include <linux/linkage.h>
|
||||||
#include <asm/segment.h>
|
#include <asm/segment.h>
|
||||||
|
@ -29,24 +29,27 @@
|
||||||
#include <asm/boot.h>
|
#include <asm/boot.h>
|
||||||
#include <asm/asm-offsets.h>
|
#include <asm/asm-offsets.h>
|
||||||
|
|
||||||
.section ".text.head","ax",@progbits
|
.section ".text.head","ax",@progbits
|
||||||
ENTRY(startup_32)
|
ENTRY(startup_32)
|
||||||
cld
|
cld
|
||||||
/* test KEEP_SEGMENTS flag to see if the bootloader is asking
|
/*
|
||||||
* us to not reload segments */
|
* Test KEEP_SEGMENTS flag to see if the bootloader is asking
|
||||||
|
* us to not reload segments
|
||||||
|
*/
|
||||||
testb $(1<<6), BP_loadflags(%esi)
|
testb $(1<<6), BP_loadflags(%esi)
|
||||||
jnz 1f
|
jnz 1f
|
||||||
|
|
||||||
cli
|
cli
|
||||||
movl $(__BOOT_DS),%eax
|
movl $__BOOT_DS, %eax
|
||||||
movl %eax,%ds
|
movl %eax, %ds
|
||||||
movl %eax,%es
|
movl %eax, %es
|
||||||
movl %eax,%fs
|
movl %eax, %fs
|
||||||
movl %eax,%gs
|
movl %eax, %gs
|
||||||
movl %eax,%ss
|
movl %eax, %ss
|
||||||
1:
|
1:
|
||||||
|
|
||||||
/* Calculate the delta between where we were compiled to run
|
/*
|
||||||
|
* Calculate the delta between where we were compiled to run
|
||||||
* at and where we were actually loaded at. This can only be done
|
* at and where we were actually loaded at. This can only be done
|
||||||
* with a short local call on x86. Nothing else will tell us what
|
* with a short local call on x86. Nothing else will tell us what
|
||||||
* address we are running at. The reserved chunk of the real-mode
|
* address we are running at. The reserved chunk of the real-mode
|
||||||
|
@ -58,7 +61,8 @@ ENTRY(startup_32)
|
||||||
1: popl %ebp
|
1: popl %ebp
|
||||||
subl $1b, %ebp
|
subl $1b, %ebp
|
||||||
|
|
||||||
/* %ebp contains the address we are loaded at by the boot loader and %ebx
|
/*
|
||||||
|
* %ebp contains the address we are loaded at by the boot loader and %ebx
|
||||||
* contains the address where we should move the kernel image temporarily
|
* contains the address where we should move the kernel image temporarily
|
||||||
* for safe in-place decompression.
|
* for safe in-place decompression.
|
||||||
*/
|
*/
|
||||||
|
@ -84,7 +88,8 @@ ENTRY(startup_32)
|
||||||
addl $4095, %ebx
|
addl $4095, %ebx
|
||||||
andl $~4095, %ebx
|
andl $~4095, %ebx
|
||||||
|
|
||||||
/* Copy the compressed kernel to the end of our buffer
|
/*
|
||||||
|
* Copy the compressed kernel to the end of our buffer
|
||||||
* where decompression in place becomes safe.
|
* where decompression in place becomes safe.
|
||||||
*/
|
*/
|
||||||
pushl %esi
|
pushl %esi
|
||||||
|
@ -92,12 +97,12 @@ ENTRY(startup_32)
|
||||||
leal _ebss(%ebx), %edi
|
leal _ebss(%ebx), %edi
|
||||||
movl $(_ebss - startup_32), %ecx
|
movl $(_ebss - startup_32), %ecx
|
||||||
std
|
std
|
||||||
rep
|
rep movsb
|
||||||
movsb
|
|
||||||
cld
|
cld
|
||||||
popl %esi
|
popl %esi
|
||||||
|
|
||||||
/* Compute the kernel start address.
|
/*
|
||||||
|
* Compute the kernel start address.
|
||||||
*/
|
*/
|
||||||
#ifdef CONFIG_RELOCATABLE
|
#ifdef CONFIG_RELOCATABLE
|
||||||
addl $(CONFIG_PHYSICAL_ALIGN - 1), %ebp
|
addl $(CONFIG_PHYSICAL_ALIGN - 1), %ebp
|
||||||
|
@ -113,19 +118,18 @@ ENTRY(startup_32)
|
||||||
jmp *%eax
|
jmp *%eax
|
||||||
ENDPROC(startup_32)
|
ENDPROC(startup_32)
|
||||||
|
|
||||||
.section ".text"
|
.text
|
||||||
relocated:
|
relocated:
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Clear BSS
|
* Clear BSS
|
||||||
*/
|
*/
|
||||||
xorl %eax,%eax
|
xorl %eax, %eax
|
||||||
leal _edata(%ebx),%edi
|
leal _edata(%ebx), %edi
|
||||||
leal _ebss(%ebx), %ecx
|
leal _ebss(%ebx), %ecx
|
||||||
subl %edi,%ecx
|
subl %edi, %ecx
|
||||||
cld
|
cld
|
||||||
rep
|
rep stosb
|
||||||
stosb
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Setup the stack for the decompressor
|
* Setup the stack for the decompressor
|
||||||
|
@ -137,26 +141,28 @@ relocated:
|
||||||
*/
|
*/
|
||||||
movl output_len(%ebx), %eax
|
movl output_len(%ebx), %eax
|
||||||
pushl %eax
|
pushl %eax
|
||||||
# push arguments for decompress_kernel:
|
/* push arguments for decompress_kernel: */
|
||||||
pushl %ebp # output address
|
pushl %ebp /* output address */
|
||||||
movl input_len(%ebx), %eax
|
movl input_len(%ebx), %eax
|
||||||
pushl %eax # input_len
|
pushl %eax /* input_len */
|
||||||
leal input_data(%ebx), %eax
|
leal input_data(%ebx), %eax
|
||||||
pushl %eax # input_data
|
pushl %eax /* input_data */
|
||||||
leal boot_heap(%ebx), %eax
|
leal boot_heap(%ebx), %eax
|
||||||
pushl %eax # heap area
|
pushl %eax /* heap area */
|
||||||
pushl %esi # real mode pointer
|
pushl %esi /* real mode pointer */
|
||||||
call decompress_kernel
|
call decompress_kernel
|
||||||
addl $20, %esp
|
addl $20, %esp
|
||||||
popl %ecx
|
popl %ecx
|
||||||
|
|
||||||
#if CONFIG_RELOCATABLE
|
#if CONFIG_RELOCATABLE
|
||||||
/* Find the address of the relocations.
|
/*
|
||||||
|
* Find the address of the relocations.
|
||||||
*/
|
*/
|
||||||
movl %ebp, %edi
|
movl %ebp, %edi
|
||||||
addl %ecx, %edi
|
addl %ecx, %edi
|
||||||
|
|
||||||
/* Calculate the delta between where vmlinux was compiled to run
|
/*
|
||||||
|
* Calculate the delta between where vmlinux was compiled to run
|
||||||
* and where it was actually loaded.
|
* and where it was actually loaded.
|
||||||
*/
|
*/
|
||||||
movl %ebp, %ebx
|
movl %ebp, %ebx
|
||||||
|
@ -167,7 +173,7 @@ relocated:
|
||||||
*/
|
*/
|
||||||
|
|
||||||
1: subl $4, %edi
|
1: subl $4, %edi
|
||||||
movl 0(%edi), %ecx
|
movl (%edi), %ecx
|
||||||
testl %ecx, %ecx
|
testl %ecx, %ecx
|
||||||
jz 2f
|
jz 2f
|
||||||
addl %ebx, -__PAGE_OFFSET(%ebx, %ecx)
|
addl %ebx, -__PAGE_OFFSET(%ebx, %ecx)
|
||||||
|
@ -178,12 +184,14 @@ relocated:
|
||||||
/*
|
/*
|
||||||
* Jump to the decompressed kernel.
|
* Jump to the decompressed kernel.
|
||||||
*/
|
*/
|
||||||
xorl %ebx,%ebx
|
xorl %ebx, %ebx
|
||||||
jmp *%ebp
|
jmp *%ebp
|
||||||
|
|
||||||
.bss
|
/*
|
||||||
/* Stack and heap for uncompression */
|
* Stack and heap for uncompression
|
||||||
.balign 4
|
*/
|
||||||
|
.bss
|
||||||
|
.balign 4
|
||||||
boot_heap:
|
boot_heap:
|
||||||
.fill BOOT_HEAP_SIZE, 1, 0
|
.fill BOOT_HEAP_SIZE, 1, 0
|
||||||
boot_stack:
|
boot_stack:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user