xref: /linux/arch/x86/boot/compressed/misc.h (revision e0bf6c5ca2d3281f231c5f0c9bf145e9513644de)
1 #ifndef BOOT_COMPRESSED_MISC_H
2 #define BOOT_COMPRESSED_MISC_H
3 
4 /*
5  * we have to be careful, because no indirections are allowed here, and
6  * paravirt_ops is a kind of one. As it will only run in baremetal anyway,
7  * we just keep it from happening
8  */
9 #undef CONFIG_PARAVIRT
10 #undef CONFIG_KASAN
11 #ifdef CONFIG_X86_32
12 #define _ASM_X86_DESC_H 1
13 #endif
14 
15 #include <linux/linkage.h>
16 #include <linux/screen_info.h>
17 #include <linux/elf.h>
18 #include <linux/io.h>
19 #include <asm/page.h>
20 #include <asm/boot.h>
21 #include <asm/bootparam.h>
22 #include <asm/bootparam_utils.h>
23 
24 #define BOOT_BOOT_H
25 #include "../ctype.h"
26 
27 #ifdef CONFIG_X86_64
28 #define memptr long
29 #else
30 #define memptr unsigned
31 #endif
32 
33 /* misc.c */
34 extern memptr free_mem_ptr;
35 extern memptr free_mem_end_ptr;
36 extern struct boot_params *real_mode;		/* Pointer to real-mode data */
37 void __putstr(const char *s);
38 #define error_putstr(__x)  __putstr(__x)
39 
40 #ifdef CONFIG_X86_VERBOSE_BOOTUP
41 
42 #define debug_putstr(__x)  __putstr(__x)
43 
44 #else
45 
46 static inline void debug_putstr(const char *s)
47 { }
48 
49 #endif
50 
51 #if CONFIG_EARLY_PRINTK || CONFIG_RANDOMIZE_BASE
52 /* cmdline.c */
53 int cmdline_find_option(const char *option, char *buffer, int bufsize);
54 int cmdline_find_option_bool(const char *option);
55 #endif
56 
57 
58 #if CONFIG_RANDOMIZE_BASE
59 /* aslr.c */
60 unsigned char *choose_kernel_location(unsigned char *input,
61 				      unsigned long input_size,
62 				      unsigned char *output,
63 				      unsigned long output_size);
64 /* cpuflags.c */
65 bool has_cpuflag(int flag);
66 #else
67 static inline
68 unsigned char *choose_kernel_location(unsigned char *input,
69 				      unsigned long input_size,
70 				      unsigned char *output,
71 				      unsigned long output_size)
72 {
73 	return output;
74 }
75 #endif
76 
77 #ifdef CONFIG_EARLY_PRINTK
78 /* early_serial_console.c */
79 extern int early_serial_base;
80 void console_init(void);
81 #else
82 static const int early_serial_base;
83 static inline void console_init(void)
84 { }
85 #endif
86 
87 #endif
88