Merge branch 'core-speculation-for-linus' of git://git.kernel.org/pub/scm/linux/kerne...
[linux-2.6-microblaze.git] / arch / x86 / boot / compressed / cmdline.c
1 // SPDX-License-Identifier: GPL-2.0
2 #include "misc.h"
3
4 static unsigned long fs;
5 static inline void set_fs(unsigned long seg)
6 {
7         fs = seg << 4;  /* shift it back */
8 }
9 typedef unsigned long addr_t;
10 static inline char rdfs8(addr_t addr)
11 {
12         return *((char *)(fs + addr));
13 }
14 #include "../cmdline.c"
15 unsigned long get_cmd_line_ptr(void)
16 {
17         unsigned long cmd_line_ptr = boot_params->hdr.cmd_line_ptr;
18
19         cmd_line_ptr |= (u64)boot_params->ext_cmd_line_ptr << 32;
20
21         return cmd_line_ptr;
22 }
23 int cmdline_find_option(const char *option, char *buffer, int bufsize)
24 {
25         return __cmdline_find_option(get_cmd_line_ptr(), option, buffer, bufsize);
26 }
27 int cmdline_find_option_bool(const char *option)
28 {
29         return __cmdline_find_option_bool(get_cmd_line_ptr(), option);
30 }