1#ifndef _ASM_X86_SETUP_H
2#define _ASM_X86_SETUP_H
3
4#include <uapi/asm/setup.h>
5
6#define COMMAND_LINE_SIZE 2048
7
8#ifdef __i386__
9
10#include <linux/pfn.h>
11
12
13
14#define MAXMEM_PFN PFN_DOWN(MAXMEM)
15#define MAX_NONPAE_PFN (1 << 20)
16
17#endif
18
19#define PARAM_SIZE 4096
20
21#define OLD_CL_MAGIC 0xA33F
22#define OLD_CL_ADDRESS 0x020
23#define NEW_CL_POINTER 0x228
24
25#ifndef __ASSEMBLY__
26#include <asm/bootparam.h>
27#include <asm/x86_init.h>
28
29extern u64 relocated_ramdisk;
30
31
32#ifdef CONFIG_X86_64
33void vsmp_init(void);
34#else
35static inline void vsmp_init(void) { }
36#endif
37
38void setup_bios_corruption_check(void);
39
40#ifdef CONFIG_X86_VISWS
41extern void visws_early_detect(void);
42#else
43static inline void visws_early_detect(void) { }
44#endif
45
46extern unsigned long saved_video_mode;
47
48extern void reserve_standard_io_resources(void);
49extern void i386_reserve_resources(void);
50extern void setup_default_timer_irq(void);
51
52#ifdef CONFIG_X86_INTEL_MID
53extern void x86_mrst_early_setup(void);
54#else
55static inline void x86_mrst_early_setup(void) { }
56#endif
57
58#ifdef CONFIG_X86_INTEL_CE
59extern void x86_ce4100_early_setup(void);
60#else
61static inline void x86_ce4100_early_setup(void) { }
62#endif
63
64#ifndef _SETUP
65
66#include <linux/kernel.h>
67
68
69
70
71extern struct boot_params boot_params;
72extern char _text[];
73
74static inline bool kaslr_enabled(void)
75{
76 return !!(boot_params.hdr.loadflags & KASLR_FLAG);
77}
78
79static inline unsigned long kaslr_offset(void)
80{
81 return (unsigned long)&_text - __START_KERNEL;
82}
83
84
85
86
87
88#define LOWMEMSIZE() (0x9f000)
89
90
91extern unsigned long _brk_end;
92void *extend_brk(size_t size, size_t align);
93
94
95
96
97
98
99
100
101
102
103
104
105#define RESERVE_BRK(name,sz) \
106 static void __section(.discard.text) __used notrace \
107 __brk_reservation_fn_##name##__(void) { \
108 asm volatile ( \
109 ".pushsection .brk_reservation,\"aw\",@nobits;" \
110 ".brk." #name ":" \
111 " 1:.skip %c0;" \
112 " .size .brk." #name ", . - 1b;" \
113 " .popsection" \
114 : : "i" (sz)); \
115 }
116
117
118#define RESERVE_BRK_ARRAY(type, name, entries) \
119 type *name; \
120 RESERVE_BRK(name, sizeof(type) * entries)
121
122extern void probe_roms(void);
123#ifdef __i386__
124
125void __init i386_start_kernel(void);
126
127#else
128void __init x86_64_start_kernel(char *real_mode);
129void __init x86_64_start_reservations(char *real_mode_data);
130
131#endif
132#endif
133#else
134#define RESERVE_BRK(name,sz) \
135 .pushsection .brk_reservation,"aw",@nobits; \
136.brk.name: \
1371: .skip sz; \
138 .size .brk.name,.-1b; \
139 .popsection
140#endif
141#endif
142