Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90976
b: refs/heads/master
c: 7c53976
h: refs/heads/master
v: v3
  • Loading branch information
Alexander van Heukelum authored and Ingo Molnar committed Apr 19, 2008
1 parent d5b7a63 commit b1283c8
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 23 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: 4c8337ac425b220594fec45ad6d3ac76d3ce2b90
refs/heads/master: 7c53976404e2f906c60b69cc5793add87ee49c6a
15 changes: 9 additions & 6 deletions trunk/arch/x86/boot/compressed/head_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ relocated:
/*
* Setup the stack for the decompressor
*/
leal stack_end(%ebx), %esp
leal boot_stack_end(%ebx), %esp

/*
* Do the decompression, and jump to the new kernel..
Expand All @@ -142,8 +142,8 @@ relocated:
pushl %eax # input_len
leal input_data(%ebx), %eax
pushl %eax # input_data
leal _end(%ebx), %eax
pushl %eax # end of the image as third argument
leal boot_heap(%ebx), %eax
pushl %eax # heap area as third argument
pushl %esi # real mode pointer as second arg
call decompress_kernel
addl $20, %esp
Expand Down Expand Up @@ -181,7 +181,10 @@ relocated:
jmp *%ebp

.bss
/* Stack and heap for uncompression */
.balign 4
stack:
.fill 4096, 1, 0
stack_end:
boot_heap:
.fill BOOT_HEAP_SIZE, 1, 0
boot_stack:
.fill BOOT_STACK_SIZE, 1, 0
boot_stack_end:
22 changes: 13 additions & 9 deletions trunk/arch/x86/boot/compressed/head_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <asm/segment.h>
#include <asm/pgtable.h>
#include <asm/page.h>
#include <asm/boot.h>
#include <asm/msr.h>
#include <asm/asm-offsets.h>

Expand Down Expand Up @@ -62,7 +63,7 @@ startup_32:
subl $1b, %ebp

/* setup a stack and make sure cpu supports long mode. */
movl $user_stack_end, %eax
movl $boot_stack_end, %eax
addl %ebp, %eax
movl %eax, %esp

Expand Down Expand Up @@ -274,7 +275,7 @@ relocated:
stosb

/* Setup the stack */
leaq user_stack_end(%rip), %rsp
leaq boot_stack_end(%rip), %rsp

/* zero EFLAGS after setting rsp */
pushq $0
Expand All @@ -285,7 +286,7 @@ relocated:
*/
pushq %rsi # Save the real mode argument
movq %rsi, %rdi # real mode address
leaq _heap(%rip), %rsi # _heap
leaq boot_heap(%rip), %rsi # malloc area for uncompression
leaq input_data(%rip), %rdx # input_data
movl input_len(%rip), %eax
movq %rax, %rcx # input_len
Expand All @@ -310,9 +311,12 @@ gdt:
.quad 0x0080890000000000 /* TS descriptor */
.quad 0x0000000000000000 /* TS continued */
gdt_end:
.bss
/* Stack for uncompression */
.balign 4
user_stack:
.fill 4096,4,0
user_stack_end:

.bss
/* Stack and heap for uncompression */
.balign 4
boot_heap:
.fill BOOT_HEAP_SIZE, 1, 0
boot_stack:
.fill BOOT_STACK_SIZE, 1, 0
boot_stack_end:
8 changes: 1 addition & 7 deletions trunk/arch/x86/boot/compressed/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,6 @@ static void putstr(const char *);
static memptr free_mem_ptr;
static memptr free_mem_end_ptr;

#ifdef CONFIG_X86_64
#define HEAP_SIZE 0x7000
#else
#define HEAP_SIZE 0x4000
#endif

static char *vidmem;
static int vidport;
static int lines, cols;
Expand Down Expand Up @@ -449,7 +443,7 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap,

window = output; /* Output buffer (Normally at 1M) */
free_mem_ptr = heap; /* Heap */
free_mem_end_ptr = heap + HEAP_SIZE;
free_mem_end_ptr = heap + BOOT_HEAP_SIZE;
inbuf = input_data; /* Input buffer */
insize = input_len;
inptr = 0;
Expand Down
8 changes: 8 additions & 0 deletions trunk/include/asm-x86/boot.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,12 @@
+ (CONFIG_PHYSICAL_ALIGN - 1)) \
& ~(CONFIG_PHYSICAL_ALIGN - 1))

#ifdef CONFIG_X86_64
#define BOOT_HEAP_SIZE 0x7000
#define BOOT_STACK_SIZE 0x4000
#else
#define BOOT_HEAP_SIZE 0x4000
#define BOOT_STACK_SIZE 0x1000
#endif

#endif /* _ASM_BOOT_H */

0 comments on commit b1283c8

Please sign in to comment.