setup.h 3.7 KB

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