Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  restart-poweroff.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Power off by restarting and let u-boot keep hold of the machine
 * until the user presses a button for example.
 *
 * Andrew Lunn <andrew@lunn.ch>
 *
 * Copyright (C) 2012 Andrew Lunn
 */

#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/of_platform.h>
#include <linux/module.h>
#include <linux/reboot.h>

static int restart_poweroff_do_poweroff(struct sys_off_data *data)
{
 reboot_mode = REBOOT_HARD;
 machine_restart(NULL);
 return NOTIFY_DONE;
}

static int restart_poweroff_probe(struct platform_device *pdev)
{
 /* Set this handler to low priority to not override an existing handler */
 return devm_register_sys_off_handler(&pdev->dev,
          SYS_OFF_MODE_POWER_OFF,
          SYS_OFF_PRIO_LOW,
          restart_poweroff_do_poweroff,
          NULL);
}

static const struct of_device_id of_restart_poweroff_match[] = {
 { .compatible = "restart-poweroff", },
 {},
};
MODULE_DEVICE_TABLE(of, of_restart_poweroff_match);

static struct platform_driver restart_poweroff_driver = {
 .probe = restart_poweroff_probe,
 .driver = {
  .name = "poweroff-restart",
  .of_match_table = of_restart_poweroff_match,
 },
};
module_platform_driver(restart_poweroff_driver);

MODULE_AUTHOR("Andrew Lunn );
MODULE_DESCRIPTION("restart poweroff driver");
MODULE_ALIAS("platform:poweroff-restart");

Messung V0.5
C=97 H=96 G=96

¤ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge