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