cregit-Linux how code gets into the kernel

Release 4.14 arch/m68k/kernel/machine_kexec.c

Directory: arch/m68k/kernel
// SPDX-License-Identifier: GPL-2.0
/*
 * machine_kexec.c - handle transition of Linux booting another kernel
 */
#include <linux/compiler.h>
#include <linux/kexec.h>
#include <linux/mm.h>
#include <linux/delay.h>

#include <asm/cacheflush.h>
#include <asm/page.h>
#include <asm/setup.h>

extern const unsigned char relocate_new_kernel[];
extern const size_t relocate_new_kernel_size;


int machine_kexec_prepare(struct kimage *kimage) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Geert Uytterhoeven13100.00%1100.00%
Total13100.00%1100.00%


void machine_kexec_cleanup(struct kimage *kimage) { }

Contributors

PersonTokensPropCommitsCommitProp
Geert Uytterhoeven9100.00%1100.00%
Total9100.00%1100.00%


void machine_shutdown(void) { }

Contributors

PersonTokensPropCommitsCommitProp
Geert Uytterhoeven6100.00%1100.00%
Total6100.00%1100.00%


void machine_crash_shutdown(struct pt_regs *regs) { }

Contributors

PersonTokensPropCommitsCommitProp
Geert Uytterhoeven9100.00%1100.00%
Total9100.00%1100.00%

typedef void (*relocate_kernel_t)(unsigned long ptr, unsigned long start, unsigned long cpu_mmu_flags) __noreturn;
void machine_kexec(struct kimage *image) { void *reboot_code_buffer; unsigned long cpu_mmu_flags; reboot_code_buffer = page_address(image->control_code_page); memcpy(reboot_code_buffer, relocate_new_kernel, relocate_new_kernel_size); /* * we do not want to be bothered. */ local_irq_disable(); pr_info("Will call new kernel at 0x%08lx. Bye...\n", image->start); __flush_cache_all(); cpu_mmu_flags = m68k_cputype | m68k_mmutype << 8; ((relocate_kernel_t) reboot_code_buffer)(image->head & PAGE_MASK, image->start, cpu_mmu_flags); }

Contributors

PersonTokensPropCommitsCommitProp
Geert Uytterhoeven80100.00%1100.00%
Total80100.00%1100.00%


Overall Contributors

PersonTokensPropCommitsCommitProp
Geert Uytterhoeven17199.42%150.00%
Greg Kroah-Hartman10.58%150.00%
Total172100.00%2100.00%
Directory: arch/m68k/kernel
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.