blob: 805d25ca5f1db1602498c7047025b973ac788b3c [file] [log] [blame]
Yinghai Lu8fee13a2010-08-02 16:21:22 -07001#ifndef BOOT_COMPRESSED_MISC_H
2#define BOOT_COMPRESSED_MISC_H
3
4/*
Ingo Molnar927392d2012-11-23 19:19:07 +01005 * 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.)
Yinghai Lu8fee13a2010-08-02 16:21:22 -07009 */
10#undef CONFIG_PARAVIRT
Ingo Molnar927392d2012-11-23 19:19:07 +010011#undef CONFIG_PARAVIRT_SPINLOCKS
Andrey Ryabinin393f2032015-02-13 14:39:56 -080012#undef CONFIG_KASAN
Yinghai Lu8fee13a2010-08-02 16:21:22 -070013
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>
H. Peter Anvin5dcd14e2013-01-29 01:05:24 -080021#include <asm/bootparam_utils.h>
Yinghai Lu8fee13a2010-08-02 16:21:22 -070022
23#define BOOT_BOOT_H
H. Peter Anvin6238b472010-08-02 21:03:46 -070024#include "../ctype.h"
Yinghai Lu8fee13a2010-08-02 16:21:22 -070025
Kees Cook82fa9632013-10-10 17:18:16 -070026#ifdef CONFIG_X86_64
27#define memptr long
28#else
29#define memptr unsigned
30#endif
31
Yinghai Lu8fee13a2010-08-02 16:21:22 -070032/* misc.c */
Kees Cook82fa9632013-10-10 17:18:16 -070033extern memptr free_mem_ptr;
34extern memptr free_mem_end_ptr;
Yinghai Lu8fee13a2010-08-02 16:21:22 -070035extern struct boot_params *real_mode; /* Pointer to real-mode data */
Joe Millenbach7aac3012012-07-19 18:04:39 -070036void __putstr(const char *s);
37#define error_putstr(__x) __putstr(__x)
38
39#ifdef CONFIG_X86_VERBOSE_BOOTUP
40
41#define debug_putstr(__x) __putstr(__x)
42
43#else
44
45static inline void debug_putstr(const char *s)
46{ }
47
48#endif
Yinghai Lu8fee13a2010-08-02 16:21:22 -070049
Kees Cook8ab38202013-10-10 17:18:14 -070050#if CONFIG_EARLY_PRINTK || CONFIG_RANDOMIZE_BASE
Yinghai Lu8fee13a2010-08-02 16:21:22 -070051/* cmdline.c */
52int cmdline_find_option(const char *option, char *buffer, int bufsize);
53int cmdline_find_option_bool(const char *option);
Kees Cook8ab38202013-10-10 17:18:14 -070054#endif
Yinghai Lu8fee13a2010-08-02 16:21:22 -070055
Kees Cook8ab38202013-10-10 17:18:14 -070056
57#if CONFIG_RANDOMIZE_BASE
58/* aslr.c */
Borislav Petkov78cac482015-04-01 12:49:52 +020059unsigned char *choose_kernel_location(struct boot_params *boot_params,
60 unsigned char *input,
Kees Cook8ab38202013-10-10 17:18:14 -070061 unsigned long input_size,
62 unsigned char *output,
63 unsigned long output_size);
Kees Cook5bfce5e2013-10-10 17:18:15 -070064/* cpuflags.c */
65bool has_cpuflag(int flag);
Kees Cook8ab38202013-10-10 17:18:14 -070066#else
67static inline
Borislav Petkov78cac482015-04-01 12:49:52 +020068unsigned char *choose_kernel_location(struct boot_params *boot_params,
69 unsigned char *input,
Kees Cook8ab38202013-10-10 17:18:14 -070070 unsigned long input_size,
71 unsigned char *output,
72 unsigned long output_size)
73{
74 return output;
75}
76#endif
77
78#ifdef CONFIG_EARLY_PRINTK
Yinghai Lu8fee13a2010-08-02 16:21:22 -070079/* early_serial_console.c */
80extern int early_serial_base;
81void console_init(void);
Joe Millenbachcec49df2012-07-19 18:04:41 -070082#else
Joe Millenbachcec49df2012-07-19 18:04:41 -070083static const int early_serial_base;
84static inline void console_init(void)
85{ }
Joe Millenbachcec49df2012-07-19 18:04:41 -070086#endif
87
Yinghai Lu8fee13a2010-08-02 16:21:22 -070088#endif