Merge tag 'arm64-perf' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
[linux-2.6-block.git] / arch / x86 / boot / compressed / misc.h
CommitLineData
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
33extern memptr free_mem_ptr;
34extern memptr free_mem_end_ptr;
6655e0aa 35extern struct boot_params *boot_params;
7aac3015 36void __putstr(const char *s);
79063a7c 37void __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
53static inline void debug_putstr(const char *s)
54{ }
79063a7c
KC
55static 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 */
63int cmdline_find_option(const char *option, char *buffer, int bufsize);
64int 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 70unsigned 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 */
75bool has_cpuflag(int flag);
cec49df9 76#else
8ab3820f 77static inline
549f90db 78unsigned 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
3a94707d
KC
87#ifdef CONFIG_X86_64
88void add_identity_map(unsigned long start, unsigned long size);
89void finalize_identity_maps(void);
90extern unsigned char _pgtable[];
91#else
92static inline void add_identity_map(unsigned long start, unsigned long size)
93{ }
94static inline void finalize_identity_maps(void)
95{ }
96#endif
97
8ab3820f 98#ifdef CONFIG_EARLY_PRINTK
bd448d4d 99/* early_serial_console.c */
8ab3820f
KC
100extern int early_serial_base;
101void console_init(void);
102#else
cec49df9
JM
103static const int early_serial_base;
104static inline void console_init(void)
105{ }
cec49df9
JM
106#endif
107
8fee13a4 108#endif