blob: 89dd0d78013aaff6c889340e0e3caceb4c8f8c88 [file] [log] [blame]
Yinghai Lu8fee13a2010-08-02 16:21:22 -07001#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
Andrey Ryabinin393f2032015-02-13 14:39:56 -080010#undef CONFIG_KASAN
Yinghai Lu8fee13a2010-08-02 16:21:22 -070011#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>
H. Peter Anvin5dcd14e2013-01-29 01:05:24 -080022#include <asm/bootparam_utils.h>
Yinghai Lu8fee13a2010-08-02 16:21:22 -070023
24#define BOOT_BOOT_H
H. Peter Anvin6238b472010-08-02 21:03:46 -070025#include "../ctype.h"
Yinghai Lu8fee13a2010-08-02 16:21:22 -070026
Kees Cook82fa9632013-10-10 17:18:16 -070027#ifdef CONFIG_X86_64
28#define memptr long
29#else
30#define memptr unsigned
31#endif
32
Yinghai Lu8fee13a2010-08-02 16:21:22 -070033/* misc.c */
Kees Cook82fa9632013-10-10 17:18:16 -070034extern memptr free_mem_ptr;
35extern memptr free_mem_end_ptr;
Yinghai Lu8fee13a2010-08-02 16:21:22 -070036extern struct boot_params *real_mode; /* Pointer to real-mode data */
Joe Millenbach7aac3012012-07-19 18:04:39 -070037void __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
46static inline void debug_putstr(const char *s)
47{ }
48
49#endif
Yinghai Lu8fee13a2010-08-02 16:21:22 -070050
Kees Cook8ab38202013-10-10 17:18:14 -070051#if CONFIG_EARLY_PRINTK || CONFIG_RANDOMIZE_BASE
Yinghai Lu8fee13a2010-08-02 16:21:22 -070052/* cmdline.c */
53int cmdline_find_option(const char *option, char *buffer, int bufsize);
54int cmdline_find_option_bool(const char *option);
Kees Cook8ab38202013-10-10 17:18:14 -070055#endif
Yinghai Lu8fee13a2010-08-02 16:21:22 -070056
Kees Cook8ab38202013-10-10 17:18:14 -070057
58#if CONFIG_RANDOMIZE_BASE
59/* aslr.c */
Borislav Petkov78cac482015-04-01 12:49:52 +020060unsigned char *choose_kernel_location(struct boot_params *boot_params,
61 unsigned char *input,
Kees Cook8ab38202013-10-10 17:18:14 -070062 unsigned long input_size,
63 unsigned char *output,
64 unsigned long output_size);
Kees Cook5bfce5e2013-10-10 17:18:15 -070065/* cpuflags.c */
66bool has_cpuflag(int flag);
Kees Cook8ab38202013-10-10 17:18:14 -070067#else
68static inline
Borislav Petkov78cac482015-04-01 12:49:52 +020069unsigned char *choose_kernel_location(struct boot_params *boot_params,
70 unsigned char *input,
Kees Cook8ab38202013-10-10 17:18:14 -070071 unsigned long input_size,
72 unsigned char *output,
73 unsigned long output_size)
74{
75 return output;
76}
77#endif
78
79#ifdef CONFIG_EARLY_PRINTK
Yinghai Lu8fee13a2010-08-02 16:21:22 -070080/* early_serial_console.c */
81extern int early_serial_base;
82void console_init(void);
Joe Millenbachcec49df2012-07-19 18:04:41 -070083#else
Joe Millenbachcec49df2012-07-19 18:04:41 -070084static const int early_serial_base;
85static inline void console_init(void)
86{ }
Joe Millenbachcec49df2012-07-19 18:04:41 -070087#endif
88
Yinghai Lu8fee13a2010-08-02 16:21:22 -070089#endif