locking/refcounts: Include fewer headers in <linux/refcount.h>
[linux/fpc-iii.git] / arch / x86 / boot / compressed / cmdline.c
blobaf6cda0b7900f02ef9d975a3b484236c1dbaa0c9
1 // SPDX-License-Identifier: GPL-2.0
2 #include "misc.h"
4 #if CONFIG_EARLY_PRINTK || CONFIG_RANDOMIZE_BASE || CONFIG_X86_5LEVEL
6 static unsigned long fs;
7 static inline void set_fs(unsigned long seg)
9 fs = seg << 4; /* shift it back */
11 typedef unsigned long addr_t;
12 static inline char rdfs8(addr_t addr)
14 return *((char *)(fs + addr));
16 #include "../cmdline.c"
17 unsigned long get_cmd_line_ptr(void)
19 unsigned long cmd_line_ptr = boot_params->hdr.cmd_line_ptr;
21 cmd_line_ptr |= (u64)boot_params->ext_cmd_line_ptr << 32;
23 return cmd_line_ptr;
25 int cmdline_find_option(const char *option, char *buffer, int bufsize)
27 return __cmdline_find_option(get_cmd_line_ptr(), option, buffer, bufsize);
29 int cmdline_find_option_bool(const char *option)
31 return __cmdline_find_option_bool(get_cmd_line_ptr(), option);
34 #endif