reset.c 809 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright (C) 2009 Michal Simek <[email protected]>
  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/of_platform.h>
  12. #include <linux/reboot.h>
  13. void machine_shutdown(void)
  14. {
  15. pr_notice("Machine shutdown...\n");
  16. while (1)
  17. ;
  18. }
  19. void machine_halt(void)
  20. {
  21. pr_notice("Machine halt...\n");
  22. while (1)
  23. ;
  24. }
  25. void machine_power_off(void)
  26. {
  27. pr_notice("Machine power off...\n");
  28. while (1)
  29. ;
  30. }
  31. void machine_restart(char *cmd)
  32. {
  33. do_kernel_restart(cmd);
  34. /* Give the restart hook 1 s to take us down */
  35. mdelay(1000);
  36. pr_emerg("Reboot failed -- System halted\n");
  37. while (1);
  38. }