Commit | Line | Data |
---|---|---|
8fee13a4 YL |
1 | #ifndef BOOT_COMPRESSED_MISC_H |
2 | #define BOOT_COMPRESSED_MISC_H | |
3 | ||
4 | /* | |
927392d7 IM |
5 | * Special hack: we have to be careful, because no indirections are allowed here, |
6 | * and paravirt_ops is a kind of one. As it will only run in baremetal anyway, | |
7 | * we just keep it from happening. (This list needs to be extended when new | |
8 | * paravirt and debugging variants are added.) | |
8fee13a4 YL |
9 | */ |
10 | #undef CONFIG_PARAVIRT | |
927392d7 | 11 | #undef CONFIG_PARAVIRT_SPINLOCKS |
393f203f | 12 | #undef CONFIG_KASAN |
8fee13a4 YL |
13 | |
14 | #include <linux/linkage.h> | |
15 | #include <linux/screen_info.h> | |
16 | #include <linux/elf.h> | |
17 | #include <linux/io.h> | |
18 | #include <asm/page.h> | |
19 | #include <asm/boot.h> | |
20 | #include <asm/bootparam.h> | |
5dcd14ec | 21 | #include <asm/bootparam_utils.h> |
8fee13a4 YL |
22 | |
23 | #define BOOT_BOOT_H | |
6238b47b | 24 | #include "../ctype.h" |
8fee13a4 | 25 | |
82fa9637 KC |
26 | #ifdef CONFIG_X86_64 |
27 | #define memptr long | |
28 | #else | |
29 | #define memptr unsigned | |
30 | #endif | |
31 | ||
8fee13a4 | 32 | /* misc.c */ |
82fa9637 KC |
33 | extern memptr free_mem_ptr; |
34 | extern memptr free_mem_end_ptr; | |
6655e0aa | 35 | extern struct boot_params *boot_params; |
7aac3015 | 36 | void __putstr(const char *s); |
79063a7c | 37 | void __puthex(unsigned long value); |
7aac3015 | 38 | #define error_putstr(__x) __putstr(__x) |
79063a7c | 39 | #define error_puthex(__x) __puthex(__x) |
7aac3015 JM |
40 | |
41 | #ifdef CONFIG_X86_VERBOSE_BOOTUP | |
42 | ||
43 | #define debug_putstr(__x) __putstr(__x) | |
79063a7c KC |
44 | #define debug_puthex(__x) __puthex(__x) |
45 | #define debug_putaddr(__x) { \ | |
46 | debug_putstr(#__x ": 0x"); \ | |
47 | debug_puthex((unsigned long)(__x)); \ | |
48 | debug_putstr("\n"); \ | |
49 | } | |
7aac3015 JM |
50 | |
51 | #else | |
52 | ||
53 | static inline void debug_putstr(const char *s) | |
54 | { } | |
79063a7c KC |
55 | static inline void debug_puthex(const char *s) |
56 | { } | |
57 | #define debug_putaddr(x) /* */ | |
7aac3015 JM |
58 | |
59 | #endif | |
8fee13a4 | 60 | |
8ab3820f | 61 | #if CONFIG_EARLY_PRINTK || CONFIG_RANDOMIZE_BASE |
8fee13a4 YL |
62 | /* cmdline.c */ |
63 | int cmdline_find_option(const char *option, char *buffer, int bufsize); | |
64 | int cmdline_find_option_bool(const char *option); | |
8ab3820f | 65 | #endif |
8fee13a4 | 66 | |
8fee13a4 | 67 | |
8ab3820f | 68 | #if CONFIG_RANDOMIZE_BASE |
9b238748 | 69 | /* kaslr.c */ |
549f90db | 70 | unsigned char *choose_random_location(unsigned long input_ptr, |
8ab3820f | 71 | unsigned long input_size, |
549f90db | 72 | unsigned long output_ptr, |
8ab3820f | 73 | unsigned long output_size); |
5bfce5ef KC |
74 | /* cpuflags.c */ |
75 | bool has_cpuflag(int flag); | |
cec49df9 | 76 | #else |
8ab3820f | 77 | static inline |
549f90db | 78 | unsigned char *choose_random_location(unsigned long input_ptr, |
8ab3820f | 79 | unsigned long input_size, |
549f90db | 80 | unsigned long output_ptr, |
8ab3820f KC |
81 | unsigned long output_size) |
82 | { | |
549f90db | 83 | return (unsigned char *)output_ptr; |
8ab3820f KC |
84 | } |
85 | #endif | |
cec49df9 | 86 | |
8ab3820f | 87 | #ifdef CONFIG_EARLY_PRINTK |
bd448d4d | 88 | /* early_serial_console.c */ |
8ab3820f KC |
89 | extern int early_serial_base; |
90 | void console_init(void); | |
91 | #else | |
cec49df9 JM |
92 | static const int early_serial_base; |
93 | static inline void console_init(void) | |
94 | { } | |
cec49df9 JM |
95 | #endif |
96 | ||
8fee13a4 | 97 | #endif |