misc.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #ifndef BOOT_COMPRESSED_MISC_H
  2. #define BOOT_COMPRESSED_MISC_H
  3. /*
  4. * Special hack: we have to be careful, because no indirections are allowed here,
  5. * and paravirt_ops is a kind of one. As it will only run in baremetal anyway,
  6. * we just keep it from happening. (This list needs to be extended when new
  7. * paravirt and debugging variants are added.)
  8. */
  9. #undef CONFIG_PARAVIRT
  10. #undef CONFIG_PARAVIRT_SPINLOCKS
  11. #undef CONFIG_KASAN
  12. #include <linux/linkage.h>
  13. #include <linux/screen_info.h>
  14. #include <linux/elf.h>
  15. #include <linux/io.h>
  16. #include <asm/page.h>
  17. #include <asm/boot.h>
  18. #include <asm/bootparam.h>
  19. #include <asm/bootparam_utils.h>
  20. #define BOOT_BOOT_H
  21. #include "../ctype.h"
  22. #ifdef CONFIG_X86_64
  23. #define memptr long
  24. #else
  25. #define memptr unsigned
  26. #endif
  27. /* misc.c */
  28. extern memptr free_mem_ptr;
  29. extern memptr free_mem_end_ptr;
  30. extern struct boot_params *real_mode; /* Pointer to real-mode data */
  31. void __putstr(const char *s);
  32. #define error_putstr(__x) __putstr(__x)
  33. #ifdef CONFIG_X86_VERBOSE_BOOTUP
  34. #define debug_putstr(__x) __putstr(__x)
  35. #else
  36. static inline void debug_putstr(const char *s)
  37. { }
  38. #endif
  39. #if CONFIG_EARLY_PRINTK || CONFIG_RANDOMIZE_BASE
  40. /* cmdline.c */
  41. int cmdline_find_option(const char *option, char *buffer, int bufsize);
  42. int cmdline_find_option_bool(const char *option);
  43. #endif
  44. #if CONFIG_RANDOMIZE_BASE
  45. /* aslr.c */
  46. unsigned char *choose_kernel_location(struct boot_params *boot_params,
  47. unsigned char *input,
  48. unsigned long input_size,
  49. unsigned char *output,
  50. unsigned long output_size);
  51. /* cpuflags.c */
  52. bool has_cpuflag(int flag);
  53. #else
  54. static inline
  55. unsigned char *choose_kernel_location(struct boot_params *boot_params,
  56. unsigned char *input,
  57. unsigned long input_size,
  58. unsigned char *output,
  59. unsigned long output_size)
  60. {
  61. return output;
  62. }
  63. #endif
  64. #ifdef CONFIG_EARLY_PRINTK
  65. /* early_serial_console.c */
  66. extern int early_serial_base;
  67. void console_init(void);
  68. #else
  69. static const int early_serial_base;
  70. static inline void console_init(void)
  71. { }
  72. #endif
  73. #endif