misc.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. #ifdef CONFIG_X86_32
  10. #define _ASM_X86_DESC_H 1
  11. #endif
  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(unsigned char *input,
  47. unsigned long input_size,
  48. unsigned char *output,
  49. unsigned long output_size);
  50. /* cpuflags.c */
  51. bool has_cpuflag(int flag);
  52. #else
  53. static inline
  54. unsigned char *choose_kernel_location(unsigned char *input,
  55. unsigned long input_size,
  56. unsigned char *output,
  57. unsigned long output_size)
  58. {
  59. return output;
  60. }
  61. #endif
  62. #ifdef CONFIG_EARLY_PRINTK
  63. /* early_serial_console.c */
  64. extern int early_serial_base;
  65. void console_init(void);
  66. #else
  67. static const int early_serial_base;
  68. static inline void console_init(void)
  69. { }
  70. #endif
  71. #endif