boot.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef _ASM_X86_BOOT_H
  2. #define _ASM_X86_BOOT_H
  3. #include <asm/pgtable_types.h>
  4. #include <uapi/asm/boot.h>
  5. /* Physical address where kernel should be loaded. */
  6. #define LOAD_PHYSICAL_ADDR ((CONFIG_PHYSICAL_START \
  7. + (CONFIG_PHYSICAL_ALIGN - 1)) \
  8. & ~(CONFIG_PHYSICAL_ALIGN - 1))
  9. /* Minimum kernel alignment, as a power of two */
  10. #ifdef CONFIG_X86_64
  11. # define MIN_KERNEL_ALIGN_LG2 PMD_SHIFT
  12. #else
  13. # define MIN_KERNEL_ALIGN_LG2 (PAGE_SHIFT + THREAD_SIZE_ORDER)
  14. #endif
  15. #define MIN_KERNEL_ALIGN (_AC(1, UL) << MIN_KERNEL_ALIGN_LG2)
  16. #if (CONFIG_PHYSICAL_ALIGN & (CONFIG_PHYSICAL_ALIGN-1)) || \
  17. (CONFIG_PHYSICAL_ALIGN < MIN_KERNEL_ALIGN)
  18. # error "Invalid value for CONFIG_PHYSICAL_ALIGN"
  19. #endif
  20. #ifdef CONFIG_KERNEL_BZIP2
  21. # define BOOT_HEAP_SIZE 0x400000
  22. #else /* !CONFIG_KERNEL_BZIP2 */
  23. # define BOOT_HEAP_SIZE 0x10000
  24. #endif
  25. #ifdef CONFIG_X86_64
  26. # define BOOT_STACK_SIZE 0x4000
  27. # define BOOT_INIT_PGT_SIZE (6*4096)
  28. # ifdef CONFIG_RANDOMIZE_BASE
  29. /*
  30. * Assuming all cross the 512GB boundary:
  31. * 1 page for level4
  32. * (2+2)*4 pages for kernel, param, cmd_line, and randomized kernel
  33. * 2 pages for first 2M (video RAM: CONFIG_X86_VERBOSE_BOOTUP).
  34. * Total is 19 pages.
  35. */
  36. # ifdef CONFIG_X86_VERBOSE_BOOTUP
  37. # define BOOT_PGT_SIZE (19*4096)
  38. # else /* !CONFIG_X86_VERBOSE_BOOTUP */
  39. # define BOOT_PGT_SIZE (17*4096)
  40. # endif
  41. # else /* !CONFIG_RANDOMIZE_BASE */
  42. # define BOOT_PGT_SIZE BOOT_INIT_PGT_SIZE
  43. # endif
  44. #else /* !CONFIG_X86_64 */
  45. # define BOOT_STACK_SIZE 0x1000
  46. #endif
  47. #endif /* _ASM_X86_BOOT_H */