reset.c 778 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright (C) 2009 Michal Simek <monstr@monstr.eu>
  3. * Copyright (C) 2009 PetaLogix
  4. *
  5. * This file is subject to the terms and conditions of the GNU General Public
  6. * License. See the file "COPYING" in the main directory of this archive
  7. * for more details.
  8. */
  9. #include <linux/init.h>
  10. #include <linux/delay.h>
  11. #include <linux/reboot.h>
  12. void machine_shutdown(void)
  13. {
  14. pr_notice("Machine shutdown...\n");
  15. while (1)
  16. ;
  17. }
  18. void machine_halt(void)
  19. {
  20. pr_notice("Machine halt...\n");
  21. while (1)
  22. ;
  23. }
  24. void machine_power_off(void)
  25. {
  26. pr_notice("Machine power off...\n");
  27. while (1)
  28. ;
  29. }
  30. void machine_restart(char *cmd)
  31. {
  32. do_kernel_restart(cmd);
  33. /* Give the restart hook 1 s to take us down */
  34. mdelay(1000);
  35. pr_emerg("Reboot failed -- System halted\n");
  36. while (1);
  37. }