blob: b68e3033e6b9bd6fa76f89e3fbaa034823790ad7 [file] [log] [blame]
Yinghai Lu8fee13a2010-08-02 16:21:22 -07001#include "misc.h"
2
Kees Cook8ab38202013-10-10 17:18:14 -07003#if CONFIG_EARLY_PRINTK || CONFIG_RANDOMIZE_BASE
Gokul Caushikbd448d42012-07-19 18:04:42 -07004
Yinghai Lu8fee13a2010-08-02 16:21:22 -07005static unsigned long fs;
6static inline void set_fs(unsigned long seg)
7{
8 fs = seg << 4; /* shift it back */
9}
10typedef unsigned long addr_t;
11static inline char rdfs8(addr_t addr)
12{
13 return *((char *)(fs + addr));
14}
15#include "../cmdline.c"
Yinghai Luf1da8342013-01-24 12:19:57 -080016static unsigned long get_cmd_line_ptr(void)
17{
18 unsigned long cmd_line_ptr = real_mode->hdr.cmd_line_ptr;
19
Yinghai Luee92d812013-01-28 20:16:44 -080020 cmd_line_ptr |= (u64)real_mode->ext_cmd_line_ptr << 32;
21
Yinghai Luf1da8342013-01-24 12:19:57 -080022 return cmd_line_ptr;
23}
Yinghai Lu8fee13a2010-08-02 16:21:22 -070024int cmdline_find_option(const char *option, char *buffer, int bufsize)
25{
Yinghai Luf1da8342013-01-24 12:19:57 -080026 return __cmdline_find_option(get_cmd_line_ptr(), option, buffer, bufsize);
Yinghai Lu8fee13a2010-08-02 16:21:22 -070027}
28int cmdline_find_option_bool(const char *option)
29{
Yinghai Luf1da8342013-01-24 12:19:57 -080030 return __cmdline_find_option_bool(get_cmd_line_ptr(), option);
Yinghai Lu8fee13a2010-08-02 16:21:22 -070031}
Gokul Caushikbd448d42012-07-19 18:04:42 -070032
33#endif