setup.h 3.7 KB

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