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