11965aae3SH. Peter Anvin #ifndef _ASM_X86_SETUP_H 21965aae3SH. Peter Anvin #define _ASM_X86_SETUP_H 3bb898558SAl Viro 4af170c50SDavid Howells #include <uapi/asm/setup.h> 5af170c50SDavid Howells 6bb898558SAl Viro #define COMMAND_LINE_SIZE 2048 7bb898558SAl Viro 8a1ed4ddfSAndi Kleen #include <linux/linkage.h> 9a1ed4ddfSAndi Kleen 10bb898558SAl Viro #ifdef __i386__ 11bb898558SAl Viro 12bb898558SAl Viro #include <linux/pfn.h> 13bb898558SAl Viro /* 14bb898558SAl Viro * Reserved space for vmalloc and iomap - defined in asm/page.h 15bb898558SAl Viro */ 16bb898558SAl Viro #define MAXMEM_PFN PFN_DOWN(MAXMEM) 17bb898558SAl Viro #define MAX_NONPAE_PFN (1 << 20) 18bb898558SAl Viro 19bb898558SAl Viro #endif /* __i386__ */ 20bb898558SAl Viro 21bb898558SAl Viro #define PARAM_SIZE 4096 /* sizeof(struct boot_params) */ 22bb898558SAl Viro 23bb898558SAl Viro #define OLD_CL_MAGIC 0xA33F 24bb898558SAl Viro #define OLD_CL_ADDRESS 0x020 /* Relative to real mode data */ 25bb898558SAl Viro #define NEW_CL_POINTER 0x228 /* Relative to real mode data */ 26bb898558SAl Viro 27bb898558SAl Viro #ifndef __ASSEMBLY__ 28bb898558SAl Viro #include <asm/bootparam.h> 29845b3944SThomas Gleixner #include <asm/x86_init.h> 30bb898558SAl Viro 31*5aa3d718SBorislav Petkov extern u64 relocated_ramdisk; 32*5aa3d718SBorislav Petkov 3315c55443SJaswinder Singh Rajput /* Interrupt control for vSMPowered x86_64 systems */ 3470511134SRavikiran G Thirumalai #ifdef CONFIG_X86_64 3515c55443SJaswinder Singh Rajput void vsmp_init(void); 36129d8bc8SYinghai Lu #else 37129d8bc8SYinghai Lu static inline void vsmp_init(void) { } 38129d8bc8SYinghai Lu #endif 3915c55443SJaswinder Singh Rajput 4015c55443SJaswinder Singh Rajput void setup_bios_corruption_check(void); 4115c55443SJaswinder Singh Rajput 4215c55443SJaswinder Singh Rajput #ifdef CONFIG_X86_VISWS 4315c55443SJaswinder Singh Rajput extern void visws_early_detect(void); 4415c55443SJaswinder Singh Rajput #else 4515c55443SJaswinder Singh Rajput static inline void visws_early_detect(void) { } 4615c55443SJaswinder Singh Rajput #endif 4715c55443SJaswinder Singh Rajput 4815c55443SJaswinder Singh Rajput extern unsigned long saved_video_mode; 4915c55443SJaswinder Singh Rajput 508fee697dSThomas Gleixner extern void reserve_standard_io_resources(void); 518fee697dSThomas Gleixner extern void i386_reserve_resources(void); 52845b3944SThomas Gleixner extern void setup_default_timer_irq(void); 538fee697dSThomas Gleixner 54933b9463SAlan Cox #ifdef CONFIG_X86_INTEL_MID 55712b6aa8SKuppuswamy Sathyanarayanan extern void x86_intel_mid_early_setup(void); 563f4110a4SThomas Gleixner #else 57712b6aa8SKuppuswamy Sathyanarayanan static inline void x86_intel_mid_early_setup(void) { } 583f4110a4SThomas Gleixner #endif 593f4110a4SThomas Gleixner 60c751e17bSThomas Gleixner #ifdef CONFIG_X86_INTEL_CE 61c751e17bSThomas Gleixner extern void x86_ce4100_early_setup(void); 62c751e17bSThomas Gleixner #else 63c751e17bSThomas Gleixner static inline void x86_ce4100_early_setup(void) { } 64c751e17bSThomas Gleixner #endif 65c751e17bSThomas Gleixner 66bb898558SAl Viro #ifndef _SETUP 67bb898558SAl Viro 68bb898558SAl Viro /* 69bb898558SAl Viro * This is set up by the setup-routine at boot-time 70bb898558SAl Viro */ 71bb898558SAl Viro extern struct boot_params boot_params; 72bb898558SAl Viro 73bb898558SAl Viro /* 74bb898558SAl Viro * Do NOT EVER look at the BIOS memory size location. 75bb898558SAl Viro * It does not work on many machines. 76bb898558SAl Viro */ 77bb898558SAl Viro #define LOWMEMSIZE() (0x9f000) 78bb898558SAl Viro 7993dbda7cSJeremy Fitzhardinge /* exceedingly early brk-like allocator */ 8093dbda7cSJeremy Fitzhardinge extern unsigned long _brk_end; 8193dbda7cSJeremy Fitzhardinge void *extend_brk(size_t size, size_t align); 8293dbda7cSJeremy Fitzhardinge 83796216a5SJeremy Fitzhardinge /* 84796216a5SJeremy Fitzhardinge * Reserve space in the brk section. The name must be unique within 85796216a5SJeremy Fitzhardinge * the file, and somewhat descriptive. The size is in bytes. Must be 86796216a5SJeremy Fitzhardinge * used at file scope. 87796216a5SJeremy Fitzhardinge * 88796216a5SJeremy Fitzhardinge * (This uses a temp function to wrap the asm so we can pass it the 89796216a5SJeremy Fitzhardinge * size parameter; otherwise we wouldn't be able to. We can't use a 90796216a5SJeremy Fitzhardinge * "section" attribute on a normal variable because it always ends up 91796216a5SJeremy Fitzhardinge * being @progbits, which ends up allocating space in the vmlinux 92796216a5SJeremy Fitzhardinge * executable.) 93796216a5SJeremy Fitzhardinge */ 94796216a5SJeremy Fitzhardinge #define RESERVE_BRK(name,sz) \ 952895cd2aSSteven Rostedt static void __section(.discard.text) __used notrace \ 96796216a5SJeremy Fitzhardinge __brk_reservation_fn_##name##__(void) { \ 97796216a5SJeremy Fitzhardinge asm volatile ( \ 98796216a5SJeremy Fitzhardinge ".pushsection .brk_reservation,\"aw\",@nobits;" \ 990b1c723dSJeremy Fitzhardinge ".brk." #name ":" \ 100796216a5SJeremy Fitzhardinge " 1:.skip %c0;" \ 1010b1c723dSJeremy Fitzhardinge " .size .brk." #name ", . - 1b;" \ 102796216a5SJeremy Fitzhardinge " .popsection" \ 103796216a5SJeremy Fitzhardinge : : "i" (sz)); \ 104796216a5SJeremy Fitzhardinge } 105796216a5SJeremy Fitzhardinge 106161b0275SJeremy Fitzhardinge /* Helper for reserving space for arrays of things */ 107161b0275SJeremy Fitzhardinge #define RESERVE_BRK_ARRAY(type, name, entries) \ 108161b0275SJeremy Fitzhardinge type *name; \ 109161b0275SJeremy Fitzhardinge RESERVE_BRK(name, sizeof(type) * entries) 110161b0275SJeremy Fitzhardinge 1115d94e81fSDan Williams extern void probe_roms(void); 112bb898558SAl Viro #ifdef __i386__ 113bb898558SAl Viro 114a1ed4ddfSAndi Kleen asmlinkage void __init i386_start_kernel(void); 115bb898558SAl Viro 116bb898558SAl Viro #else 117a1ed4ddfSAndi Kleen asmlinkage void __init x86_64_start_kernel(char *real_mode); 118a1ed4ddfSAndi Kleen asmlinkage void __init x86_64_start_reservations(char *real_mode_data); 119bb898558SAl Viro 120bb898558SAl Viro #endif /* __i386__ */ 121bb898558SAl Viro #endif /* _SETUP */ 122796216a5SJeremy Fitzhardinge #else 123796216a5SJeremy Fitzhardinge #define RESERVE_BRK(name,sz) \ 124796216a5SJeremy Fitzhardinge .pushsection .brk_reservation,"aw",@nobits; \ 1250b1c723dSJeremy Fitzhardinge .brk.name: \ 126796216a5SJeremy Fitzhardinge 1: .skip sz; \ 1270b1c723dSJeremy Fitzhardinge .size .brk.name,.-1b; \ 128796216a5SJeremy Fitzhardinge .popsection 129bb898558SAl Viro #endif /* __ASSEMBLY__ */ 1301965aae3SH. Peter Anvin #endif /* _ASM_X86_SETUP_H */ 131