diff options
| author | H. Peter Anvin <[email protected]> | 2013-02-15 09:25:08 -0800 | 
|---|---|---|
| committer | H. Peter Anvin <[email protected]> | 2013-02-15 09:25:08 -0800 | 
| commit | 0da3e7f526fde7a6522a3038b7ce609fc50f6707 (patch) | |
| tree | c6e2dacd96fe7eac8312f3d7c22e0995dc423879 /arch/x86/include/asm/bootparam_utils.h | |
| parent | 95c9608478d639dcffc14ea47b31bff021a99ed1 (diff) | |
| parent | 68d00bbebb5a48b7a9056a8c03476a71ecbc30a6 (diff) | |
Merge branch 'x86/mm2' into x86/mm
x86/mm2 is testing out fine, but has developed conflicts with x86/mm
due to patches in adjacent code.  Merge them so we can drop x86/mm2
and have a unified branch.
Resolved Conflicts:
	arch/x86/kernel/setup.c
Diffstat (limited to 'arch/x86/include/asm/bootparam_utils.h')
| -rw-r--r-- | arch/x86/include/asm/bootparam_utils.h | 38 | 
1 files changed, 38 insertions, 0 deletions
| diff --git a/arch/x86/include/asm/bootparam_utils.h b/arch/x86/include/asm/bootparam_utils.h new file mode 100644 index 000000000000..5b5e9cb774b5 --- /dev/null +++ b/arch/x86/include/asm/bootparam_utils.h @@ -0,0 +1,38 @@ +#ifndef _ASM_X86_BOOTPARAM_UTILS_H +#define _ASM_X86_BOOTPARAM_UTILS_H + +#include <asm/bootparam.h> + +/* + * This file is included from multiple environments.  Do not + * add completing #includes to make it standalone. + */ + +/* + * Deal with bootloaders which fail to initialize unknown fields in + * boot_params to zero.  The list fields in this list are taken from + * analysis of kexec-tools; if other broken bootloaders initialize a + * different set of fields we will need to figure out how to disambiguate. + * + */ +static void sanitize_boot_params(struct boot_params *boot_params) +{ +	if (boot_params->sentinel) { +		/*fields in boot_params are not valid, clear them */ +		memset(&boot_params->olpc_ofw_header, 0, +		       (char *)&boot_params->alt_mem_k - +			(char *)&boot_params->olpc_ofw_header); +		memset(&boot_params->kbd_status, 0, +		       (char *)&boot_params->hdr - +		       (char *)&boot_params->kbd_status); +		memset(&boot_params->_pad7[0], 0, +		       (char *)&boot_params->edd_mbr_sig_buffer[0] - +			(char *)&boot_params->_pad7[0]); +		memset(&boot_params->_pad8[0], 0, +		       (char *)&boot_params->eddbuf[0] - +			(char *)&boot_params->_pad8[0]); +		memset(&boot_params->_pad9[0], 0, sizeof(boot_params->_pad9)); +	} +} + +#endif /* _ASM_X86_BOOTPARAM_UTILS_H */ |