cmdline.c 776 B

12345678910111213141516171819202122232425262728293031323334
  1. #include "misc.h"
  2. #if CONFIG_EARLY_PRINTK || CONFIG_RANDOMIZE_BASE
  3. static unsigned long fs;
  4. static inline void set_fs(unsigned long seg)
  5. {
  6. fs = seg << 4; /* shift it back */
  7. }
  8. typedef unsigned long addr_t;
  9. static inline char rdfs8(addr_t addr)
  10. {
  11. return *((char *)(fs + addr));
  12. }
  13. #include "../cmdline.c"
  14. static unsigned long get_cmd_line_ptr(void)
  15. {
  16. unsigned long cmd_line_ptr = boot_params->hdr.cmd_line_ptr;
  17. cmd_line_ptr |= (u64)boot_params->ext_cmd_line_ptr << 32;
  18. return cmd_line_ptr;
  19. }
  20. int cmdline_find_option(const char *option, char *buffer, int bufsize)
  21. {
  22. return __cmdline_find_option(get_cmd_line_ptr(), option, buffer, bufsize);
  23. }
  24. int cmdline_find_option_bool(const char *option)
  25. {
  26. return __cmdline_find_option_bool(get_cmd_line_ptr(), option);
  27. }
  28. #endif