setup.h 3.1 KB

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