Exemple #1
0
int machine_kexec_prepare(struct kimage *image)
{
	void *reboot_code_buffer;

	/* Can't replace kernel image since it is read-only. */
	if (ipl_flags & IPL_NSS_VALID)
		return -ENOSYS;

	if (image->type == KEXEC_TYPE_CRASH)
		return machine_kexec_prepare_kdump();

	/* We don't support anything but the default image type for now. */
	if (image->type != KEXEC_TYPE_DEFAULT)
		return -EINVAL;

	/* Get the destination where the assembler code should be copied to.*/
	reboot_code_buffer = (void *) page_to_phys(image->control_code_page);

	/* Then copy it */
	memcpy(reboot_code_buffer, relocate_kernel, relocate_kernel_len);
	return 0;
}
int machine_kexec_prepare(struct kimage *image)
{
	void *reboot_code_buffer;

	/*                                                   */
	if (ipl_flags & IPL_NSS_VALID)
		return -ENOSYS;

	if (image->type == KEXEC_TYPE_CRASH)
		return machine_kexec_prepare_kdump();

	/*                                                               */
	if (image->type != KEXEC_TYPE_DEFAULT)
		return -EINVAL;

	/*                                                                  */
	reboot_code_buffer = (void *) page_to_phys(image->control_code_page);

	/*              */
	memcpy(reboot_code_buffer, relocate_kernel, relocate_kernel_len);
	return 0;
}