setup.h 3.2 KB

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