misc.h 1.9 KB

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