setup.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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. /*
  7. * Any setup quirks to be performed?
  8. */
  9. struct mpc_cpu;
  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. char * (*arch_memory_setup)(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_pre_intr_init(void);
  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. #ifndef _SETUP
  69. /*
  70. * This is set up by the setup-routine at boot-time
  71. */
  72. extern struct boot_params boot_params;
  73. /*
  74. * Do NOT EVER look at the BIOS memory size location.
  75. * It does not work on many machines.
  76. */
  77. #define LOWMEMSIZE() (0x9f000)
  78. /* exceedingly early brk-like allocator */
  79. extern unsigned long _brk_end;
  80. void *extend_brk(size_t size, size_t align);
  81. /*
  82. * Reserve space in the brk section. The name must be unique within
  83. * the file, and somewhat descriptive. The size is in bytes. Must be
  84. * used at file scope.
  85. *
  86. * (This uses a temp function to wrap the asm so we can pass it the
  87. * size parameter; otherwise we wouldn't be able to. We can't use a
  88. * "section" attribute on a normal variable because it always ends up
  89. * being @progbits, which ends up allocating space in the vmlinux
  90. * executable.)
  91. */
  92. #define RESERVE_BRK(name,sz) \
  93. static void __section(.discard) __used \
  94. __brk_reservation_fn_##name##__(void) { \
  95. asm volatile ( \
  96. ".pushsection .brk_reservation,\"aw\",@nobits;" \
  97. ".brk." #name ":" \
  98. " 1:.skip %c0;" \
  99. " .size .brk." #name ", . - 1b;" \
  100. " .popsection" \
  101. : : "i" (sz)); \
  102. }
  103. #ifdef __i386__
  104. void __init i386_start_kernel(void);
  105. extern void probe_roms(void);
  106. #else
  107. void __init x86_64_start_kernel(char *real_mode);
  108. void __init x86_64_start_reservations(char *real_mode_data);
  109. #endif /* __i386__ */
  110. #endif /* _SETUP */
  111. #else
  112. #define RESERVE_BRK(name,sz) \
  113. .pushsection .brk_reservation,"aw",@nobits; \
  114. .brk.name: \
  115. 1: .skip sz; \
  116. .size .brk.name,.-1b; \
  117. .popsection
  118. #endif /* __ASSEMBLY__ */
  119. #endif /* __KERNEL__ */
  120. #endif /* _ASM_X86_SETUP_H */