Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 145686
b: refs/heads/master
c: 36d3793
h: refs/heads/master
v: v3
  • Loading branch information
H. Peter Anvin committed May 9, 2009
1 parent b7aac8b commit f4b130b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 97541912785369925723b6255438ad9fce2ddf04
refs/heads/master: 36d3793c947f1ef7ba3d24eeeddc1be41adc5ab4
11 changes: 6 additions & 5 deletions trunk/arch/x86/boot/compressed/head_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,12 @@ ENTRY(startup_32)
* where decompression in place becomes safe.
*/
pushl %esi
leal _bss(%ebp), %esi
leal _bss(%ebx), %edi
leal (_bss-4)(%ebp), %esi
leal (_bss-4)(%ebx), %edi
movl $(_bss - startup_32), %ecx
shrl $2, %ecx
std
rep movsb
rep movsl
cld
popl %esi

Expand Down Expand Up @@ -135,8 +136,8 @@ relocated:
leal _bss(%ebx), %edi
leal _ebss(%ebx), %ecx
subl %edi, %ecx
cld
rep stosb
shrl $2, %ecx
rep stosl

/*
* Do the decompression, and jump to the new kernel..
Expand Down
26 changes: 13 additions & 13 deletions trunk/arch/x86/boot/compressed/head_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -260,15 +260,15 @@ ENTRY(startup_64)
* Copy the compressed kernel to the end of our buffer
* where decompression in place becomes safe.
*/
leaq _bss(%rip), %r8
leaq _bss(%rbx), %r9
pushq %rsi
leaq (_bss-8)(%rip), %rsi
leaq (_bss-8)(%rbx), %rdi
movq $_bss /* - $startup_32 */, %rcx
1: subq $8, %r8
subq $8, %r9
movq 0(%r8), %rax
movq %rax, 0(%r9)
subq $8, %rcx
jnz 1b
shrq $3, %rcx
std
rep movsq
cld
popq %rsi

/*
* Jump to the relocated address.
Expand All @@ -282,12 +282,12 @@ relocated:
/*
* Clear BSS (stack is currently empty)
*/
xorq %rax, %rax
leaq _bss(%rbx), %rdi
leaq _ebss(%rbx), %rcx
xorl %eax, %eax
leaq _bss(%rip), %rdi
leaq _ebss(%rip), %rcx
subq %rdi, %rcx
cld
rep stosb
shrq $3, %rcx
rep stosq

/*
* Do the decompression, and jump to the new kernel..
Expand Down

0 comments on commit f4b130b

Please sign in to comment.