11965aae3SH. Peter Anvin #ifndef _ASM_X86_SETUP_H 21965aae3SH. Peter Anvin #define _ASM_X86_SETUP_H 3bb898558SAl Viro 4dbca1df4SCyrill Gorcunov #ifdef __KERNEL__ 5dbca1df4SCyrill Gorcunov 6bb898558SAl Viro #define COMMAND_LINE_SIZE 2048 7bb898558SAl Viro 8bb898558SAl Viro #ifdef __i386__ 9bb898558SAl Viro 10bb898558SAl Viro #include <linux/pfn.h> 11bb898558SAl Viro /* 12bb898558SAl Viro * Reserved space for vmalloc and iomap - defined in asm/page.h 13bb898558SAl Viro */ 14bb898558SAl Viro #define MAXMEM_PFN PFN_DOWN(MAXMEM) 15bb898558SAl Viro #define MAX_NONPAE_PFN (1 << 20) 16bb898558SAl Viro 17bb898558SAl Viro #endif /* __i386__ */ 18bb898558SAl Viro 19bb898558SAl Viro #define PARAM_SIZE 4096 /* sizeof(struct boot_params) */ 20bb898558SAl Viro 21bb898558SAl Viro #define OLD_CL_MAGIC 0xA33F 22bb898558SAl Viro #define OLD_CL_ADDRESS 0x020 /* Relative to real mode data */ 23bb898558SAl Viro #define NEW_CL_POINTER 0x228 /* Relative to real mode data */ 24bb898558SAl Viro 25bb898558SAl Viro #ifndef __ASSEMBLY__ 26bb898558SAl Viro #include <asm/bootparam.h> 27*845b3944SThomas Gleixner #include <asm/x86_init.h> 28bb898558SAl Viro 2915c55443SJaswinder Singh Rajput /* Interrupt control for vSMPowered x86_64 systems */ 3070511134SRavikiran G Thirumalai #ifdef CONFIG_X86_64 3115c55443SJaswinder Singh Rajput void vsmp_init(void); 32129d8bc8SYinghai Lu #else 33129d8bc8SYinghai Lu static inline void vsmp_init(void) { } 34129d8bc8SYinghai Lu #endif 3515c55443SJaswinder Singh Rajput 3615c55443SJaswinder Singh Rajput void setup_bios_corruption_check(void); 3715c55443SJaswinder Singh Rajput 3815c55443SJaswinder Singh Rajput #ifdef CONFIG_X86_VISWS 3915c55443SJaswinder Singh Rajput extern void visws_early_detect(void); 4015c55443SJaswinder Singh Rajput extern int is_visws_box(void); 4115c55443SJaswinder Singh Rajput #else 4215c55443SJaswinder Singh Rajput static inline void visws_early_detect(void) { } 4315c55443SJaswinder Singh Rajput static inline int is_visws_box(void) { return 0; } 4415c55443SJaswinder Singh Rajput #endif 4515c55443SJaswinder Singh Rajput 4615c55443SJaswinder Singh Rajput extern unsigned long saved_video_mode; 4715c55443SJaswinder Singh Rajput 488fee697dSThomas Gleixner extern void reserve_standard_io_resources(void); 498fee697dSThomas Gleixner extern void i386_reserve_resources(void); 50*845b3944SThomas Gleixner extern void setup_default_timer_irq(void); 518fee697dSThomas Gleixner 52bb898558SAl Viro #ifndef _SETUP 53bb898558SAl Viro 54bb898558SAl Viro /* 55bb898558SAl Viro * This is set up by the setup-routine at boot-time 56bb898558SAl Viro */ 57bb898558SAl Viro extern struct boot_params boot_params; 58bb898558SAl Viro 59bb898558SAl Viro /* 60bb898558SAl Viro * Do NOT EVER look at the BIOS memory size location. 61bb898558SAl Viro * It does not work on many machines. 62bb898558SAl Viro */ 63bb898558SAl Viro #define LOWMEMSIZE() (0x9f000) 64bb898558SAl Viro 6593dbda7cSJeremy Fitzhardinge /* exceedingly early brk-like allocator */ 6693dbda7cSJeremy Fitzhardinge extern unsigned long _brk_end; 6793dbda7cSJeremy Fitzhardinge void *extend_brk(size_t size, size_t align); 6893dbda7cSJeremy Fitzhardinge 69796216a5SJeremy Fitzhardinge /* 70796216a5SJeremy Fitzhardinge * Reserve space in the brk section. The name must be unique within 71796216a5SJeremy Fitzhardinge * the file, and somewhat descriptive. The size is in bytes. Must be 72796216a5SJeremy Fitzhardinge * used at file scope. 73796216a5SJeremy Fitzhardinge * 74796216a5SJeremy Fitzhardinge * (This uses a temp function to wrap the asm so we can pass it the 75796216a5SJeremy Fitzhardinge * size parameter; otherwise we wouldn't be able to. We can't use a 76796216a5SJeremy Fitzhardinge * "section" attribute on a normal variable because it always ends up 77796216a5SJeremy Fitzhardinge * being @progbits, which ends up allocating space in the vmlinux 78796216a5SJeremy Fitzhardinge * executable.) 79796216a5SJeremy Fitzhardinge */ 80796216a5SJeremy Fitzhardinge #define RESERVE_BRK(name,sz) \ 81796216a5SJeremy Fitzhardinge static void __section(.discard) __used \ 82796216a5SJeremy Fitzhardinge __brk_reservation_fn_##name##__(void) { \ 83796216a5SJeremy Fitzhardinge asm volatile ( \ 84796216a5SJeremy Fitzhardinge ".pushsection .brk_reservation,\"aw\",@nobits;" \ 850b1c723dSJeremy Fitzhardinge ".brk." #name ":" \ 86796216a5SJeremy Fitzhardinge " 1:.skip %c0;" \ 870b1c723dSJeremy Fitzhardinge " .size .brk." #name ", . - 1b;" \ 88796216a5SJeremy Fitzhardinge " .popsection" \ 89796216a5SJeremy Fitzhardinge : : "i" (sz)); \ 90796216a5SJeremy Fitzhardinge } 91796216a5SJeremy Fitzhardinge 92bb898558SAl Viro #ifdef __i386__ 93bb898558SAl Viro 94bb898558SAl Viro void __init i386_start_kernel(void); 95bb898558SAl Viro extern void probe_roms(void); 96bb898558SAl Viro 97bb898558SAl Viro #else 98bb898558SAl Viro void __init x86_64_start_kernel(char *real_mode); 99bb898558SAl Viro void __init x86_64_start_reservations(char *real_mode_data); 100bb898558SAl Viro 101bb898558SAl Viro #endif /* __i386__ */ 102bb898558SAl Viro #endif /* _SETUP */ 103796216a5SJeremy Fitzhardinge #else 104796216a5SJeremy Fitzhardinge #define RESERVE_BRK(name,sz) \ 105796216a5SJeremy Fitzhardinge .pushsection .brk_reservation,"aw",@nobits; \ 1060b1c723dSJeremy Fitzhardinge .brk.name: \ 107796216a5SJeremy Fitzhardinge 1: .skip sz; \ 1080b1c723dSJeremy Fitzhardinge .size .brk.name,.-1b; \ 109796216a5SJeremy Fitzhardinge .popsection 110bb898558SAl Viro #endif /* __ASSEMBLY__ */ 111bb898558SAl Viro #endif /* __KERNEL__ */ 112bb898558SAl Viro 1131965aae3SH. Peter Anvin #endif /* _ASM_X86_SETUP_H */ 114