mirror of
https://github.com/torvalds/linux.git
synced 2024-12-28 05:41:55 +00:00
6655e0aaf7
The non-compressed boot code uses the (much more obvious) name "boot_params" for the global pointer to the x86 boot parameters. The compressed kernel loader code, though, was using the legacy name "real_mode". There is no need to have a different name, and changing it improves readability. Suggested-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Kees Cook <keescook@chromium.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Andrey Ryabinin <aryabinin@virtuozzo.com> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Andy Lutomirski <luto@kernel.org> Cc: Baoquan He <bhe@redhat.com> Cc: Borislav Petkov <bp@alien8.de> Cc: Borislav Petkov <bp@suse.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: Dmitry Vyukov <dvyukov@google.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: H.J. Lu <hjl.tools@gmail.com> Cc: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Yinghai Lu <yinghai@kernel.org> Link: http://lkml.kernel.org/r/1460997735-24785-4-git-send-email-keescook@chromium.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
34 lines
776 B
C
34 lines
776 B
C
#include "misc.h"
|
|
|
|
#if CONFIG_EARLY_PRINTK || CONFIG_RANDOMIZE_BASE
|
|
|
|
static unsigned long fs;
|
|
static inline void set_fs(unsigned long seg)
|
|
{
|
|
fs = seg << 4; /* shift it back */
|
|
}
|
|
typedef unsigned long addr_t;
|
|
static inline char rdfs8(addr_t addr)
|
|
{
|
|
return *((char *)(fs + addr));
|
|
}
|
|
#include "../cmdline.c"
|
|
static unsigned long get_cmd_line_ptr(void)
|
|
{
|
|
unsigned long cmd_line_ptr = boot_params->hdr.cmd_line_ptr;
|
|
|
|
cmd_line_ptr |= (u64)boot_params->ext_cmd_line_ptr << 32;
|
|
|
|
return cmd_line_ptr;
|
|
}
|
|
int cmdline_find_option(const char *option, char *buffer, int bufsize)
|
|
{
|
|
return __cmdline_find_option(get_cmd_line_ptr(), option, buffer, bufsize);
|
|
}
|
|
int cmdline_find_option_bool(const char *option)
|
|
{
|
|
return __cmdline_find_option_bool(get_cmd_line_ptr(), option);
|
|
}
|
|
|
|
#endif
|