setup.h 3.6 KB

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