reboot.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright 2010 Tilera Corporation. All Rights Reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation, version 2.
  7. *
  8. * This program is distributed in the hope that it will be useful, but
  9. * WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
  11. * NON INFRINGEMENT. See the GNU General Public License for
  12. * more details.
  13. */
  14. #include <linux/stddef.h>
  15. #include <linux/reboot.h>
  16. #include <linux/smp.h>
  17. #include <linux/pm.h>
  18. #include <linux/export.h>
  19. #include <asm/page.h>
  20. #include <asm/setup.h>
  21. #include <hv/hypervisor.h>
  22. #ifndef CONFIG_SMP
  23. #define smp_send_stop()
  24. #endif
  25. void machine_halt(void)
  26. {
  27. warn_early_printk();
  28. arch_local_irq_disable_all();
  29. smp_send_stop();
  30. hv_halt();
  31. }
  32. void machine_power_off(void)
  33. {
  34. warn_early_printk();
  35. arch_local_irq_disable_all();
  36. smp_send_stop();
  37. hv_power_off();
  38. }
  39. void machine_restart(char *cmd)
  40. {
  41. arch_local_irq_disable_all();
  42. smp_send_stop();
  43. hv_restart((HV_VirtAddr) "vmlinux", (HV_VirtAddr) cmd);
  44. }
  45. /* No interesting distinction to be made here. */
  46. void (*pm_power_off)(void) = NULL;
  47. EXPORT_SYMBOL(pm_power_off);