cregit-Linux how code gets into the kernel

Release 4.14 arch/sh/kernel/reboot.c

Directory: arch/sh/kernel
// SPDX-License-Identifier: GPL-2.0
#include <linux/pm.h>
#include <linux/kexec.h>
#include <linux/kernel.h>
#include <linux/reboot.h>
#include <linux/module.h>
#ifdef CONFIG_SUPERH32
#include <asm/watchdog.h>
#endif
#include <asm/addrspace.h>
#include <asm/reboot.h>
#include <asm/tlbflush.h>
#include <asm/traps.h>


void (*pm_power_off)(void);

EXPORT_SYMBOL(pm_power_off);

#ifdef CONFIG_SUPERH32

static void watchdog_trigger_immediate(void) { sh_wdt_write_cnt(0xFF); sh_wdt_write_csr(0xC2); }

Contributors

PersonTokensPropCommitsCommitProp
Paul Mundt18100.00%1100.00%
Total18100.00%1100.00%

#endif
static void native_machine_restart(char * __unused) { local_irq_disable(); /* Destroy all of the TLBs in preparation for reset by MMU */ __flush_tlb_global(); /* Address error with SR.BL=1 first. */ trigger_address_error(); #ifdef CONFIG_SUPERH32 /* If that fails or is unsupported, go for the watchdog next. */ watchdog_trigger_immediate(); #endif /* * Give up and sleep. */ while (1) cpu_sleep(); }

Contributors

PersonTokensPropCommitsCommitProp
Paul Mundt38100.00%2100.00%
Total38100.00%2100.00%


static void native_machine_shutdown(void) { smp_send_stop(); }

Contributors

PersonTokensPropCommitsCommitProp
Paul Mundt11100.00%1100.00%
Total11100.00%1100.00%


static void native_machine_power_off(void) { if (pm_power_off) pm_power_off(); }

Contributors

PersonTokensPropCommitsCommitProp
Paul Mundt15100.00%1100.00%
Total15100.00%1100.00%


static void native_machine_halt(void) { /* stop other cpus */ machine_shutdown(); /* stop this cpu */ stop_this_cpu(NULL); }

Contributors

PersonTokensPropCommitsCommitProp
Paul Mundt18100.00%1100.00%
Total18100.00%1100.00%

struct machine_ops machine_ops = { .power_off = native_machine_power_off, .shutdown = native_machine_shutdown, .restart = native_machine_restart, .halt = native_machine_halt, #ifdef CONFIG_KEXEC .crash_shutdown = native_machine_crash_shutdown, #endif };
void machine_power_off(void) { machine_ops.power_off(); }

Contributors

PersonTokensPropCommitsCommitProp
Paul Mundt12100.00%1100.00%
Total12100.00%1100.00%


void machine_shutdown(void) { machine_ops.shutdown(); }

Contributors

PersonTokensPropCommitsCommitProp
Paul Mundt12100.00%1100.00%
Total12100.00%1100.00%


void machine_restart(char *cmd) { machine_ops.restart(cmd); }

Contributors

PersonTokensPropCommitsCommitProp
Paul Mundt16100.00%1100.00%
Total16100.00%1100.00%


void machine_halt(void) { machine_ops.halt(); }

Contributors

PersonTokensPropCommitsCommitProp
Paul Mundt12100.00%1100.00%
Total12100.00%1100.00%

#ifdef CONFIG_KEXEC
void machine_crash_shutdown(struct pt_regs *regs) { machine_ops.crash_shutdown(regs); }

Contributors

PersonTokensPropCommitsCommitProp
Paul Mundt17100.00%1100.00%
Total17100.00%1100.00%

#endif

Overall Contributors

PersonTokensPropCommitsCommitProp
Paul Mundt26398.87%250.00%
David Howells20.75%125.00%
Greg Kroah-Hartman10.38%125.00%
Total266100.00%4100.00%
Directory: arch/sh/kernel
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.