reset.c 749 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Reset a DECstation machine.
  4. *
  5. * Copyright (C) 199x the Anonymous
  6. * Copyright (C) 2001, 2002, 2003 Maciej W. Rozycki
  7. */
  8. #include <linux/interrupt.h>
  9. #include <linux/linkage.h>
  10. #include <asm/addrspace.h>
  11. typedef void __noreturn (* noret_func_t)(void);
  12. static inline void __noreturn back_to_prom(void)
  13. {
  14. noret_func_t func = (void *)CKSEG1ADDR(0x1fc00000);
  15. func();
  16. }
  17. void __noreturn dec_machine_restart(char *command)
  18. {
  19. back_to_prom();
  20. }
  21. void __noreturn dec_machine_halt(void)
  22. {
  23. back_to_prom();
  24. }
  25. void __noreturn dec_machine_power_off(void)
  26. {
  27. /* DECstations don't have a software power switch */
  28. back_to_prom();
  29. }
  30. irqreturn_t dec_intr_halt(int irq, void *dev_id)
  31. {
  32. dec_machine_halt();
  33. }