diff options
Diffstat (limited to 'arch/x86/boot/boot.h')
-rw-r--r-- | arch/x86/boot/boot.h | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/arch/x86/boot/boot.h b/arch/x86/boot/boot.h index 18997e5a1053..5b7531966b84 100644 --- a/arch/x86/boot/boot.h +++ b/arch/x86/boot/boot.h | |||
@@ -285,16 +285,26 @@ struct biosregs { | |||
285 | void intcall(u8 int_no, const struct biosregs *ireg, struct biosregs *oreg); | 285 | void intcall(u8 int_no, const struct biosregs *ireg, struct biosregs *oreg); |
286 | 286 | ||
287 | /* cmdline.c */ | 287 | /* cmdline.c */ |
288 | int __cmdline_find_option(u32 cmdline_ptr, const char *option, char *buffer, int bufsize); | 288 | int __cmdline_find_option(unsigned long cmdline_ptr, const char *option, char *buffer, int bufsize); |
289 | int __cmdline_find_option_bool(u32 cmdline_ptr, const char *option); | 289 | int __cmdline_find_option_bool(unsigned long cmdline_ptr, const char *option); |
290 | static inline int cmdline_find_option(const char *option, char *buffer, int bufsize) | 290 | static inline int cmdline_find_option(const char *option, char *buffer, int bufsize) |
291 | { | 291 | { |
292 | return __cmdline_find_option(boot_params.hdr.cmd_line_ptr, option, buffer, bufsize); | 292 | unsigned long cmd_line_ptr = boot_params.hdr.cmd_line_ptr; |
293 | |||
294 | if (cmd_line_ptr >= 0x100000) | ||
295 | return -1; /* inaccessible */ | ||
296 | |||
297 | return __cmdline_find_option(cmd_line_ptr, option, buffer, bufsize); | ||
293 | } | 298 | } |
294 | 299 | ||
295 | static inline int cmdline_find_option_bool(const char *option) | 300 | static inline int cmdline_find_option_bool(const char *option) |
296 | { | 301 | { |
297 | return __cmdline_find_option_bool(boot_params.hdr.cmd_line_ptr, option); | 302 | unsigned long cmd_line_ptr = boot_params.hdr.cmd_line_ptr; |
303 | |||
304 | if (cmd_line_ptr >= 0x100000) | ||
305 | return -1; /* inaccessible */ | ||
306 | |||
307 | return __cmdline_find_option_bool(cmd_line_ptr, option); | ||
298 | } | 308 | } |
299 | 309 | ||
300 | 310 | ||