reset.c 594 B

12345678910111213141516171819202122232425262728293031
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (C) 2011-2012 Synopsys, Inc. (www.synopsys.com)
  4. */
  5. #include <linux/kernel.h>
  6. #include <linux/printk.h>
  7. #include <linux/reboot.h>
  8. #include <linux/pm.h>
  9. void machine_halt(void)
  10. {
  11. /* Halt the processor */
  12. __asm__ __volatile__("flag 1\n");
  13. }
  14. void machine_restart(char *__unused)
  15. {
  16. /* Soft reset : jump to reset vector */
  17. pr_info("Put your restart handler here\n");
  18. machine_halt();
  19. }
  20. void machine_power_off(void)
  21. {
  22. /* FIXME :: power off ??? */
  23. machine_halt();
  24. }
  25. void (*pm_power_off) (void) = NULL;
  26. EXPORT_SYMBOL(pm_power_off);