cregit-Linux how code gets into the kernel

Release 4.15 kernel/power/poweroff.c

Directory: kernel/power
/*
 * poweroff.c - sysrq handler to gracefully power down machine.
 *
 * This file is released under the GPL v2
 */

#include <linux/kernel.h>
#include <linux/sysrq.h>
#include <linux/init.h>
#include <linux/pm.h>
#include <linux/workqueue.h>
#include <linux/reboot.h>
#include <linux/cpumask.h>

/*
 * When the user hits Sys-Rq o to power down the machine this is the
 * callback we use.
 */


static void do_poweroff(struct work_struct *dummy) { kernel_power_off(); }

Contributors

PersonTokensPropCommitsCommitProp
Andrew Morton1178.57%133.33%
David Howells214.29%133.33%
Eric W. Biedermann17.14%133.33%
Total14100.00%3100.00%

static DECLARE_WORK(poweroff_work, do_poweroff);
static void handle_poweroff(int key) { /* run sysrq poweroff on boot cpu */ schedule_work_on(cpumask_first(cpu_online_mask), &poweroff_work); }

Contributors

PersonTokensPropCommitsCommitProp
Patrick Mochel1047.62%125.00%
Rui Zhang523.81%125.00%
Andrew Morton419.05%125.00%
Rusty Russell29.52%125.00%
Total21100.00%4100.00%

static struct sysrq_key_op sysrq_poweroff_op = { .handler = handle_poweroff, .help_msg = "poweroff(o)", .action_msg = "Power Off", .enable_mask = SYSRQ_ENABLE_BOOT, };
static int __init pm_sysrq_init(void) { register_sysrq_key('o', &sysrq_poweroff_op); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Patrick Mochel1995.00%150.00%
Jan Beulich15.00%150.00%
Total20100.00%2100.00%

subsys_initcall(pm_sysrq_init);

Overall Contributors

PersonTokensPropCommitsCommitProp
Patrick Mochel6655.93%110.00%
Andrew Morton2722.88%110.00%
Rui Zhang86.78%110.00%
Jan Kara65.08%110.00%
Eric W. Biedermann43.39%110.00%
David Howells21.69%110.00%
Rusty Russell21.69%110.00%
Jan Beulich10.85%110.00%
Olaf Hering10.85%110.00%
Jovi Zhangwei10.85%110.00%
Total118100.00%10100.00%
Directory: kernel/power
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.