xref: /linux/arch/x86/include/asm/setup.h (revision d0b73b488c55df905ea8faaad079f8535629ed26)
1 #ifndef _ASM_X86_SETUP_H
2 #define _ASM_X86_SETUP_H
3 
4 #include <uapi/asm/setup.h>
5 
6 
7 #define COMMAND_LINE_SIZE 2048
8 
9 #ifdef __i386__
10 
11 #include <linux/pfn.h>
12 /*
13  * Reserved space for vmalloc and iomap - defined in asm/page.h
14  */
15 #define MAXMEM_PFN	PFN_DOWN(MAXMEM)
16 #define MAX_NONPAE_PFN	(1 << 20)
17 
18 #endif /* __i386__ */
19 
20 #define PARAM_SIZE 4096		/* sizeof(struct boot_params) */
21 
22 #define OLD_CL_MAGIC		0xA33F
23 #define OLD_CL_ADDRESS		0x020	/* Relative to real mode data */
24 #define NEW_CL_POINTER		0x228	/* Relative to real mode data */
25 
26 #ifndef __ASSEMBLY__
27 #include <asm/bootparam.h>
28 #include <asm/x86_init.h>
29 
30 /* Interrupt control for vSMPowered x86_64 systems */
31 #ifdef CONFIG_X86_64
32 void vsmp_init(void);
33 #else
34 static inline void vsmp_init(void) { }
35 #endif
36 
37 void setup_bios_corruption_check(void);
38 
39 #ifdef CONFIG_X86_VISWS
40 extern void visws_early_detect(void);
41 #else
42 static inline void visws_early_detect(void) { }
43 #endif
44 
45 extern unsigned long saved_video_mode;
46 
47 extern void reserve_standard_io_resources(void);
48 extern void i386_reserve_resources(void);
49 extern void setup_default_timer_irq(void);
50 
51 #ifdef CONFIG_X86_INTEL_MID
52 extern void x86_mrst_early_setup(void);
53 #else
54 static inline void x86_mrst_early_setup(void) { }
55 #endif
56 
57 #ifdef CONFIG_X86_INTEL_CE
58 extern void x86_ce4100_early_setup(void);
59 #else
60 static inline void x86_ce4100_early_setup(void) { }
61 #endif
62 
63 #ifndef _SETUP
64 
65 /*
66  * This is set up by the setup-routine at boot-time
67  */
68 extern struct boot_params boot_params;
69 
70 /*
71  * Do NOT EVER look at the BIOS memory size location.
72  * It does not work on many machines.
73  */
74 #define LOWMEMSIZE()	(0x9f000)
75 
76 /* exceedingly early brk-like allocator */
77 extern unsigned long _brk_end;
78 void *extend_brk(size_t size, size_t align);
79 
80 /*
81  * Reserve space in the brk section.  The name must be unique within
82  * the file, and somewhat descriptive.  The size is in bytes.  Must be
83  * used at file scope.
84  *
85  * (This uses a temp function to wrap the asm so we can pass it the
86  * size parameter; otherwise we wouldn't be able to.  We can't use a
87  * "section" attribute on a normal variable because it always ends up
88  * being @progbits, which ends up allocating space in the vmlinux
89  * executable.)
90  */
91 #define RESERVE_BRK(name,sz)						\
92 	static void __section(.discard.text) __used notrace		\
93 	__brk_reservation_fn_##name##__(void) {				\
94 		asm volatile (						\
95 			".pushsection .brk_reservation,\"aw\",@nobits;" \
96 			".brk." #name ":"				\
97 			" 1:.skip %c0;"					\
98 			" .size .brk." #name ", . - 1b;"		\
99 			" .popsection"					\
100 			: : "i" (sz));					\
101 	}
102 
103 /* Helper for reserving space for arrays of things */
104 #define RESERVE_BRK_ARRAY(type, name, entries)		\
105 	type *name;					\
106 	RESERVE_BRK(name, sizeof(type) * entries)
107 
108 extern void probe_roms(void);
109 #ifdef __i386__
110 
111 void __init i386_start_kernel(void);
112 
113 #else
114 void __init x86_64_start_kernel(char *real_mode);
115 void __init x86_64_start_reservations(char *real_mode_data);
116 
117 #endif /* __i386__ */
118 #endif /* _SETUP */
119 #else
120 #define RESERVE_BRK(name,sz)				\
121 	.pushsection .brk_reservation,"aw",@nobits;	\
122 .brk.name:						\
123 1:	.skip sz;					\
124 	.size .brk.name,.-1b;				\
125 	.popsection
126 #endif /* __ASSEMBLY__ */
127 #endif /* _ASM_X86_SETUP_H */
128