blob: b0c0d16ef58d1099342c97aff83767dd35c73691 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * linux/boot/head.S
3 *
4 * Copyright (C) 1991, 1992, 1993 Linus Torvalds
Linus Torvalds1da177e2005-04-16 15:20:36 -07005 */
6
7/*
8 * head.S contains the 32-bit startup code.
9 *
10 * NOTE!!! Startup happens at absolute address 0x00001000, which is also where
11 * the page directory will exist. The startup code will be overwritten by
12 * the page directory. [According to comments etc elsewhere on a compressed
13 * kernel it will end up at 0x1000 + 1Mb I hope so as I assume this. - AC]
14 *
15 * Page 0 is deliberately kept safe, since System Management Mode code in
16 * laptops may need to access the BIOS data stored there. This is also
17 * useful for future device drivers that either access the BIOS via VM86
18 * mode.
19 */
20
21/*
Domen Puncerf4549442005-06-25 14:58:59 -070022 * High loaded stuff by Hans Lermen & Werner Almesberger, Feb. 1996
Linus Torvalds1da177e2005-04-16 15:20:36 -070023 */
H. Peter Anvinb40d68d2009-05-08 15:59:13 -070024 .code32
25 .text
Linus Torvalds1da177e2005-04-16 15:20:36 -070026
Tim Abbott1dc818c2009-09-16 16:44:27 -040027#include <linux/init.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070028#include <linux/linkage.h>
29#include <asm/segment.h>
Alexander van Heukelum7c539762008-04-08 12:54:30 +020030#include <asm/boot.h>
Vivek Goyal1ab60e02007-05-02 19:27:07 +020031#include <asm/msr.h>
Cyrill Gorcunove83e31f42008-05-12 15:43:39 +020032#include <asm/processor-flags.h>
Eric W. Biedermanbd531472007-10-26 11:29:04 -060033#include <asm/asm-offsets.h>
Alexander Kuleshovfb148d82015-02-19 13:34:58 +060034#include <asm/bootparam.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070035
Tim Abbott1dc818c2009-09-16 16:44:27 -040036 __HEAD
Linus Torvalds1da177e2005-04-16 15:20:36 -070037 .code32
Cyrill Gorcunov2d4eeecb2009-02-14 00:50:22 +030038ENTRY(startup_32)
Yinghai Lu8ee2f2d2013-01-24 12:20:07 -080039 /*
40 * 32bit entry is 0 and it is ABI so immutable!
41 * If we come here directly from a bootloader,
42 * kernel(text+data+bss+brk) ramdisk, zero_page, command line
43 * all need to be under the 4G limit.
44 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070045 cld
H. Peter Anvinb40d68d2009-05-08 15:59:13 -070046 /*
47 * Test KEEP_SEGMENTS flag to see if the bootloader is asking
48 * us to not reload segments
49 */
Alexander Kuleshovfb148d82015-02-19 13:34:58 +060050 testb $KEEP_SEGMENTS, BP_loadflags(%esi)
Eric W. Biedermanbd531472007-10-26 11:29:04 -060051 jnz 1f
52
Linus Torvalds1da177e2005-04-16 15:20:36 -070053 cli
Lans Zhang2dead152013-03-01 09:20:39 +080054 movl $(__BOOT_DS), %eax
Vivek Goyal1ab60e02007-05-02 19:27:07 +020055 movl %eax, %ds
56 movl %eax, %es
57 movl %eax, %ss
Eric W. Biedermanbd531472007-10-26 11:29:04 -0600581:
Linus Torvalds1da177e2005-04-16 15:20:36 -070059
H. Peter Anvinb40d68d2009-05-08 15:59:13 -070060/*
61 * Calculate the delta between where we were compiled to run
Vivek Goyal1ab60e02007-05-02 19:27:07 +020062 * at and where we were actually loaded at. This can only be done
63 * with a short local call on x86. Nothing else will tell us what
64 * address we are running at. The reserved chunk of the real-mode
H. Peter Anvin85414b62007-07-11 12:18:33 -070065 * data at 0x1e4 (defined as a scratch field) are used as the stack
66 * for this calculation. Only 4 bytes are needed.
Vivek Goyal1ab60e02007-05-02 19:27:07 +020067 */
H. Peter Anvinbd2a3692009-05-05 23:24:50 -070068 leal (BP_scratch+4)(%esi), %esp
Vivek Goyal1ab60e02007-05-02 19:27:07 +020069 call 1f
701: popl %ebp
71 subl $1b, %ebp
72
Vivek Goyala4831e02007-05-02 19:27:08 +020073/* setup a stack and make sure cpu supports long mode. */
Alexander van Heukelum7c539762008-04-08 12:54:30 +020074 movl $boot_stack_end, %eax
Vivek Goyala4831e02007-05-02 19:27:08 +020075 addl %ebp, %eax
76 movl %eax, %esp
77
78 call verify_cpu
79 testl %eax, %eax
80 jnz no_longmode
81
H. Peter Anvinb40d68d2009-05-08 15:59:13 -070082/*
83 * Compute the delta between where we were compiled to run at
Vivek Goyal1ab60e02007-05-02 19:27:07 +020084 * and where the code will actually run at.
H. Peter Anvinb40d68d2009-05-08 15:59:13 -070085 *
86 * %ebp contains the address we are loaded at by the boot loader and %ebx
Vivek Goyal1ab60e02007-05-02 19:27:07 +020087 * contains the address where we should move the kernel image temporarily
88 * for safe in-place decompression.
89 */
90
91#ifdef CONFIG_RELOCATABLE
92 movl %ebp, %ebx
H. Peter Anvin37ba7ab2009-05-11 15:56:08 -070093 movl BP_kernel_alignment(%esi), %eax
94 decl %eax
95 addl %eax, %ebx
96 notl %eax
97 andl %eax, %ebx
Kees Cook8ab38202013-10-10 17:18:14 -070098 cmpl $LOAD_PHYSICAL_ADDR, %ebx
99 jge 1f
Vivek Goyal1ab60e02007-05-02 19:27:07 +0200100#endif
Kees Cook8ab38202013-10-10 17:18:14 -0700101 movl $LOAD_PHYSICAL_ADDR, %ebx
1021:
Vivek Goyal1ab60e02007-05-02 19:27:07 +0200103
H. Peter Anvin02a884c2009-05-08 17:42:16 -0700104 /* Target address to relocate to for decompression */
105 addl $z_extract_offset, %ebx
Linus Torvalds1da177e2005-04-16 15:20:36 -0700106
107/*
Vivek Goyal1ab60e02007-05-02 19:27:07 +0200108 * Prepare for entering 64 bit mode
Linus Torvalds1da177e2005-04-16 15:20:36 -0700109 */
Vivek Goyal1ab60e02007-05-02 19:27:07 +0200110
111 /* Load new GDT with the 64bit segments using 32bit descriptor */
112 leal gdt(%ebp), %eax
113 movl %eax, gdt+2(%ebp)
114 lgdt gdt(%ebp)
115
116 /* Enable PAE mode */
Matt Fleming108d3f42014-02-24 13:37:29 +0000117 movl %cr4, %eax
118 orl $X86_CR4_PAE, %eax
Vivek Goyal1ab60e02007-05-02 19:27:07 +0200119 movl %eax, %cr4
120
121 /*
122 * Build early 4G boot pagetable
123 */
H. Peter Anvinb40d68d2009-05-08 15:59:13 -0700124 /* Initialize Page tables to 0 */
Vivek Goyal1ab60e02007-05-02 19:27:07 +0200125 leal pgtable(%ebx), %edi
126 xorl %eax, %eax
127 movl $((4096*6)/4), %ecx
128 rep stosl
129
130 /* Build Level 4 */
131 leal pgtable + 0(%ebx), %edi
132 leal 0x1007 (%edi), %eax
133 movl %eax, 0(%edi)
134
135 /* Build Level 3 */
136 leal pgtable + 0x1000(%ebx), %edi
137 leal 0x1007(%edi), %eax
138 movl $4, %ecx
1391: movl %eax, 0x00(%edi)
140 addl $0x00001000, %eax
141 addl $8, %edi
142 decl %ecx
143 jnz 1b
144
145 /* Build Level 2 */
146 leal pgtable + 0x2000(%ebx), %edi
147 movl $0x00000183, %eax
148 movl $2048, %ecx
1491: movl %eax, 0(%edi)
150 addl $0x00200000, %eax
151 addl $8, %edi
152 decl %ecx
153 jnz 1b
154
155 /* Enable the boot page tables */
156 leal pgtable(%ebx), %eax
157 movl %eax, %cr3
158
159 /* Enable Long mode in EFER (Extended Feature Enable Register) */
160 movl $MSR_EFER, %ecx
161 rdmsr
162 btsl $_EFER_LME, %eax
163 wrmsr
164
Yinghai Lud3c433b2013-01-24 12:20:01 -0800165 /* After gdt is loaded */
166 xorl %eax, %eax
167 lldt %ax
Denys Vlasenko40e4f2d12015-04-01 16:50:58 +0200168 movl $__BOOT_TSS, %eax
Yinghai Lud3c433b2013-01-24 12:20:01 -0800169 ltr %ax
170
H. Peter Anvinb40d68d2009-05-08 15:59:13 -0700171 /*
172 * Setup for the jump to 64bit mode
Vivek Goyal1ab60e02007-05-02 19:27:07 +0200173 *
174 * When the jump is performend we will be in long mode but
175 * in 32bit compatibility mode with EFER.LME = 1, CS.L = 0, CS.D = 1
176 * (and in turn EFER.LMA = 1). To jump into 64bit mode we use
177 * the new gdt/idt that has __KERNEL_CS with CS.L = 1.
178 * We place all of the values on our mini stack so lret can
179 * used to perform that far jump.
180 */
181 pushl $__KERNEL_CS
182 leal startup_64(%ebp), %eax
Matt Flemingb8ff87a2014-01-10 15:54:31 +0000183#ifdef CONFIG_EFI_MIXED
184 movl efi32_config(%ebp), %ebx
185 cmp $0, %ebx
186 jz 1f
187 leal handover_entry(%ebp), %eax
1881:
189#endif
Vivek Goyal1ab60e02007-05-02 19:27:07 +0200190 pushl %eax
191
192 /* Enter paged protected Mode, activating Long Mode */
Cyrill Gorcunove83e31f42008-05-12 15:43:39 +0200193 movl $(X86_CR0_PG | X86_CR0_PE), %eax /* Enable Paging and Protected mode */
Vivek Goyal1ab60e02007-05-02 19:27:07 +0200194 movl %eax, %cr0
195
196 /* Jump from 32bit compatibility mode into 64bit mode. */
197 lret
Cyrill Gorcunov2d4eeecb2009-02-14 00:50:22 +0300198ENDPROC(startup_32)
Vivek Goyal1ab60e02007-05-02 19:27:07 +0200199
Matt Flemingb8ff87a2014-01-10 15:54:31 +0000200#ifdef CONFIG_EFI_MIXED
201 .org 0x190
202ENTRY(efi32_stub_entry)
203 add $0x4, %esp /* Discard return address */
204 popl %ecx
205 popl %edx
206 popl %esi
207
208 leal (BP_scratch+4)(%esi), %esp
209 call 1f
2101: pop %ebp
211 subl $1b, %ebp
212
213 movl %ecx, efi32_config(%ebp)
214 movl %edx, efi32_config+8(%ebp)
215 sgdtl efi32_boot_gdt(%ebp)
216
217 leal efi32_config(%ebp), %eax
218 movl %eax, efi_config(%ebp)
219
220 jmp startup_32
221ENDPROC(efi32_stub_entry)
222#endif
223
Vivek Goyal1ab60e02007-05-02 19:27:07 +0200224 .code64
Vivek Goyala4831e02007-05-02 19:27:08 +0200225 .org 0x200
Vivek Goyal1ab60e02007-05-02 19:27:07 +0200226ENTRY(startup_64)
H. Peter Anvinb40d68d2009-05-08 15:59:13 -0700227 /*
Yinghai Lu8ee2f2d2013-01-24 12:20:07 -0800228 * 64bit entry is 0x200 and it is ABI so immutable!
H. Peter Anvinb40d68d2009-05-08 15:59:13 -0700229 * We come here either from startup_32 or directly from a
Yinghai Lu8ee2f2d2013-01-24 12:20:07 -0800230 * 64bit bootloader.
231 * If we come here from a bootloader, kernel(text+data+bss+brk),
232 * ramdisk, zero_page, command line could be above 4G.
233 * We depend on an identity mapped page table being provided
234 * that maps our entire kernel(text+data+bss+brk), zero page
235 * and command line.
Vivek Goyal1ab60e02007-05-02 19:27:07 +0200236 */
Matt Fleming291f3632011-12-12 21:27:52 +0000237#ifdef CONFIG_EFI_STUB
Matt Flemingb1994302012-04-15 16:06:04 +0100238 /*
David Woodhouse99f857d2013-01-10 14:31:59 +0000239 * The entry point for the PE/COFF executable is efi_pe_entry, so
240 * only legacy boot loaders will execute this jmp.
Matt Flemingb1994302012-04-15 16:06:04 +0100241 */
242 jmp preferred_addr
243
David Woodhouse99f857d2013-01-10 14:31:59 +0000244ENTRY(efi_pe_entry)
Matt Fleming54b52d82014-01-10 15:27:14 +0000245 movq %rcx, efi64_config(%rip) /* Handle */
246 movq %rdx, efi64_config+8(%rip) /* EFI System table pointer */
247
248 leaq efi64_config(%rip), %rax
249 movq %rax, efi_config(%rip)
250
251 call 1f
2521: popq %rbp
253 subq $1b, %rbp
254
255 /*
Linus Torvaldsf3670392014-09-22 23:05:49 -0700256 * Relocate efi_config->call().
Matt Fleming54b52d82014-01-10 15:27:14 +0000257 */
258 addq %rbp, efi64_config+88(%rip)
259
260 movq %rax, %rdi
Matt Fleming9ca8f722012-07-19 10:23:48 +0100261 call make_boot_params
262 cmpq $0,%rax
Matt Fleming54b52d82014-01-10 15:27:14 +0000263 je fail
264 mov %rax, %rsi
Matt Fleming7e8213c2014-04-08 13:14:00 +0100265 leaq startup_32(%rip), %rax
266 movl %eax, BP_code32_start(%rsi)
Matt Fleming54b52d82014-01-10 15:27:14 +0000267 jmp 2f /* Skip the relocation */
Matt Fleming9ca8f722012-07-19 10:23:48 +0100268
Matt Flemingb8ff87a2014-01-10 15:54:31 +0000269handover_entry:
Matt Fleming54b52d82014-01-10 15:27:14 +0000270 call 1f
2711: popq %rbp
272 subq $1b, %rbp
273
274 /*
Linus Torvaldsf3670392014-09-22 23:05:49 -0700275 * Relocate efi_config->call().
Matt Fleming54b52d82014-01-10 15:27:14 +0000276 */
277 movq efi_config(%rip), %rax
278 addq %rbp, 88(%rax)
Matt Fleming54b52d82014-01-10 15:27:14 +00002792:
280 movq efi_config(%rip), %rdi
Matt Fleming291f3632011-12-12 21:27:52 +0000281 call efi_main
Matt Fleming291f3632011-12-12 21:27:52 +0000282 movq %rax,%rsi
Matt Flemingb1994302012-04-15 16:06:04 +0100283 cmpq $0,%rax
284 jne 2f
Matt Fleming54b52d82014-01-10 15:27:14 +0000285fail:
Matt Flemingb1994302012-04-15 16:06:04 +0100286 /* EFI init failed, so hang. */
287 hlt
Matt Fleming54b52d82014-01-10 15:27:14 +0000288 jmp fail
Matt Flemingb1994302012-04-15 16:06:04 +01002892:
Matt Fleming7e8213c2014-04-08 13:14:00 +0100290 movl BP_code32_start(%esi), %eax
Matt Fleming291f3632011-12-12 21:27:52 +0000291 leaq preferred_addr(%rax), %rax
292 jmp *%rax
293
294preferred_addr:
295#endif
Vivek Goyal1ab60e02007-05-02 19:27:07 +0200296
297 /* Setup data segments. */
298 xorl %eax, %eax
299 movl %eax, %ds
300 movl %eax, %es
301 movl %eax, %ss
Zachary Amsden08da5a22007-08-10 22:31:05 +0200302 movl %eax, %fs
303 movl %eax, %gs
Vivek Goyal1ab60e02007-05-02 19:27:07 +0200304
H. Peter Anvinb40d68d2009-05-08 15:59:13 -0700305 /*
306 * Compute the decompressed kernel start address. It is where
Vivek Goyal1ab60e02007-05-02 19:27:07 +0200307 * we were loaded at aligned to a 2M boundary. %rbp contains the
308 * decompressed kernel start address.
309 *
310 * If it is a relocatable kernel then decompress and run the kernel
311 * from load address aligned to 2MB addr, otherwise decompress and
H. Peter Anvin40b387a2009-05-11 14:41:55 -0700312 * run the kernel from LOAD_PHYSICAL_ADDR
H. Peter Anvin02a884c2009-05-08 17:42:16 -0700313 *
314 * We cannot rely on the calculation done in 32-bit mode, since we
315 * may have been invoked via the 64-bit entry point.
Vivek Goyal1ab60e02007-05-02 19:27:07 +0200316 */
317
318 /* Start with the delta to where the kernel will run at. */
319#ifdef CONFIG_RELOCATABLE
320 leaq startup_32(%rip) /* - $startup_32 */, %rbp
H. Peter Anvin37ba7ab2009-05-11 15:56:08 -0700321 movl BP_kernel_alignment(%rsi), %eax
322 decl %eax
323 addq %rax, %rbp
324 notq %rax
325 andq %rax, %rbp
Kees Cook8ab38202013-10-10 17:18:14 -0700326 cmpq $LOAD_PHYSICAL_ADDR, %rbp
327 jge 1f
Vivek Goyal1ab60e02007-05-02 19:27:07 +0200328#endif
Kees Cook8ab38202013-10-10 17:18:14 -0700329 movq $LOAD_PHYSICAL_ADDR, %rbp
3301:
Vivek Goyal1ab60e02007-05-02 19:27:07 +0200331
H. Peter Anvin02a884c2009-05-08 17:42:16 -0700332 /* Target address to relocate to for decompression */
333 leaq z_extract_offset(%rbp), %rbx
Vivek Goyal1ab60e02007-05-02 19:27:07 +0200334
H. Peter Anvin0a137732009-05-08 16:27:41 -0700335 /* Set up the stack */
336 leaq boot_stack_end(%rbx), %rsp
337
338 /* Zero EFLAGS */
339 pushq $0
340 popfq
341
H. Peter Anvinb40d68d2009-05-08 15:59:13 -0700342/*
343 * Copy the compressed kernel to the end of our buffer
Vivek Goyal1ab60e02007-05-02 19:27:07 +0200344 * where decompression in place becomes safe.
345 */
H. Peter Anvin36d37932009-05-08 16:45:15 -0700346 pushq %rsi
347 leaq (_bss-8)(%rip), %rsi
348 leaq (_bss-8)(%rbx), %rdi
H. Peter Anvin5b11f1c2009-05-08 16:20:34 -0700349 movq $_bss /* - $startup_32 */, %rcx
H. Peter Anvin36d37932009-05-08 16:45:15 -0700350 shrq $3, %rcx
351 std
352 rep movsq
353 cld
354 popq %rsi
Vivek Goyal1ab60e02007-05-02 19:27:07 +0200355
356/*
357 * Jump to the relocated address.
358 */
359 leaq relocated(%rbx), %rax
360 jmp *%rax
361
Matt Flemingb8ff87a2014-01-10 15:54:31 +0000362#ifdef CONFIG_EFI_STUB
363 .org 0x390
364ENTRY(efi64_stub_entry)
365 movq %rdi, efi64_config(%rip) /* Handle */
366 movq %rsi, efi64_config+8(%rip) /* EFI System table pointer */
367
368 leaq efi64_config(%rip), %rax
369 movq %rax, efi_config(%rip)
370
371 movq %rdx, %rsi
372 jmp handover_entry
373ENDPROC(efi64_stub_entry)
374#endif
375
H. Peter Anvinb40d68d2009-05-08 15:59:13 -0700376 .text
Vivek Goyal1ab60e02007-05-02 19:27:07 +0200377relocated:
378
Linus Torvalds1da177e2005-04-16 15:20:36 -0700379/*
H. Peter Anvin0a137732009-05-08 16:27:41 -0700380 * Clear BSS (stack is currently empty)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700381 */
H. Peter Anvin36d37932009-05-08 16:45:15 -0700382 xorl %eax, %eax
383 leaq _bss(%rip), %rdi
384 leaq _ebss(%rip), %rcx
Vivek Goyal1ab60e02007-05-02 19:27:07 +0200385 subq %rdi, %rcx
H. Peter Anvin36d37932009-05-08 16:45:15 -0700386 shrq $3, %rcx
387 rep stosq
Vivek Goyal1ab60e02007-05-02 19:27:07 +0200388
Linus Torvaldsf3670392014-09-22 23:05:49 -0700389/*
390 * Adjust our own GOT
391 */
392 leaq _got(%rip), %rdx
393 leaq _egot(%rip), %rcx
3941:
395 cmpq %rcx, %rdx
396 jae 2f
397 addq %rbx, (%rdx)
398 addq $8, %rdx
399 jmp 1b
4002:
401
H. Peter Anvin22a57f52010-08-02 15:34:44 -0700402/*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700403 * Do the decompression, and jump to the new kernel..
404 */
H. Peter Anvin02a884c2009-05-08 17:42:16 -0700405 pushq %rsi /* Save the real mode argument */
Junjie Maoe6023362014-10-31 21:40:38 +0800406 movq $z_run_size, %r9 /* size of kernel with .bss and .brk */
407 pushq %r9
H. Peter Anvin02a884c2009-05-08 17:42:16 -0700408 movq %rsi, %rdi /* real mode address */
409 leaq boot_heap(%rip), %rsi /* malloc area for uncompression */
410 leaq input_data(%rip), %rdx /* input_data */
411 movl $z_input_len, %ecx /* input_len */
412 movq %rbp, %r8 /* output target address */
Junjie Maoe6023362014-10-31 21:40:38 +0800413 movq $z_output_len, %r9 /* decompressed length, end of relocs */
Kees Cook8ab38202013-10-10 17:18:14 -0700414 call decompress_kernel /* returns kernel location in %rax */
Junjie Maoe6023362014-10-31 21:40:38 +0800415 popq %r9
Vivek Goyal1ab60e02007-05-02 19:27:07 +0200416 popq %rsi
417
Linus Torvalds1da177e2005-04-16 15:20:36 -0700418/*
Vivek Goyal1ab60e02007-05-02 19:27:07 +0200419 * Jump to the decompressed kernel.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700420 */
Kees Cook8ab38202013-10-10 17:18:14 -0700421 jmp *%rax
Linus Torvalds1da177e2005-04-16 15:20:36 -0700422
Yinghai Lu187a8a72013-01-24 12:20:00 -0800423 .code32
424no_longmode:
425 /* This isn't an x86-64 CPU so hang */
4261:
427 hlt
428 jmp 1b
429
430#include "../../kernel/verify_cpu.S"
431
Vivek Goyal1ab60e02007-05-02 19:27:07 +0200432 .data
433gdt:
434 .word gdt_end - gdt
435 .long gdt
436 .word 0
437 .quad 0x0000000000000000 /* NULL descriptor */
438 .quad 0x00af9a000000ffff /* __KERNEL_CS */
439 .quad 0x00cf92000000ffff /* __KERNEL_DS */
Zachary Amsden08da5a22007-08-10 22:31:05 +0200440 .quad 0x0080890000000000 /* TS descriptor */
441 .quad 0x0000000000000000 /* TS continued */
Vivek Goyal1ab60e02007-05-02 19:27:07 +0200442gdt_end:
Alexander van Heukelum7c539762008-04-08 12:54:30 +0200443
Matt Fleming3db4caf2014-03-05 10:15:55 +0000444#ifdef CONFIG_EFI_STUB
Matt Fleming54b52d82014-01-10 15:27:14 +0000445efi_config:
446 .quad 0
447
Matt Flemingb8ff87a2014-01-10 15:54:31 +0000448#ifdef CONFIG_EFI_MIXED
449 .global efi32_config
450efi32_config:
451 .fill 11,8,0
452 .quad efi64_thunk
453 .byte 0
454#endif
455
Matt Fleming54b52d82014-01-10 15:27:14 +0000456 .global efi64_config
457efi64_config:
458 .fill 11,8,0
Matt Fleming62fa6e62014-03-27 15:10:39 -0700459 .quad efi_call
Matt Fleming54b52d82014-01-10 15:27:14 +0000460 .byte 1
Matt Fleming3db4caf2014-03-05 10:15:55 +0000461#endif /* CONFIG_EFI_STUB */
462
H. Peter Anvinb40d68d2009-05-08 15:59:13 -0700463/*
464 * Stack and heap for uncompression
465 */
466 .bss
467 .balign 4
Alexander van Heukelum7c539762008-04-08 12:54:30 +0200468boot_heap:
469 .fill BOOT_HEAP_SIZE, 1, 0
470boot_stack:
471 .fill BOOT_STACK_SIZE, 1, 0
472boot_stack_end:
H. Peter Anvin5b11f1c2009-05-08 16:20:34 -0700473
474/*
475 * Space for page tables (not in .bss so not zeroed)
476 */
477 .section ".pgtable","a",@nobits
478 .balign 4096
479pgtable:
480 .fill 6*4096, 1, 0