diff options
author | Paul Mackerras <paulus@samba.org> | 2008-01-30 19:25:51 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-01-30 19:25:51 -0500 |
commit | bd45ac0c5daae35e7c71138172e63df5cf644cf6 (patch) | |
tree | 5eb5a599bf6a9d7a8a34e802db932aa9e9555de4 /arch/x86/boot/main.c | |
parent | 4eece4ccf997c0e6d8fdad3d842e37b16b8d705f (diff) | |
parent | 5bdeae46be6dfe9efa44a548bd622af325f4bdb4 (diff) |
Merge branch 'linux-2.6'
Diffstat (limited to 'arch/x86/boot/main.c')
-rw-r--r-- | arch/x86/boot/main.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/arch/x86/boot/main.c b/arch/x86/boot/main.c index 1f95750ede28..7828da5cfd07 100644 --- a/arch/x86/boot/main.c +++ b/arch/x86/boot/main.c | |||
@@ -100,20 +100,32 @@ static void set_bios_mode(void) | |||
100 | #endif | 100 | #endif |
101 | } | 101 | } |
102 | 102 | ||
103 | void main(void) | 103 | static void init_heap(void) |
104 | { | 104 | { |
105 | /* First, copy the boot header into the "zeropage" */ | 105 | char *stack_end; |
106 | copy_boot_params(); | ||
107 | 106 | ||
108 | /* End of heap check */ | ||
109 | if (boot_params.hdr.loadflags & CAN_USE_HEAP) { | 107 | if (boot_params.hdr.loadflags & CAN_USE_HEAP) { |
110 | heap_end = (char *)(boot_params.hdr.heap_end_ptr | 108 | asm("leal %P1(%%esp),%0" |
111 | +0x200-STACK_SIZE); | 109 | : "=r" (stack_end) : "i" (-STACK_SIZE)); |
110 | |||
111 | heap_end = (char *) | ||
112 | ((size_t)boot_params.hdr.heap_end_ptr + 0x200); | ||
113 | if (heap_end > stack_end) | ||
114 | heap_end = stack_end; | ||
112 | } else { | 115 | } else { |
113 | /* Boot protocol 2.00 only, no heap available */ | 116 | /* Boot protocol 2.00 only, no heap available */ |
114 | puts("WARNING: Ancient bootloader, some functionality " | 117 | puts("WARNING: Ancient bootloader, some functionality " |
115 | "may be limited!\n"); | 118 | "may be limited!\n"); |
116 | } | 119 | } |
120 | } | ||
121 | |||
122 | void main(void) | ||
123 | { | ||
124 | /* First, copy the boot header into the "zeropage" */ | ||
125 | copy_boot_params(); | ||
126 | |||
127 | /* End of heap check */ | ||
128 | init_heap(); | ||
117 | 129 | ||
118 | /* Make sure we have all the proper CPU support */ | 130 | /* Make sure we have all the proper CPU support */ |
119 | if (validate_cpu()) { | 131 | if (validate_cpu()) { |
@@ -131,9 +143,6 @@ void main(void) | |||
131 | /* Set keyboard repeat rate (why?) */ | 143 | /* Set keyboard repeat rate (why?) */ |
132 | keyboard_set_repeat(); | 144 | keyboard_set_repeat(); |
133 | 145 | ||
134 | /* Set the video mode */ | ||
135 | set_video(); | ||
136 | |||
137 | /* Query MCA information */ | 146 | /* Query MCA information */ |
138 | query_mca(); | 147 | query_mca(); |
139 | 148 | ||
@@ -154,6 +163,10 @@ void main(void) | |||
154 | #if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE) | 163 | #if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE) |
155 | query_edd(); | 164 | query_edd(); |
156 | #endif | 165 | #endif |
166 | |||
167 | /* Set the video mode */ | ||
168 | set_video(); | ||
169 | |||
157 | /* Do the last things and invoke protected mode */ | 170 | /* Do the last things and invoke protected mode */ |
158 | go_to_protected_mode(); | 171 | go_to_protected_mode(); |
159 | } | 172 | } |