]>
Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
1965aae3 PA |
2 | #ifndef _ASM_X86_BOOT_H |
3 | #define _ASM_X86_BOOT_H | |
1da177e4 | 4 | |
95c4bff0 | 5 | |
658dbfeb | 6 | #include <asm/pgtable_types.h> |
af170c50 | 7 | #include <uapi/asm/boot.h> |
37ba7ab5 | 8 | |
beb7dd86 | 9 | /* Physical address where kernel should be loaded. */ |
dd0ec16f VG |
10 | #define LOAD_PHYSICAL_ADDR ((CONFIG_PHYSICAL_START \ |
11 | + (CONFIG_PHYSICAL_ALIGN - 1)) \ | |
e69f202d VG |
12 | & ~(CONFIG_PHYSICAL_ALIGN - 1)) |
13 | ||
37ba7ab5 | 14 | /* Minimum kernel alignment, as a power of two */ |
22f4319d | 15 | #ifdef CONFIG_X86_64 |
8665e6ff | 16 | # define MIN_KERNEL_ALIGN_LG2 PMD_SHIFT |
37ba7ab5 | 17 | #else |
8665e6ff | 18 | # define MIN_KERNEL_ALIGN_LG2 (PAGE_SHIFT + THREAD_SIZE_ORDER) |
37ba7ab5 PA |
19 | #endif |
20 | #define MIN_KERNEL_ALIGN (_AC(1, UL) << MIN_KERNEL_ALIGN_LG2) | |
21 | ||
22 | #if (CONFIG_PHYSICAL_ALIGN & (CONFIG_PHYSICAL_ALIGN-1)) || \ | |
6fc108a0 | 23 | (CONFIG_PHYSICAL_ALIGN < MIN_KERNEL_ALIGN) |
8665e6ff | 24 | # error "Invalid value for CONFIG_PHYSICAL_ALIGN" |
37ba7ab5 PA |
25 | #endif |
26 | ||
95c4bff0 | 27 | #ifdef CONFIG_KERNEL_BZIP2 |
8665e6ff | 28 | # define BOOT_HEAP_SIZE 0x400000 |
95c4bff0 | 29 | #else /* !CONFIG_KERNEL_BZIP2 */ |
8665e6ff KC |
30 | # define BOOT_HEAP_SIZE 0x10000 |
31 | #endif | |
ae03c499 AK |
32 | |
33 | #ifdef CONFIG_X86_64 | |
8665e6ff | 34 | # define BOOT_STACK_SIZE 0x4000 |
3a94707d KC |
35 | |
36 | # define BOOT_INIT_PGT_SIZE (6*4096) | |
37 | # ifdef CONFIG_RANDOMIZE_BASE | |
38 | /* | |
39 | * Assuming all cross the 512GB boundary: | |
40 | * 1 page for level4 | |
41 | * (2+2)*4 pages for kernel, param, cmd_line, and randomized kernel | |
42 | * 2 pages for first 2M (video RAM: CONFIG_X86_VERBOSE_BOOTUP). | |
43 | * Total is 19 pages. | |
44 | */ | |
45 | # ifdef CONFIG_X86_VERBOSE_BOOTUP | |
46 | # define BOOT_PGT_SIZE (19*4096) | |
47 | # else /* !CONFIG_X86_VERBOSE_BOOTUP */ | |
48 | # define BOOT_PGT_SIZE (17*4096) | |
49 | # endif | |
50 | # else /* !CONFIG_RANDOMIZE_BASE */ | |
51 | # define BOOT_PGT_SIZE BOOT_INIT_PGT_SIZE | |
52 | # endif | |
53 | ||
8665e6ff KC |
54 | #else /* !CONFIG_X86_64 */ |
55 | # define BOOT_STACK_SIZE 0x1000 | |
7c539764 AH |
56 | #endif |
57 | ||
1965aae3 | 58 | #endif /* _ASM_X86_BOOT_H */ |