reset.c 529 B

12345678910111213141516171819202122232425262728293031323334
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (C) 2012 Regents of the University of California
  4. */
  5. #include <linux/reboot.h>
  6. #include <linux/pm.h>
  7. static void default_power_off(void)
  8. {
  9. while (1)
  10. wait_for_interrupt();
  11. }
  12. void (*pm_power_off)(void) = NULL;
  13. EXPORT_SYMBOL(pm_power_off);
  14. void machine_restart(char *cmd)
  15. {
  16. do_kernel_restart(cmd);
  17. while (1);
  18. }
  19. void machine_halt(void)
  20. {
  21. do_kernel_power_off();
  22. default_power_off();
  23. }
  24. void machine_power_off(void)
  25. {
  26. do_kernel_power_off();
  27. default_power_off();
  28. }